1 #ifndef LAP_MatrixStorage_H
2 #define LAP_MatrixStorage_H
35 SP::LAP_DoubleVector mValues;
69 return (*mValues.get())[index];
75 return (*mValues.get())[index];
97 }
catch(std::exception e) {
98 cout << e.what()<<
"\n";
135 "LAP_DoubleMatrixStorage::setValuesPointer()",
136 "can not set a null values of a matrix");
146 const double* values) {
167 const double *vs=&(*mValues.get())[0];
179 return mValues->getSize();
184 return mValues->getCapacity();
198 return *mValues.
get();
203 return *mValues.
get();
218 virtual double trace()
const=0;
LAP_DoubleVector & getValues()
get the vector values of the matrix
Definition: LAP_DoubleMatrixStorage.h:202
virtual double & operator()(const tLVectorIndex &i, const tLVectorIndex &j)=0
accessor of element at row i and column j taking into account the row
virtual double trace() const =0
compute the trace of the storage
virtual ~LAP_DoubleMatrixStorage()
destroy a matrix
Definition: LAP_DoubleMatrixStorage.h:53
virtual void setValuesPointer(SP::LAP_DoubleVector v)
set the vector values by reference
Definition: LAP_DoubleMatrixStorage.h:132
LAP_DoubleMatrixStorage()
build a matrix
Definition: LAP_DoubleMatrixStorage.h:42
Definition: LAP_DoubleVector.h:20
double getFillRate() const
get the fill rate of the matrix
Definition: LAP_DoubleMatrixStorage.h:189
#define tBoolean
Definition: types.h:48
static double ZERO_EPSILON
Definition: LAP_Object.h:21
#define null
Definition: types.h:13
tLVectorIndex getCapacity() const
get the capacity of values
Definition: LAP_DoubleMatrixStorage.h:183
void init(const double &v)
init the values
Definition: LAP_DoubleMatrixStorage.h:124
virtual void setValuesNumber(const tLVectorIndex &n)
set the values number
Definition: LAP_DoubleMatrixStorage.h:155
virtual void addDiagonal(const double &alpha)=0
add alpha to diagonal
virtual void getValuesPointer(SP::LAP_DoubleVector &v)
Definition: LAP_DoubleMatrixStorage.h:208
const double & operator[](const tLVectorIndex &index) const
get the value at index for reading
Definition: LAP_DoubleMatrixStorage.h:68
this class describes the exceptions raised for CORE package
Definition: CORE_Exception.h:15
This class is the base class of all lapack objects.
Definition: LAP_Object.h:17
virtual pair< tLVectorIndex, tLVectorIndex > computeBandsNumber() const =0
compute the bands number of the storage
virtual tBoolean copy(const tBoolean &isSymmetric, const tBoolean &isUpper, const tBoolean &isTransposed, const LAP_DoubleMatrixStorage &x)
copy the storage
Definition: LAP_DoubleMatrixStorage.h:91
tLVectorIndex getValuesNumber() const
get the number of values
Definition: LAP_DoubleMatrixStorage.h:178
#define tLVectorIndex
Definition: lapack_types.h:13
static SP::LAP_DoubleVector New()
create a new vector of double
Definition: LAP_DoubleVector.h:57
const LAP_DoubleVector & getValues() const
get the vector values of the matrix
Definition: LAP_DoubleMatrixStorage.h:197
void init(const T &v)
init the value to v from the view
Definition: LAP_Vector.h:423
void setValues(const tLVectorIndex &n, T *&values, const tBoolean &isReferenced)
Definition: LAP_Vector.h:270
void copy(const LAP_Vector< lapack_real > &v)
copy the vector v into this. the view is set to [0,v.getSize()[ the viewed values of v is copied into...
Definition: LAP_DoubleVector.h:222
virtual const T & get(const tLVectorIndex &i) const
get element at index i taking into account the view
Definition: LAP_Vector.h:513
Definition: LAP_DoubleMatrixStorage.h:16
double & operator[](const tLVectorIndex &index)
get the value at index fro writing
Definition: LAP_DoubleMatrixStorage.h:74
void setSize(const tLVectorIndex &n)
set the view to [0,n[ by 1 increment if values is too small, re-alocate it
Definition: LAP_Vector.h:360
virtual void setValues(const tLVectorIndex &n, const double *values)
copy the values
Definition: LAP_DoubleMatrixStorage.h:145
virtual tLVectorIndex getNullValuesNumber() const
get the number of null values
Definition: LAP_DoubleMatrixStorage.h:165
DEFINE_SPTR(LAP_DoubleMatrixStorage)