1.5.1
CCC
 
MatrixInt Class Reference

#include <MatrixInt.hpp>

Inheritance diagram for MatrixInt:
AStringable ICloneable

Detailed Description

Rectangular matrices are stored by columns

Public Member Functions

 MatrixInt (int nrow=0, int ncol=0)
 
 MatrixInt (const MatrixInt &r)
 
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 setValueByRank (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)
 

Constructor & Destructor Documentation

◆ MatrixInt() [1/2]

MatrixInt::MatrixInt ( int  nrow = 0,
int  ncol = 0 
)

◆ MatrixInt() [2/2]

MatrixInt::MatrixInt ( const MatrixInt r)

◆ ~MatrixInt()

MatrixInt::~MatrixInt ( )
virtual

Member Function Documentation

◆ createFromVI()

MatrixInt * MatrixInt::createFromVI ( const VectorInt X,
int  nrow,
int  ncol,
bool  byCol = false 
)
static

◆ createFromVVI()

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

◆ empty()

bool MatrixInt::empty ( ) const
inline

◆ fill()

void MatrixInt::fill ( int  value)

◆ getMatrix()

VectorVectorInt MatrixInt::getMatrix ( ) const

◆ getMatrixSize()

int MatrixInt::getMatrixSize ( ) const

◆ getNCols()

int MatrixInt::getNCols ( ) const
inline

◆ getNRows()

int MatrixInt::getNRows ( ) const
inline

◆ getValue() [1/2]

int MatrixInt::getValue ( int  irank) const

◆ getValue() [2/2]

int MatrixInt::getValue ( int  irow,
int  icol 
) const

◆ getValues()

VectorInt MatrixInt::getValues ( ) const

◆ getValuesPerColumn()

VectorInt MatrixInt::getValuesPerColumn ( int  icol) const

◆ getValuesPerRow()

VectorInt MatrixInt::getValuesPerRow ( int  irow) const

◆ operator()() [1/2]

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

Set value operator override

◆ operator()() [2/2]

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

Get value operator override

◆ operator=()

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

◆ reset()

void MatrixInt::reset ( int  nrows,
int  ncols 
)

◆ resetFromArray()

void MatrixInt::resetFromArray ( int  nrows,
int  ncols,
const int *  tab,
bool  byCol = true 
)

◆ setNCols()

void MatrixInt::setNCols ( int  cols)
inline

◆ setNRows()

void MatrixInt::setNRows ( int  rows)
inline

◆ setValue()

void MatrixInt::setValue ( int  irow,
int  icol,
int  value 
)

◆ setValueByRank()

void MatrixInt::setValueByRank ( int  rank,
int  value 
)

◆ setValues()

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

◆ setValuesOldStyle()

void MatrixInt::setValuesOldStyle ( const int *  values,
bool  byCol = true 
)

◆ size()

int MatrixInt::size ( ) const
inline

◆ toString()

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

ICloneable interface.

AStringable Interface

Reimplemented from AStringable.

◆ transposeInPlace()

void MatrixInt::transposeInPlace ( )

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