DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


LoadFromStream

Declaration: TMatrix.LoadFromStream (InStream: TMemoryStream; 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.