1.8.0
CCC
 
Loading...
Searching...
No Matches
gstlrn::MatrixInt Class Reference

#include <MatrixInt.hpp>

Inheritance diagram for gstlrn::MatrixInt:
gstlrn::AStringable gstlrn::ICloneable

Detailed Description

Rectangular matrices are stored by columns

Public Member Functions

 MatrixInt (Id nrow=0, Id ncol=0)
 
 MatrixInt (const MatrixInt &r)
 
MatrixIntoperator= (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
 
Idoperator() (Id irow, Id icol)
 
- Public Member Functions inherited from gstlrn::AStringable
 AStringable ()
 
 AStringable (const AStringable &r)
 
AStringableoperator= (const AStringable &r)
 
virtual ~AStringable ()
 
virtual void display (const AStringFormat *strfmt=nullptr) const final
 
virtual void display (Id level) const final
 
- Public Member Functions inherited from gstlrn::ICloneable
 ICloneable ()
 
virtual ~ICloneable ()
 
virtual ICloneableclone () const =0
 
std::shared_ptr< ICloneablecloneShared () const
 
std::unique_ptr< ICloneablecloneUnique () const
 

Static Public Member Functions

static MatrixIntcreateFromVI (const 1 &X, Id nrow, Id ncol, bool byCol=false)
 
static MatrixIntcreateFromVVI (const 1 &X)
 

Constructor & Destructor Documentation

◆ MatrixInt() [1/2]

gstlrn::MatrixInt::MatrixInt ( Id  nrow = 0,
Id  ncol = 0 
)

◆ MatrixInt() [2/2]

gstlrn::MatrixInt::MatrixInt ( const MatrixInt r)

◆ ~MatrixInt()

gstlrn::MatrixInt::~MatrixInt ( )
virtual

Member Function Documentation

◆ createFromVI()

MatrixInt * gstlrn::MatrixInt::createFromVI ( const 1 &  X,
Id  nrow,
Id  ncol,
bool  byCol = false 
)
static

◆ createFromVVI()

MatrixInt * gstlrn::MatrixInt::createFromVVI ( const 1 &  X)
static

Converts a VectorVectorInt into a MatrixInt Note: the input argument is stored by row (if coming from [] specification)

Parameters
XInput VectorVectorInt argument
Returns
The returned rectangular matrix
Remarks
: the matrix is transposed implicitly while reading

◆ empty()

bool gstlrn::MatrixInt::empty ( ) const
inline

◆ fill()

void gstlrn::MatrixInt::fill ( Id  value)

◆ getMatrix()

gstlrn::MatrixInt::getMatrix ( ) const

◆ getMatrixSize()

Id gstlrn::MatrixInt::getMatrixSize ( ) const

◆ getNCols()

Id gstlrn::MatrixInt::getNCols ( ) const
inline

◆ getNRows()

Id gstlrn::MatrixInt::getNRows ( ) const
inline

◆ getValue() [1/2]

Id gstlrn::MatrixInt::getValue ( Id  irank) const

◆ getValue() [2/2]

Id gstlrn::MatrixInt::getValue ( Id  irow,
Id  icol 
) const

◆ getValues()

gstlrn::MatrixInt::getValues ( ) const

◆ getValuesPerColumn()

gstlrn::MatrixInt::getValuesPerColumn ( Id  icol) const

◆ getValuesPerRow()

gstlrn::MatrixInt::getValuesPerRow ( Id  irow) const

◆ operator()() [1/2]

Id & gstlrn::MatrixInt::operator() ( Id  irow,
Id  icol 
)
inline

Set value operator override

◆ operator()() [2/2]

Id gstlrn::MatrixInt::operator() ( Id  irow,
Id  icol 
) const
inline

Get value operator override

◆ operator=()

MatrixInt & gstlrn::MatrixInt::operator= ( const MatrixInt r)

◆ reset()

void gstlrn::MatrixInt::reset ( Id  nrows,
Id  ncols 
)

◆ resetFromArray()

void gstlrn::MatrixInt::resetFromArray ( Id  nrows,
Id  ncols,
const Id tab,
bool  byCol = true 
)

◆ setNCols()

void gstlrn::MatrixInt::setNCols ( Id  cols)
inline

◆ setNRows()

void gstlrn::MatrixInt::setNRows ( Id  rows)
inline

◆ setValue()

void gstlrn::MatrixInt::setValue ( Id  irow,
Id  icol,
Id  value 
)

◆ setValueByRank()

void gstlrn::MatrixInt::setValueByRank ( Id  rank,
Id  value 
)

◆ setValues()

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

Parameters
valuesInput array (Dimension: nrow * ncol)
byColtrue for Column major; false for Row Major

◆ setValuesOldStyle()

void gstlrn::MatrixInt::setValuesOldStyle ( const Id values,
bool  byCol = true 
)

◆ size()

Id gstlrn::MatrixInt::size ( ) const
inline

◆ toString()

String gstlrn::MatrixInt::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

ICloneable interface.

AStringable Interface

Reimplemented from gstlrn::AStringable.

◆ transposeInPlace()

void gstlrn::MatrixInt::transposeInPlace ( )

The documentation for this class was generated from the following files: