CMatrix::SetSize

void SetSize( int nRow=1, int nCol=1, double nValue=0 );
Parameters

nRow

The new row size (number of rows). Must be greater than or equal to 0.

nCol

The new column size (number of columns). Must be greater than or equal to 0.

nValue

The default value for the extended elements if a size increase is necessary.

Remarks

Establishes the size of an empty or existing matrix; allocates memory if necessary.

If the new size is smaller than the old size, then the matrix is truncated and all unused memory is released.

Use this function to set the size of your matrix before you begin using the matrix. If you do not use SetSize, adding elements to your array causes it to be frequently reallocated and copied. Frequent reallocation and copying are inefficient and can fragment memory.

CMatrix OverviewClass Members

See Also   CMatrix::GetRowSize; CMatrix::GetColumnSize