You are here: Symbol Reference > MtxExpr Namespace > Classes > Matrix Record > public > Adopt Method > Matrix.Adopt Method (PAPointer, integer, integer, boolean, boolean)
MtxVec VCL
ContentsIndex
PreviousUpNext
Matrix.Adopt Method (PAPointer, integer, integer, boolean, boolean)

Adopts a pointer to one dimensional array.

Pascal
procedure Adopt(AArray: PAPointer; ARows: integer; ACols: integer; aIsComplex: boolean; aIsDouble: boolean); overload;

Addopts a pointer to AArray array. The method sets the calling matrix FlaotPrecision property to aFloatPrecision, Rows to ARows, Cols to ACols and Values1D and CValues1D to Pointer(AArray). 

Notes:

  • Required to call the Disown method, before freeing the object
  • Do not resize the matrix
  • Do not call routines relying on Lapack when cross-platform "Core edition" is used (not linking dlls), because pascal version of Lapack will assume that adopted memory is a dynamic array and will modify array Index -2.
  • TMtx.Values1D array assignment or passing array by var (internal to library) will cause memory corruption in this case.
  • To be used with great care only.
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!