You are here: Symbol Reference > MtxExprInt Namespace > Classes > MatrixInt Record > public > CopyVec Method > MatrixInt.CopyVec Method (TVecInt, Integer)
MtxVec VCL
ContentsIndex
PreviousUpNext
MatrixInt.CopyVec Method (TVecInt, Integer)

Copies values from vector to a matrix.

Pascal
function CopyVec(const Vec: TVecInt; NrRows: Integer): TMtxInt; overload;

Copy all Vec elements to the calling matrix. Set the calling matrix Rows property to NrRows. Set the calling matrix Cols property to Vec.Length div NrRow (Length = Rows*Cols). The calling matrix IntPrecision property is adjusted automatically. An exception is raised if Vec.Length mod NrRows <> 0.

var A: TMtxInt; v: TVecInt; begin CreateIt(A); Create(v); try v.SetIt([1, 0, 2, -1, 5, 1.2]) ; A.CopyVec(v); finally FreeIt(A); FreeIt(v); end; end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!