#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) |
void | resetFromArray (int nrows, int ncols, const int *tab, bool byCol=true) |
int | getValue (int irow, int icol) const |
int | getValue (int irank) const |
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 * | createFromVI (const VectorInt &X, int nrow, int ncol, bool byCol=false) |
static MatrixInt * | createFromVVI (const VectorVectorInt &X) |
Rectangular matrices are stored by columns
MatrixInt::MatrixInt | ( | int | nrow = 0 , |
int | ncol = 0 |
||
) |
MatrixInt::MatrixInt | ( | const MatrixInt & | m | ) |
|
virtual |
|
static |
|
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 | irow, |
int | icol | ||
) | const |
int MatrixInt::getValue | ( | int | irank | ) | const |
VectorInt MatrixInt::getValues | ( | ) | const |
VectorInt MatrixInt::getValuesPerColumn | ( | int | icol | ) | const |
VectorInt MatrixInt::getValuesPerRow | ( | int | irow | ) | const |
|
inline |
Get value operator override
|
inline |
Set value operator override
void MatrixInt::reset | ( | int | nrows, |
int | ncols | ||
) |
void MatrixInt::resetFromArray | ( | int | nrows, |
int | ncols, | ||
const int * | tab, | ||
bool | byCol = true |
||
) |
|
inline |
|
inline |
void MatrixInt::setValue | ( | int | rank, |
int | value | ||
) |
void MatrixInt::setValue | ( | int | irow, |
int | icol, | ||
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 | ( | ) |