Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Sum: Double; | Sums vector values. |
| └ indexed: function Sum(Index: Integer; Len: Integer): Double; | ||
| 2 | procedure Sum(out ASum: TCplx); | Calculates the sum of all calling object complex elements. |
| └ indexed: procedure Sum(out ASum: TCplx; Index: Integer; Len: Integer); | ||
| 3 | procedure Sum(out ASum: Double; Index: Integer; Len: Integer); | Calculates the sum of calling object elements [Index]..[Index+Len-1]. |
Overload 1: function Sum: Double;
Sums vector values.
Returns: Double - the sum of all calling object elements. An exception is raised if calling object clMatrix.Complex property is true.
var a: clMatrix;
b: double;
begin
a.Size(2,2, clFloat, false);
a.CopyFromArray(TDoubleArray.Create(1,2,3,4));
b := a.Sum; // b = 10
end;
Indexed: function Sum(Index: Integer; Len: Integer): Double;
Returns the sum of calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | Integer | start index |
| 2 | Len | Integer | element count |
Returns: Double
An exception is raised if calling object clMatrix.Complex property is True or array borders are overrun/underrun.
Overload 2: procedure Sum(out ASum: TCplx);
Calculates the sum of all calling object complex elements.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | ASum | TCplx | output sum |
Result: stored in self (calling object)
Stores the result in complex ASum variable. An exception is raised if calling object clMatrix.Complex property is False.
Indexed: procedure Sum(out ASum: TCplx; Index: Integer; Len: Integer);
Calculates the sum of calling object complex elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | ASum | TCplx | output sum |
| 2 | Index | Integer | start index |
| 3 | Len | Integer | element count |
Result: stored in self (calling object)
Stores the result in complex ASum variable. An exception is raised if calling object clMatrix.Complex property is False or array borders are overrun/underrun.
Overload 3: procedure Sum(out ASum: Double; Index: Integer; Len: Integer);
Calculates the sum of calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | ASum | Double | output sum |
| 2 | Index | Integer | start index |
| 3 | Len | Integer | element count |
Result: stored in self (calling object)
Stores the result in real ASum variable. An exception is raised if calling object clMatrix.Complex property is True or array borders are overrun/underrun.