Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Sum: double; overload; | Sums vector values. |
| └ indexed: function Sum(Index,Len: integer): double; overload; | ||
| 2 | procedure Sum(out ASum: TCplx); overload; | Calculates the sum of all calling object complex elements. |
| └ indexed: procedure Sum(out ASum: TCplx; Index, Len: integer); overload; | ||
| 3 | procedure Sum(out ASum: double; Index, Len: integer); overload; | Calculates the sum of calling object elements [Index]..[Index+Len-1]. |
Overload 1: function Sum: double; overload;
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,Len: integer): double; overload;
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); overload;
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, Len: integer); overload;
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, Len: integer); overload;
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.