11 #ifndef _LAPACKMATRIX_H_ 12 #define _LAPACKMATRIX_H_ 90 void truncate(
int a_nrow,
int a_ncol);
106 std::pair<int, int>
dims()
const 108 std::pair<int, int> retval;
120 if(&a_matrix !=
this)
142 int offset(
int irow,
int icol)
const;
190 for(
int icol = 1; icol <
m_ncol; icol++)
192 Mvol(irow, icol) = 0.0;
LAPACKMatrix(int a_nrow, int a_ncol)
main constructor. Matrix of Chombo Real type. values are unintitialized
Definition: LAPACKMatrix.H:30
Real normLTwo() const
return sqrt(sum of squares of all values)
LAPACKMatrix(LAPACKMatrix &&a_input)
move copy constructor
Definition: LAPACKMatrix.H:56
int invertUsingLeastSquares()
inverts this matrix using least squares
friend int solveReducedRankLS(LAPACKMatrix &A, LAPACKMatrix &b)
LAPACKMatrix & operator*=(const Real &a_scalingFactor)
int offset(int irow, int icol) const
friend Real getInverseOfUpperTriangularConditionNumber(const LAPACKMatrix &A)
int pseudoInvertUsingSVD(int a_maxiter, Real a_tol)
void define(int nrow, int ncol)
Definition: LAPACKMatrix.H:33
LAPACKMatrix & operator=(LAPACKMatrix &&a_matrix)
move assignment
Definition: LAPACKMatrix.H:118
int pseudoInvertUsingQR()
friend int solveLSTSVDOnce(LAPACKMatrix &X, LAPACKMatrix &B)
static bool s_verbose
Definition: LAPACKMatrix.H:276
bool m_alias
Definition: LAPACKMatrix.H:285
void const char const int const int const int const Real const Real * A
Definition: Lapack.H:83
std::pair< int, int > dims() const
Definition: LAPACKMatrix.H:106
friend int solveLeastSquares(LAPACKMatrix &A, LAPACKMatrix &B)
below stuff is shamelessly stolen from lapackwrapper class
void setVal(const Real &a_val)
friend int solveEqualityConstrainedLS(LAPACKMatrix &A, LAPACKMatrix &c, LAPACKMatrix &B, LAPACKMatrix &d, LAPACKMatrix &x)
static bool s_outputStenData
Definition: LAPACKMatrix.H:278
double Real
Definition: REAL.H:33
void checkUpperTriangularConditionNumber() const
friend int solveLSTSVD(LAPACKMatrix &A, LAPACKMatrix &B, int a_maxiter, Real a_tol)
Definition: LAPACKMatrix.H:24
int m_nrow
Definition: LAPACKMatrix.H:282
Real * m_data
Definition: LAPACKMatrix.H:284
LAPACKMatrix(int a_nrow, int a_ncol, Real *a_data)
alias constructor. Use a_data as m_data, does not delete it in destructor
Definition: LAPACKMatrix.H:46
int invertUsingSVD(int a_maxiter, Real a_tol)
inverts this matrix using SVD
LAPACKMatrix & operator=(const LAPACKMatrix &a_matrix)
deep assign.
LAPACKMatrix & operator+=(const LAPACKMatrix &a_matrix)
void truncate(int a_nrow, int a_ncol)
static bool s_checkConditionNumber
turn on if you want every solve to check the condition number
Definition: LAPACKMatrix.H:273
const Real & operator()(int irow, int icol) const
void clear()
Definition: LAPACKMatrix.H:61
int m_ncol
Definition: LAPACKMatrix.H:283
void const char const int const int const int const Real const Real const int const Real * B
Definition: Lapack.H:83
friend Real getInverseOfConditionNumber(const LAPACKMatrix &A)
void setSmallCellRow(const int &irow)
Definition: LAPACKMatrix.H:186
void checkConditionNumber() const
void poutDiagMatlab() const
LAPACKMatrix & operator-=(const LAPACKMatrix &a_matrix)
friend int solveLeastSquaresTranspose(LAPACKMatrix &A, LAPACKMatrix &B)
LAPACKMatrix()
null constructor builds matrix with nullptr and size=[0,0]
Definition: LAPACKMatrix.H:50
int invert()
inverts this matix
friend void multiply(LAPACKMatrix &a_product, const LAPACKMatrix &a_left, const LAPACKMatrix &a_right)