gstlearn
1.0.0
CCC
|
#include <MatrixInt.hpp>
Public Member Functions | |
MatrixInt (int nrow=0, int ncol=0) | |
MatrixInt (const MatrixInt &m) | |
MatrixInt & | operator= (const MatrixInt &r) |
virtual | ~MatrixInt () |
virtual String | toString (const AStringFormat *strfmt=nullptr) const override |
ICloneable interface. More... | |
void | reset (int nrows, int ncols) |
int | getValue (int irow, int icol) const |
int | getValue (int irank) const |
int & | getValueRef (int irow, int icol) |
void | setValue (int rank, int value) |
void | setValue (int irow, int icol, int value) |
int | getMatrixSize () const |
int | size () const |
VectorInt | getValues () const |
VectorInt | getValuesPerRow (int irow) const |
VectorInt | getValuesPerColumn (int icol) const |
VectorVectorInt | getMatrix () const |
void | setValues (const VectorInt &values, bool byCol=true) |
void | setValuesOldStyle (const int *values, bool byCol=true) |
void | transposeInPlace () |
bool | empty () const |
void | fill (int value) |
int | getNCols () const |
void | setNCols (int cols) |
int | getNRows () const |
void | setNRows (int rows) |
int | operator() (int irow, int icol) const |
int & | operator() (int irow, int icol) |
Public Member Functions inherited from AStringable | |
AStringable () | |
AStringable (const AStringable &r) | |
AStringable & | operator= (const AStringable &r) |
virtual | ~AStringable () |
virtual void | display (const AStringFormat *strfmt=nullptr) const final |
virtual void | display (int level) const final |
Public Member Functions inherited from ICloneable | |
ICloneable () | |
virtual | ~ICloneable () |
virtual ICloneable * | clone () const =0 |
Static Public Member Functions | |
static MatrixInt * | createFromVVD (const VectorVectorInt &X) |
Private Member Functions | |
void | _allocate () |
void | _deallocate () |
bool | _isIndexValid (int irow, int icol) const |
bool | _isRankValid (int rank) const |
bool | _isNumbersValid (int nrows, int ncols) const |
int | _getIndexToRank (int irow, int icol) const |
Private Attributes | |
int | _nRows |
int | _nCols |
VectorInt | _rectMatrix |
Rectangular matrices are stored by columns
MatrixInt::MatrixInt | ( | int | nrow = 0 , |
int | ncol = 0 |
||
) |
MatrixInt::MatrixInt | ( | const MatrixInt & | m | ) |
|
virtual |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
Converts a VectorVectorInt into a MatrixInt Note: the input argument is stored by row (if coming from [] specification)
X | Input VectorVectorInt argument |
|
inline |
void MatrixInt::fill | ( | int | value | ) |
VectorVectorInt MatrixInt::getMatrix | ( | ) | const |
int MatrixInt::getMatrixSize | ( | ) | const |
|
inline |
|
inline |
int MatrixInt::getValue | ( | int | irank | ) | const |
int MatrixInt::getValue | ( | int | irow, |
int | icol | ||
) | const |
int & MatrixInt::getValueRef | ( | int | irow, |
int | icol | ||
) |
VectorInt MatrixInt::getValues | ( | ) | const |
VectorInt MatrixInt::getValuesPerColumn | ( | int | icol | ) | const |
VectorInt MatrixInt::getValuesPerRow | ( | int | irow | ) | const |
|
inline |
Set value operator override
|
inline |
Get value operator override
void MatrixInt::reset | ( | int | nrows, |
int | ncols | ||
) |
|
inline |
|
inline |
void MatrixInt::setValue | ( | int | irow, |
int | icol, | ||
int | value | ||
) |
void MatrixInt::setValue | ( | int | rank, |
int | value | ||
) |
void MatrixInt::setValues | ( | const VectorInt & | values, |
bool | byCol = true |
||
) |
Filling the matrix with an array of values Note that this array is ALWAYS dimensioned to the total number of elements in the matrix. Kept for compatibility with old code where matrix contents was stored as a int* array
values | Input array (Dimension: nrow * ncol) |
byCol | true for Column major; false for Row Major |
void MatrixInt::setValuesOldStyle | ( | const int * | values, |
bool | byCol = true |
||
) |
|
inline |
|
overridevirtual |
void MatrixInt::transposeInPlace | ( | ) |
|
private |
|
private |
|
private |