Overload List
| # | Signature | Description |
|---|---|---|
| 1 | TVecInt Resize(TVecInt Src, Int32 Len, Boolean ZeroIt) | Resizes vector size while preserving values. |
| 2 | TVecInt Resize(Int32 Len, Boolean ZeroIt) | Resizes calling vector Length to Len. |
Overload 1: TVecInt Resize(TVecInt Src, Int32 Len, Boolean ZeroIt)
Resizes vector size while preserving values.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVecInt | source TVecInt |
| 2 | Len | Int32 | element count |
| 3 | ZeroIt | Boolean |
Result: stored in self (calling object), returns self for chaining
Remarks:
Resizes calling vector Dew.Math.TMtxVecBase.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
TVecInt a;
TVecInt b;
MtxVec.CreateIt(out a, out b);
try
{
a.SetIt(new double[] {1,2,3});
b.SetIt(new double[] {9});
b.Resize(a,7,true); // b=(9,1,2,3,4,0,0,0)
}
finally
{
MtxVec.FreeIt(ref a, ref b);
}
Overload 2: TVecInt Resize(Int32 Len, Boolean ZeroIt)
Resizes calling 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.VectorInt.Length is less than Len and ZeroIt parameter is true, the remaining calling vector values are set to zero.
Examples
TVecInt a;
MtxVec.CreateIt(out a);
try
{
a.SetIt(new double[] {1,2,3});
a.Resize(7,true); // a= new double[] {1,2,3,0,0,0,0}
}
finally
{
MtxVec.FreeIt(ref a);
}