CDMatrixBasic

Class Description

The CDMatrixBasic class provides different basic matrix operations.

Constructors/Destructor

CDMatrixStat (void)

Default constructor. Creates an uninitialized matrix.

CDMatrixStat
    (int rows, int cols,
     double *storage = 0)

If storage is zero, create a dynamically sized double precision matrix with the number of rows and cols specified. If storage is not zero, use the memory it points to.

CDMatrixStat (const CDMatrixStat &mat)

Creates a matrix with the same properties and values as another matrix.
 
Argument Description
rows,cols number of rows and columns in matrix
storage pointer to previously allocated memory
mat reference to another matrix

~CDMatrixStat (void)
Destructor.
 

Top

Methods

Matrix Manipulation 

CDMatrixBasic::Diag

void Diag(const CDVectorBasic& vec);

This function transforms the matrix into a diagonal matrix, with the values of vec in the diagonal.
 
Argument Description
vec reference to vector holding the diagonal elements

Top


CDMatrixBasic::Col

void Col(int iC, CDVectorBasic& vCol)

Extract column iC.
 
Argument Description
iC index to column
vCol reference to vector holding the column

Top


CDMatrixBasic::Row

 void Row(int iR, CDVectorBasic& vRow);

Extract row iR.
 
Argument Description
iR index to row
vRow reference to vector holding the row

Top


CDMatrixBasic::SetCol

void Col(int iC, const CDVectorBasic& vCol)

Set column iC.
 
Argument Description
iC index to column
vCol reference to vector holding the column

Top


CDMatrixBasic::SetRow

 void SetRow(int iR, CDVectorBasic& vRow);

Set row iR.
 
Argument Description
iR index to row
vRow reference to vector holding the row

Top


CDMatrixBasic::SubOf

void SubOf(CVisDMatrix mat,int iStartRow,int iEndRow, int iStartCol, int iEndCol)
Returns the sub matrix indicated by the coordinates, start coordinat points included.
 
Argument Description
iStartRow, iEndRow, iStartCol, iEndCol start and end point for submatrix
mat reference to output matrix

Top

Math Functions 

CDMatrixBasic::ElementDivide

void ElementDivide(const CDMatrixBasic& matrix)

Divide each element in the matrix with the corresponding element of the input matrix.
 
Argument Description
matrix reference to the input matrix

Top


CDMatrixBasic::ElementMultiply

void ElementMultiply(const CDMatrixBasic& matrix)

Multiply each element in the matrix with the corresponding element of the input matrix.
 
Argument Description
matrix reference to the input matrix

Top


CDMatrixBasic::Sqr

void Sqr()

Square each element

Top


CDMatrixBasic::Sqrt

void Sqrt()

Take the square root of each element

Top


Miscellaneous 

CDMatrixStat::ToString

void ToString(CString& strOut)

This function returns a string representing the vector.
 
Argument Description
strOut reference to the string

Overloaded Operators 

CDMatrixStat::operator=

CDMatrixStat& operator= (double value)
Assigns value to all elements of this matrix.

CDMatrixStat& operator= (const CDMatrixStat& vec)
Copies the values of another matrix to the corresponding elements of this matrix.
 
Argument Description
value value to be assigned to this matrix's elements
vec reference to matrix with values to be copied


Copyright, 1999
Section for Image Analysis
Department of Mathematical Modelling
Technical University of Denmark
DK-2800 Lyngby

Authors: Rune Fisker & Henrik Aanæs

Last updated: 03-05-1999