1.2.2
CCC
 
MatrixInt Class Reference

#include <MatrixInt.hpp>

Inheritance diagram for MatrixInt:
AStringable ICloneable

Public Member Functions

 MatrixInt (int nrow=0, int ncol=0)
 
 MatrixInt (const MatrixInt &m)
 
MatrixIntoperator= (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)
 
AStringableoperator= (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 ICloneableclone () const =0
 

Static Public Member Functions

static MatrixIntcreateFromVI (const VectorInt &X, int nrow, int ncol, bool byCol=false)
 
static MatrixIntcreateFromVVI (const VectorVectorInt &X)
 

Detailed Description

Rectangular matrices are stored by columns

Constructor & Destructor Documentation

MatrixInt::MatrixInt ( int  nrow = 0,
int  ncol = 0 
)
MatrixInt::MatrixInt ( const MatrixInt m)
MatrixInt::~MatrixInt ( )
virtual

Member Function Documentation

MatrixInt * MatrixInt::createFromVI ( const VectorInt X,
int  nrow,
int  ncol,
bool  byCol = false 
)
static
MatrixInt * MatrixInt::createFromVVI ( const VectorVectorInt 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
bool MatrixInt::empty ( ) const
inline
void MatrixInt::fill ( int  value)
VectorVectorInt MatrixInt::getMatrix ( ) const
int MatrixInt::getMatrixSize ( ) const
int MatrixInt::getNCols ( ) const
inline
int MatrixInt::getNRows ( ) const
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
int MatrixInt::operator() ( int  irow,
int  icol 
) const
inline

Get value operator override

int& MatrixInt::operator() ( int  irow,
int  icol 
)
inline

Set value operator override

MatrixInt & MatrixInt::operator= ( const MatrixInt r)
void MatrixInt::reset ( int  nrows,
int  ncols 
)
void MatrixInt::resetFromArray ( int  nrows,
int  ncols,
const int *  tab,
bool  byCol = true 
)
void MatrixInt::setNCols ( int  cols)
inline
void MatrixInt::setNRows ( int  rows)
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

Parameters
valuesInput array (Dimension: nrow * ncol)
byColtrue for Column major; false for Row Major
void MatrixInt::setValuesOldStyle ( const int *  values,
bool  byCol = true 
)
int MatrixInt::size ( ) const
inline
String MatrixInt::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

ICloneable interface.

AStringable Interface

Reimplemented from AStringable.

void MatrixInt::transposeInPlace ( )

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