Overload List
| # | Signature | Description |
|---|---|---|
| 1 | TVec Resize(TMtxVec Src, Int32 Len, Boolean ZeroIt) | Resizes vector size while preserving values. |
| 2 | TMtxVec Resize(Int32 Len, Boolean ZeroIt) | Resizes calling vector Dew.Math.Vector.Length to Len. |
Overload 1: TVec Resize(TMtxVec Src, Int32 Len, Boolean ZeroIt)
Resizes vector size while preserving values.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TMtxVec | source TVec or TMtx |
| 2 | Len | Int32 | element count |
| 3 | ZeroIt | Boolean |
Result: stored in self (calling object), returns self for chaining
Remarks:
Resizes calling vector Dew.Math.Vector.Length to Len and fills it with Src vector first Len values. If Src length is less than Len and ZeroIt parameter is true, the remaining calling vector values are set to zero.
Examples
Vector a;
Vector b;
a.SetIt(false,new double[] {1,2,3});
b.SetIt(false,new double[] {9});
b.Resize(a,7,true); // b=(9,1,2,3,4,0,0,0)
Overload 2: TMtxVec Resize(Int32 Len, Boolean ZeroIt)
Resizes calling vector Dew.Math.Vector.Length to Len.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Len | Int32 | element count |
| 2 | ZeroIt | Boolean |
Result: stored in self (calling object), returns self for chaining
Remarks:
If Dew.Math.Vector.Length is less than Len and ZeroIt parameter is true, the remaining calling vector values are set to zero.
Examples
Vector a;
a.SetIt(false,new double[] {1,2,3});
a.Resize(7,true); // a= new double[] {1,2,3,0,0,0,0}