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



SaveToStream


Unit:SDL_matrix
Class: TMatrix, TIntMatrix
Declaration: [1] procedure SaveToStream (var OutStream: TMemoryStream; LoC,LoR,HiC,HiR: integer);
[2] procedure SaveToStream (var OutStream: TFileStream; LoC,LoR,HiC,HiR: integer);

The procedure SaveToStream appends the values of the matrix elements to the stream OutStream. Version [1] works with memory streams, version [2] with file streams. In version [1] OutStream may be set to nil in which case a new memory stream is created, in version [2] the file stream has to exist before calling SaveToStream. The parameters LoR HiR LoC, and HiC define the area of the matrix to be be stored on the file.

Example: The statement Mat.SaveToStream (MyStream, 2,1,5,10 ); creates the stream MyStream (if MyStream is nil) and stores all elements between columns two to five and rows one to ten in the stream.

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: Setting both the low and high parameter of a dimension (i.e. LoC and HiC) to zero values forces the method to use all elements of that dimension.



Last Update: 2023-Feb-06