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....



LoadFromStream


Unit:SDL_matrix
Class: TMatrix, TIntMatrix
Declaration: [1] function LoadFromStream (InStream: TMemoryStream; AdjustMatrixSize: boolean): boolean;
[2] function LoadFromStream (InStream: TFileStream; AdjustMatrixSize: boolean): boolean;

The function LoadFromStream loads the matrix elements which have been stored previously by the method SaveToStream. The parameter InStream specifies the stream to be read from, which may be either a memory stream (version [1]) or a file stream (version [2]). LoadFromStream returns a TRUE value, if the data have been successfully read. If the parameter AdjustMatrixSize is set to TRUE, the matrix size is adjusted before the data are read in order to be able to hold the entire data. If AdjustMatrixSize is FALSE the data will be only read if it fits into the existing matrix.

Hint 1: The internal formats of the streams created by TMatrix and TIntMatrix are different. Thus a TIntMatrix cannot load a matrix stored my TMatrix and vice versa.

Hint 2: Reading matrix data from a stream always starts at the current stream position. This allows to read several matrices from a single stream.


Last Update: 2012-Okt-20