TVec.Max Method

Overload List

#SignatureDescription
1Double MaxMaximum value.
└ indexed: Double Max(Int32 Index, Int32 Len)
2void Max(ref Double AMax, ref Int32 aIndex)Calculate the maximum value of all calling object elements.
└ indexed: void Max(ref Double AMax, ref Int32 aIndex, Int32 Index, Int32 Len)
3Int32 Max(ref TCplx AMax, Int32 Index, Int32 Len)Same as Dew.Math.TDenseMtxVec.Maxc method.
4void Max(ref Double AMax, Int32 Index, Int32 Len)Calculate the maximum value from calling object elements [Index]..[Index+Len-1].

Overload 1: Double Max

Maximum value.

Returns: Double - the maximum value of all calling object elements. The result is a real value.

Remarks:

An exception is raised is calling object Dew.Math.TMtxVec.Complex is true.

Examples
Vector a = new Vector();
a.SetIt(new double[] { 1.0, 2.0, 3.0, 4.0 });
double result = a.Max();
if (Math.Abs(result - 4.0) > 1e-10)
    throw new Exception("Vector.Max: expected 4.0, got " + result);
Vector a;
double b;
a.SetIt(false,new double[] {1,2,3,4});
b = a.Max; // b = 4

Indexed: Double Max(Int32 Index, Int32 Len)

Returns the maximum value from calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1IndexInt32start index
2LenInt32element count

Returns: Double

Remarks:

The result is a real value. An exception is raised if calling object Dew.Math.TMtxVec.Complex property is true or array borders are overrun.

Overload 2: void Max(ref Double AMax, ref Int32 aIndex)

Calculate the maximum value of all calling object elements.

#NameTypeDescription
1AMaxDouble (ref)output
2aIndexInt32 (ref)output

Result: stored in self (calling object)

Remarks:

The AMax parameter returns the maximum value. The aIndex parameter returns the index of maximum value. An exception is raised if calling object Dew.Math.TMtxVec.Complex property is true.

Indexed: void Max(ref Double AMax, ref Int32 aIndex, Int32 Index, Int32 Len)

Calculate the maximum value of calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1AMaxDouble (ref)output
2aIndexInt32 (ref)output
3IndexInt32start index
4LenInt32element count

Result: stored in self (calling object)

Remarks:

The AMax parameter returns the maximum value. The aIndex parameter returns the index of maximum value. An exception is raised if calling object Dew.Math.TMtxVec.Complex property is true or array borders are overrud/underrun.

Overload 3: Int32 Max(ref TCplx AMax, Int32 Index, Int32 Len)

Same as Dew.Math.TDenseMtxVec.Maxc method.

#NameTypeDescription
1AMaxTCplx (ref)output
2IndexInt32start index
3LenInt32element count

Returns: Int32

Overload 4: void Max(ref Double AMax, Int32 Index, Int32 Len)

Calculate the maximum value from calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1AMaxDouble (ref)output
2IndexInt32start index
3LenInt32element count

Result: stored in self (calling object)

Remarks:

The result AMean is a real value. An exception is raised if calling object Dew.Math.TMtxVec.Complex property is true or array borders are overrun.