The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Create


Unit:SDL_matrix
Class: TMatrix, TIntMatrix, TMat3D
Declaration: constructor Create (AOwner: TComponent);

The call to the constructor Create instantiates an object of the class TMatrix (or TIntMatrix, or TMat3D ) and allocates the necessary heap memory. If there is not enough memory space on the heap, an exception is generated ('not enough memory on heap').

Example: The following program fragment shows how to create and destroy a matrix dynamically. Note that the matrix is destroyed by the method Free (which is generally a better way for destroying an instant than using the destructor Destroy directly).
const
  MatCols = 40;             { size of the matrix }
  MatRows = 27;

var
  Mat1    : TMatrix;

begin
Mat1 := TMatrix.Create (nil);
Mat1.Resize (MatCols, MatRows);
    { here comes your code to
      process the matrix Mat1 }
Mat1.Free;
end;

Example: This method is used in the following example programs (see http://www.lohninger.com/examples.html for downloading the code): covar, findcent, invmat



Last Update: 2012-Oct-20