OEMatrix

class OEMatrix

OEMatrix class represents a Matrix.

The OEMatrix class defines the following public methods:

Constructors

OEMatrix()
OEMatrix(const unsigned numRow, const unsigned numCol)
OEMatrix(const unsigned numRow, const unsigned numCol, const double initialValue)
OEMatrix(const OEMatrix&)

Default and copy constructors.

The default constructor creates an empty matrix. The second overload creates a matrix with numRows rows and numCols columns, with all the values set to zero. The third overload creates a matrix with numRows rows and numCols columns, with all the values set to initialValue.

operator=

OEMatrix& operator=(const OEMatrix& rhs)

Assignment operator for OEMatrix.

AddRow

void AddRow();
void AddRow(const double initialValue);

Add a new row to the matrix. The new row is initialized with zero, unless initialValue is provided.

Clear

void Clear();

Clear the matrix.

GetData

const std::vector<double>& GetData() const;

Get the contents of the matrix. The data is organized sequentially from the first row to the last.

GetNumColumns

unsigned GetNumColumns() const;

Returns the number of columns in the matrix.

GetNumRows

unsigned GetNumRows() const;

Returns the number of rows in the matrix.

Resize

void Resize(const unsigned numRow, const unsigned numCol);
void Resize(const unsigned numRow, const unsigned numCol, const double initialValue);

Resize the matrix to numRows rows and numCols columns. The matrix is initialized with zero, unless initialValue is provided.

SetRowData

void SetRowData(const unsigned iRow, const std::vector<double>& vecValues);

Set vecValues as content of the iRow-th row.

Transpose

OEMatrix Transpose() const;

Returns the transpose of the matrix.