Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function CopyVec(const Vec: TVec; NrRows: Integer): TMtx; | Copies values from vector to a matrix. |
| 2 | function CopyVec(const Vec: TVec; VecIndex: Integer; Len: Integer; Row: Integer; Col: Integer): TMtx; | Copy Vec elements [VecIndex]..[VecIndex+Len-1] to the calling matrix elements starting with [Row,Col]. |
Overload 1: function CopyVec(const Vec: TVec; NrRows: Integer): TMtx;
Copies values from vector to a matrix.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TVec | |
| 2 | NrRows | Integer |
Result: stored in self (calling object), returns self for chaining
Remarks:
Copy all Vec elements to the calling matrix. Set the calling matrix Matrix.Rows property to NrRows. Set the calling matrix Matrix.Cols property to Vec.Length div NrRow (Length = Rows*Cols). The calling matrix Matrix.Complex property is adjusted automatically. An exception is raised if Vec.Length mod NrRows <> 0.
Examples
var A: Matrix;
v: Vector;
begin
v.SetIt(true,[1, 0, 2, -1, 5, 1.2]) ;
A.CopyVec(v);
end;
See Also: Matrix.Copy
Overload 2: function CopyVec(const Vec: TVec; VecIndex: Integer; Len: Integer; Row: Integer; Col: Integer): TMtx;
Copy Vec elements [VecIndex]..[VecIndex+Len-1] to the calling matrix elements starting with [Row,Col].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TVec | |
| 2 | VecIndex | Integer | |
| 3 | Len | Integer | element count |
| 4 | Row | Integer | |
| 5 | Col | Integer |
Result: stored in self (calling object), returns self for chaining
Remarks:
An exception is raised if Matrix.ConditionCheck is true and bounds are overrun or if Matrix.Complex properties of the calling matrix and Vec do not match.