1 #ifndef LAP_DoubleBandedStorage_H
2 #define LAP_DoubleBandedStorage_H
51 mBandsNumber=mUBandsNumber+mLBandsNumber-1;
68 inline static SP::LAP_DoubleBandedStorage
New() {
84 return ( (j>=i+mUBandsNumber) || (j+mLBandsNumber<=i) )?
getNullValue():(*this)[mUBandsNumber-1+(i-j)+mBandsNumber*j];
91 return ( (j>=i+mUBandsNumber) || (j+mLBandsNumber<=i) )?
getNullValue():(*this)[mUBandsNumber-1+(i-j)+mBandsNumber*j];
148 void add(
const double& alpha,
199 mBandsNumber= mUBandsNumber+mLBandsNumber-1;
205 mBandsNumber= mUBandsNumber+mLBandsNumber-1;
212 mBandsNumber= mUBandsNumber+mLBandsNumber-1;
243 return mUBandsNumber;
248 return mLBandsNumber;
276 virtual double trace()
const;
virtual double & operator()(const tLVectorIndex &i, const tLVectorIndex &j)
accessor of element at row i and column j taking into account the view only use the upper diagonal ...
Definition: LAP_DoubleBandedStorage.h:82
tBoolean copyFullStorage(const tBoolean &isSymmetric, const tBoolean &isUpper, const tBoolean &isTransposed, const tLVectorIndex &nViewedRows, const tLVectorIndex &nViewedCols, const tLVectorIncrement &incx, const tLVectorIndex &ldx, const double *x)
copy the upper part of full array of size nRows*nCols
Definition: LAP_DoubleBandedStorage.cpp:45
LAP_DoubleBandedStorage()
build a matrix
Definition: LAP_DoubleBandedStorage.h:47
const tLVectorIndex & getLowerBandsNumber() const
get the lower bands number
Definition: LAP_DoubleBandedStorage.h:247
double & getNullValue()
get a null value
Definition: LAP_Object.h:54
virtual double trace() const
return trace
Definition: LAP_DoubleBandedStorage.cpp:1440
tBoolean compile()
compile the matrix to optimal bands number
Definition: LAP_DoubleBandedStorage.h:222
pair< tLVectorIndex, tLVectorIndex > computeBandsNumber() const
GET.
Definition: LAP_DoubleBandedStorage.cpp:380
double max(const tFlag &d, const tLVectorIndex &index) const
make get max among the direction if (d==ROW) max of all the columns of row index if (d==COL) max of a...
Definition: LAP_DoubleBandedStorage.cpp:1349
DEFINE_SPTR(LAP_DoubleBandMatrix)
void setLowerBandsNumber(const tLVectorIndex &n)
set lower bands number
Definition: LAP_DoubleBandedStorage.h:203
this class describes a banded storage for lapack used where values are stored in vector of size (nSBa...
Definition: LAP_DoubleBandedStorage.h:24
const tLVectorIndex & setBandsNumber(const tLVectorIndex &u, const tLVectorIndex &l)
set bands number
Definition: LAP_DoubleBandedStorage.h:209
LAP_DoubleBandedStorage & operator-=(const lapack_real &s)
sub s to the upper matrix viewed term by term taking into account the view
#define tBoolean
Definition: types.h:48
#define lapack_real
Definition: lapack_functions.h:9
const tLVectorIndex & getBandsNumber() const
get the bands number
Definition: LAP_DoubleBandedStorage.h:237
const tLVectorIndex & getUpperBandsNumber() const
get the upper bands number
Definition: LAP_DoubleBandedStorage.h:242
virtual ~LAP_DoubleBandedStorage()
destroy a matrix
Definition: LAP_DoubleBandedStorage.h:57
tBoolean copyPackStorage(const tLVectorIndex &nX, const double *x)
copy the packed array of memory nx such that nx=n*(n+1)/2 where n is the dimension of the vector stor...
Definition: LAP_DoubleBandedStorage.cpp:273
void add(const double &alpha, const LAP_DoubleBandedStorage &B)
This += alpha . B.
Definition: LAP_DoubleBandedStorage.h:138
static SP::LAP_DoubleBandedStorage New()
create a new banded storage class
Definition: LAP_DoubleBandedStorage.h:68
void indexMin(tLVectorIndex &i, tLVectorIndex &j) const
get the index of the min view element in absolute value
Definition: LAP_DoubleBandedStorage.cpp:1261
virtual void addDiagonal(const double &alpha)
This += alpha . I.
Definition: LAP_DoubleBandedStorage.cpp:1465
tLVectorIndex getValuesNumber() const
get the number of values
Definition: LAP_DoubleMatrixStorage.h:178
LAP_DoubleBandedStorage & operator*=(const lapack_real &s)
multiply by s the matrix viewed term by term taking into account the view
LAP_DoubleBandedStorage & operator/=(const lapack_real &s)
divide by s the matrix viewed term by term taking into account the view
#define tLVectorIndex
Definition: lapack_types.h:13
tBoolean updateBandsNumber(const std::pair< tLVectorIndex, tLVectorIndex > &nBands)
update the bands number
Definition: LAP_DoubleBandedStorage.cpp:448
LAP_DoubleBandedStorage & operator^=(const lapack_real &s)
power by s the matrix viewed term by term taking into account the view
Definition: LAP_DoubleBandedStorage.cpp:519
void setUpperBandsNumber(const tLVectorIndex &n)
set upper bands number
Definition: LAP_DoubleBandedStorage.h:197
#define tLVectorIncrement
Definition: lapack_types.h:16
LAP_DoubleBandedStorage & operator+=(const lapack_real &s)
add s to the upper matrix viewed term by term taking into account the view
tBoolean copyBandStorage(const tLVectorIndex &nX, const tLVectorIndex &nUBands, const tLVectorIndex &nLBands, const double *x)
copy the band array x of size nBands x nRow from the first row of the first column ...
Definition: LAP_DoubleBandedStorage.cpp:339
Definition: LAP_DoubleMatrixStorage.h:16
virtual const double & operator()(const tLVectorIndex &i, const tLVectorIndex &j) const
accessor of element at row i and column j taking into account the view only use the upper diagonal ...
Definition: LAP_DoubleBandedStorage.h:90
virtual tBoolean copy(const tBoolean &isSymmetric, const tBoolean &isUpper, const tBoolean &isTransposed, const LAP_DoubleMatrixStorage &x)
copy the storage
Definition: LAP_DoubleBandedStorage.cpp:11
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106
#define tFlag
Definition: types.h:14