Dew MtxVec NET
TMtx.Size Methods
Summary
Sets the size of matrix.

Class
TMtx

Declaration
Function Size(ARows, ACols: integer): TMtx;

Description
Specifies size of a real matrix storing non-integer values.
Declaration
Function Size(ARows, ACols: integer; AComplex: boolean; AIsInteger: boolean = false): TMtx;

Description
Set the calling matrix properties: Rows = ARows,
Cols = ACols
and Complex = AComplex.

If the AComplex parameter is omitted, the default value (matrix is not complex) is used. Calling the Size method does not preserve the contents of the matrix. Use the Resize method, if you want to preserve existing values. NOTE: The Size method performs an out-of-memory safe resize, if the matrix already has memory allocated. This prevents out of memory message for example when redefining the size of the matrix from single column to single row:

A.Rows := 10000; // matrix size = 0 A.Cols := 1; // matrix size = 10000 // ... A.Cols := 10000; // matrix size = 100 000 000 (problems here) A.Rows := 1; // matrix size = 10 000

 See Also 
Rows 
Cols 
Complex 

Example 1

var A: TMtx; begin CreateIt(A); try A.Size(2,1,True); // 2x1 complex matrix A.SetZero; // A becomes: // [0,0] // [0,0] finally FreeIt(A); end; end;

Copyright 2008 Dew Research
http://www.dewresearch.com