TVecByte.Abs Method

Overload List

#SignatureDescription
1TMtxVecInt AbsAbsolute values.
└ indexed: TMtxVecInt Abs(Int32 Index, Int32 Len)
2TMtxVecInt 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

Remarks:

Calculate the absolute value of all calling object elements in-place.

Examples
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].

#NameTypeDescription
1IndexInt32start index
2LenInt32element count

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

Returns: calling vector elements [Index]..[Index+Len-1] ansolute vslues.

Remarks:

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.

#NameTypeDescription
1SrcTMtxVecIntsource 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].

#NameTypeDescription
1SrcTMtxVecIntsource TVecInt or TMtxInt
2SrcIndexInt32source start index
3IndexInt32start index
4LenInt32element 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].

Remarks:

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.