clMatrix.Sum Method

Overload List

#SignatureDescription
1Double SumSums vector values.
└ indexed: Double Sum(Int32 Index, Int32 Len)
2void Sum(ref TCplx ASum)Calculates the sum of all calling object complex elements.
└ indexed: void Sum(ref TCplx ASum, Int32 Index, Int32 Len)
3void Sum(ref Double ASum, Int32 Index, Int32 Len)Calculates the sum of calling object elements [Index]..[Index+Len-1].

Overload 1: Double Sum

Sums vector values.

Returns: Double - the sum of all calling object elements. An exception is raised if calling object Dew.Math.clMatrix.Complex property is true.

Examples
clMatrix a;
double b;
a.Size(2,2, clFloat, false);
a.CopyFromArray(TDoubleArray.Create(1,2,3,4));
b = a.Sum; // b = 10
See Also: clMatrix.Sumc

Indexed: Double Sum(Int32 Index, Int32 Len)

Returns the sum of calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1IndexInt32start index
2LenInt32element count

Returns: Double

Remarks:

An exception is raised if calling object Dew.Math.clMatrix.Complex property is True or array borders are overrun/underrun.

Overload 2: void Sum(ref TCplx ASum)

Calculates the sum of all calling object complex elements.

#NameTypeDescription
1ASumTCplx (ref)output sum

Result: stored in self (calling object)

Remarks:

Stores the result in complex ASum variable. An exception is raised if calling object Dew.Math.clMatrix.Complex property is False.

Indexed: void Sum(ref TCplx ASum, Int32 Index, Int32 Len)

Calculates the sum of calling object complex elements [Index]..[Index+Len-1].

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

Result: stored in self (calling object)

Remarks:

Stores the result in complex ASum variable. An exception is raised if calling object Dew.Math.clMatrix.Complex property is False or array borders are overrun/underrun.

Overload 3: void Sum(ref Double ASum, Int32 Index, Int32 Len)

Calculates the sum of calling object elements [Index]..[Index+Len-1].

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

Result: stored in self (calling object)

Remarks:

Stores the result in real ASum variable. An exception is raised if calling object Dew.Math.clMatrix.Complex property is True or array borders are overrun/underrun.