Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

LSquares.H

Go to the documentation of this file.
00001 
00002 /* _______              __
00003   / ___/ /  ___  __ _  / /  ___
00004  / /__/ _ \/ _ \/  ' \/ _ \/ _ \
00005  \___/_//_/\___/_/_/_/_.__/\___/ 
00006 */
00007 //
00008 // This software is copyright (C) by the Lawrence Berkeley
00009 // National Laboratory.  Permission is granted to reproduce
00010 // this software for non-commercial purposes provided that
00011 // this notice is left intact.
00012 // 
00013 // It is acknowledged that the U.S. Government has rights to
00014 // this software under Contract DE-AC03-765F00098 between
00015 // the U.S.  Department of Energy and the University of
00016 // California.
00017 //
00018 // This software is provided as a professional and academic
00019 // contribution for joint exchange. Thus it is experimental,
00020 // is provided ``as is'', with no warranties of any kind
00021 // whatsoever, no support, no promise of updates, or printed
00022 // documentation. By using this software, you acknowledge
00023 // that the Lawrence Berkeley National Laboratory and
00024 // Regents of the University of California shall have no
00025 // liability with respect to the infringement of other
00026 // copyrights by any part of this software.
00027 #ifndef _LSquares_H_
00028 #define _LSquares_H_
00029 
00030 class LSquares
00031 {
00032 public: 
00033   void LeastSquares(Real** A,
00034                     Vector<Real>&x,
00035                     const Vector<Real>&rhs);
00036 
00037   int gaussElim(Real**A,
00038                 Vector<Real>& rhs);
00039 
00040   void swapRows(Real** A,
00041                 const int& rowi,
00042                 const int& rowj, 
00043                 const int&numberOfCols);
00044 
00045   void swapRows(Vector<Real>& rhs, 
00046                 const int& currRow,
00047                 const int& pivot);
00048 
00049   int findPivot(Real** A,
00050                 const int& currCol,
00051                 const int& currRow, 
00052                 const int& numRows,
00053                 int& pivot);
00054 
00055   void addRows(Vector<Real>& rhs,
00056                const int& rowi,
00057                const Real& alpha,
00058                const int& rowj);
00059                
00060   void addRows(Real** A,
00061                const int& rowi,
00062                const Real& alpha,
00063                const int& rowj, 
00064                const int& numberOfCols);
00065 
00066   void timesBeta(Vector<Real>&rhs,
00067                  const int& currRow,
00068                  const Real& Beta);
00069 
00070   void timesBeta(Real** A,
00071                  const int& rowi,
00072                  const Real& Beta, 
00073                  const int& numberOfcols);
00074 
00075   void transpose(Real** a_A,
00076                  Real ** a_Atrans, 
00077                  const int& a_numRows, 
00078                  const int& a_numCols);
00079 
00080   void matMul(Real** a_A,
00081               Real** a_B,
00082               Real** a_C,
00083               const int& a_numRowsA, 
00084               const int& a_numColsA,
00085               const int& a_numColsB);
00086   
00087   void backSolve(Real** a_A, 
00088                  const Vector<Real>& a_rhs, 
00089                  const int& a_numArows,
00090                  Vector<Real>& a_x);
00091 
00092   void AtimesX(Real** A,
00093                const Vector<Real>&x,
00094                const int& numRowsA,
00095                Vector<Real>& Ax);
00096 
00097   void allocArray(const int& rows,
00098                   const int& cols, 
00099                   Real**& A);
00100 
00101   void freeArray(const int& rows,
00102                  const int& cols, 
00103                  Real**& A);
00104 
00105   void output(const int& rows,
00106               const int& cols, 
00107               Real**& A,
00108               char* name);
00109 };
00110 
00111 #endif
00112 

Generated on Wed Apr 16 14:31:05 2003 for EBChombo by doxygen1.2.16