TMtxSmallInt.CopyVec Method

Overload List

#SignatureDescription
1TMtxInt CopyVec(TVecInt Vec, Int32 NrRows)Copies values from vector to a matrix.
2TMtxInt CopyVec(TVecInt Vec, Int32 VecIndex, Int32 Len, Int32 Row, Int32 Col)Copy Vec elements [VecIndex]..[VecIndex+Len-1] to the calling matrix elements starting with [Row,Col].

Overload 1: TMtxInt CopyVec(TVecInt Vec, Int32 NrRows)

Copies values from vector to a matrix.

#NameTypeDescription
1VecTVecIntsource TVecInt
2NrRowsInt32

Result: stored in self (calling object), returns self for chaining

Remarks:

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

Examples
TMtxInt A;
TVecInt v;
MtxVec.CreateIt(out A);
Create(v);
try
    {
        v.SetIt(new double[] {1, 0, 2, -1, 5, 1.2}) ;
        A.CopyVec(v);
    }
finally
    {
        MtxVec.FreeIt(ref A);
        MtxVec.FreeIt(ref v);
    }

Overload 2: TMtxInt CopyVec(TVecInt Vec, Int32 VecIndex, Int32 Len, Int32 Row, Int32 Col)

Copy Vec elements [VecIndex]..[VecIndex+Len-1] to the calling matrix elements starting with [Row,Col].

#NameTypeDescription
1VecTVecIntsource TVecInt
2VecIndexInt32
3LenInt32element count
4RowInt32
5ColInt32

Result: stored in self (calling object), returns self for chaining

Remarks:

An exception is raised if Dew.Math.TMtxVecBase.ConditionCheck is true and bounds are overrun or if Dew.Math.TMtxVecInt.IntPrecision properties of the calling matrix and Vec do not match.