Overload List
| # | Signature | Description |
|---|---|---|
| 1 | TMtxVecInt Abs | Absolute values. |
| └ indexed: TMtxVecInt Abs(Int32 Index, Int32 Len) | ||
| 2 | TMtxVecInt Abs(TMtxVecInt Src) | Absolute values of all Src vector elements. |
| └ indexed: TMtxVecInt Abs(TMtxVecInt Src, Int32 SrcIndex, Int32 Index, Int32 Len) |
Overload 1: TMtxVecInt Abs
Absolute values.
Result: stored in self (calling object), returns self for chaining
Calculate the absolute value of all calling object elements in-place.
Matrix a = new Matrix();
a.SetIt(2, 2, false, new double[] { -3.0, -1.0, 1.0, 2.0 });
a.Abs();
Matrix expected = new Matrix();
expected.SetIt(2, 2, false, new double[] { 3.0, 1.0, 1.0, 2.0 });
if (!a.IsEqual(expected, 1e-10, TCompare.cmpAbsolute))
throw new Exception("Matrix.Abs: mismatch");
Matrix a;
Matrix b;
a.SetIt(1,2,true,new double[] {1,-2,3,4});
a.Abs;
a = Math.Abs(a); //same as a.Abs
b.Math.Abs(a); //same as b = Math.Abs(a);
b = Math.Abs(a);
Indexed: TMtxVecInt Abs(Int32 Index, Int32 Len)
Absolute values of calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | Int32 | start index |
| 2 | Len | Int32 | element count |
Result: stored in self (calling object), returns self for chaining
Returns: calling vector elements [Index]..[Index+Len-1] ansolute vslues.
An exception is raised if array borders are overrun/underrun.
Note
Please note the calling vector elements [Index]..[Index+Len-1] are overwritten with result of routine call.
Overload 2: TMtxVecInt Abs(TMtxVecInt Src)
Absolute values of all Src vector elements.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TMtxVecInt | source TVecInt or TMtxInt |
Result: stored in self (calling object), returns self for chaining
Returns: Src vector elements ansolute vslues.
Indexed: TMtxVecInt Abs(TMtxVecInt Src, Int32 SrcIndex, Int32 Index, Int32 Len)
Absolute values of Src vector elements [VecIndex]..[VecIndex+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TMtxVecInt | source TVecInt or TMtxInt |
| 2 | SrcIndex | Int32 | source start index |
| 3 | Index | Int32 | start index |
| 4 | Len | Int32 | element count |
Result: stored in self (calling object), returns self for chaining
Returns: Src vector elements [VecIndex]..[VecIndex+Len-1] absolute values in calling vector elements [Index]..[Index+Len-1].
An exception is raised if array borders are overrun/underrun.
Note
Please note the calling vector elements [Index]..[Index+Len-1] are overwritten with result of routine call.