#include <MatrixInt.hpp>
Rectangular matrices are stored by columns
Public Member Functions | |
MatrixInt (Id nrow=0, Id ncol=0) | |
MatrixInt (const MatrixInt &r) | |
MatrixInt & | operator= (const MatrixInt &r) |
virtual | ~MatrixInt () |
String | toString (const AStringFormat *strfmt=nullptr) const override |
ICloneable interface. | |
void | reset (Id nrows, Id ncols) |
void | resetFromArray (Id nrows, Id ncols, const Id *tab, bool byCol=true) |
Id | getValue (Id irow, Id icol) const |
Id | getValue (Id irank) const |
void | setValueByRank (Id rank, Id value) |
void | setValue (Id irow, Id icol, Id value) |
Id | getMatrixSize () const |
Id | size () const |
getValues () const | |
getValuesPerRow (Id irow) const | |
getValuesPerColumn (Id icol) const | |
getMatrix () const | |
void | setValues (const 1 &values, bool byCol=true) |
void | setValuesOldStyle (const Id *values, bool byCol=true) |
void | transposeInPlace () |
bool | empty () const |
void | fill (Id value) |
Id | getNCols () const |
void | setNCols (Id cols) |
Id | getNRows () const |
void | setNRows (Id rows) |
Id | operator() (Id irow, Id icol) const |
Id & | operator() (Id irow, Id icol) |
![]() | |
AStringable () | |
AStringable (const AStringable &r) | |
AStringable & | operator= (const AStringable &r) |
virtual | ~AStringable () |
virtual void | display (const AStringFormat *strfmt=nullptr) const final |
virtual void | display (Id level) const final |
![]() | |
ICloneable () | |
virtual | ~ICloneable () |
virtual ICloneable * | clone () const =0 |
std::shared_ptr< ICloneable > | cloneShared () const |
std::unique_ptr< ICloneable > | cloneUnique () const |
Static Public Member Functions | |
static MatrixInt * | createFromVI (const 1 &X, Id nrow, Id ncol, bool byCol=false) |
static MatrixInt * | createFromVVI (const 1 &X) |
gstlrn::MatrixInt::MatrixInt | ( | const MatrixInt & | r | ) |
|
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 gstlrn::MatrixInt::fill | ( | Id | value | ) |
gstlrn::MatrixInt::getMatrix | ( | ) | const |
Id gstlrn::MatrixInt::getMatrixSize | ( | ) | const |
|
inline |
|
inline |
gstlrn::MatrixInt::getValues | ( | ) | const |
gstlrn::MatrixInt::getValuesPerColumn | ( | Id | icol | ) | const |
gstlrn::MatrixInt::getValuesPerRow | ( | Id | irow | ) | const |
|
inline |
|
inline |
void gstlrn::MatrixInt::setValues | ( | const 1 & | 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 Id* array
values | Input array (Dimension: nrow * ncol) |
byCol | true for Column major; false for Row Major |
void gstlrn::MatrixInt::setValuesOldStyle | ( | const Id * | values, |
bool | byCol = true |
||
) |
|
inline |
|
overridevirtual |
void gstlrn::MatrixInt::transposeInPlace | ( | ) |