14 #ifndef CT_GENERALMATRIX_H
15 #define CT_GENERALMATRIX_H
52 virtual void zero() = 0;
59 virtual void mult(
const doublereal* b, doublereal* prod)
const = 0;
66 virtual void leftMult(
const doublereal*
const b, doublereal*
const prod)
const = 0;
88 virtual doublereal
rcondQR() = 0;
98 virtual doublereal
rcond(doublereal a1norm) = 0;
112 virtual doublereal
oneNorm()
const = 0;
115 virtual size_t nRows()
const = 0;
123 virtual size_t nRowsAndStruct(
size_t*
const iStruct = 0)
const = 0;
132 virtual int solve(doublereal* b) = 0;
143 virtual doublereal*
ptrColumn(
size_t j) = 0;
152 virtual doublereal&
operator()(
size_t i,
size_t j) = 0;
161 virtual doublereal
operator()(
size_t i,
size_t j)
const = 0;
174 virtual vector_fp::iterator
begin() = 0;
180 virtual vector_fp::const_iterator
begin()
const = 0;
190 virtual doublereal*
const*
colPts() = 0;
201 virtual size_t checkRows(doublereal& valueSmall)
const = 0;
212 virtual size_t checkColumns(doublereal& valueSmall)
const = 0;
virtual int factorQR()=0
Factors the A matrix using the QR algorithm, overwriting A.
virtual doublereal * ptrColumn(size_t j)=0
Return a pointer to the top of column j, columns are assumed to be contiguous in memory.
int matrixType_
Matrix type.
virtual void useFactorAlgorithm(int fAlgorithm)=0
Change the way the matrix is factored.
virtual GeneralMatrix * duplMyselfAsGeneralMatrix() const =0
Duplicator member function.
virtual doublereal oneNorm() const =0
Calculate the one norm of the matrix.
virtual size_t nRows() const =0
Return the number of rows in the matrix.
virtual doublereal rcond(doublereal a1norm)=0
Returns an estimate of the inverse of the condition number for the matrix.
GeneralMatrix(int matType)
Base Constructor.
virtual vector_fp::iterator begin()=0
Return an iterator pointing to the first element.
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
virtual int factorAlgorithm() const =0
Return the factor algorithm used.
virtual int factor()=0
Factors the A matrix, overwriting A.
virtual void zero()=0
Zero the matrix elements.
virtual doublereal & operator()(size_t i, size_t j)=0
Index into the (i,j) element.
virtual bool factored() const =0
true if the current factorization is up to date with the matrix
virtual ~GeneralMatrix()
Destructor. Does nothing.
virtual size_t checkRows(doublereal &valueSmall) const =0
Check to see if we have any zero rows in the jacobian.
virtual void clearFactorFlag()=0
clear the factored flag
virtual void leftMult(const doublereal *const b, doublereal *const prod) const =0
Multiply b*A and write result to prod.
virtual void mult(const doublereal *b, doublereal *prod) const =0
Multiply A*b and write result to prod.
virtual size_t nRowsAndStruct(size_t *const iStruct=0) const =0
Return the size and structure of the matrix.
virtual void copyData(const GeneralMatrix &y)=0
Copy the data from one array into another without doing any checking.
virtual size_t checkColumns(doublereal &valueSmall) const =0
Check to see if we have any zero columns in the jacobian.
virtual int solve(doublereal *b)=0
Solves the Ax = b system returning x in the b spot.
virtual doublereal *const * colPts()=0
Return a vector of const pointers to the columns.
GeneralMatrix & operator=(const GeneralMatrix &right)
Assignment operator.
virtual doublereal rcondQR()=0
Returns an estimate of the inverse of the condition number for the matrix.