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

Adopts aArray memory.

Pascal
procedure Adopt(AArray: PAPointer; ALength: integer; aFloatPrecision: TMtxFloatPrecision); overload;

Addopts a pointer to AArray array. The method sets the calling vector FloatPrecision 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 vector
  • Do not call routines relying on Lapack when cross-platform "Core edition" is used (not linking dlls), because Lapack will assume that adopted memory is a dynamic array and will modify array Index -2.
  • TVec.Values 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!