Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Add(Value: TCplx): TMtxVec; | Adds complex Value to all calling object complex elements. |
| └ indexed: function Add(Value: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 2 | function Add(const Vec: TMtxVec): TMtxVec; | Array addition. |
| └ indexed: function Add(const Vec: TMtxVec; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 3 | function Add(const Vec: TMtxVec; Value: TCplx): TMtxVec; | Adds complex Value to each element of the Vec object and store the result to the calling object. |
| └ indexed: function Add(const Vec: TMtxVec; Value: TCplx; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 4 | function Add(const Vec1: TMtxVec; const Vec2: TMtxVec): TMtxVec; | Add each of Vec2 elements to corresponding elements in Vec1. The results are stored in the calling object. |
| └ indexed: function Add(const Vec1: TMtxVec; const Vec2: TMtxVec; Vec1Index: Integer; Vec2Index: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 5 | function Add(const X: TMtxVec; const Y: TMtxVec; const Z: TCplx): TMtxVec; | self = X + Y + zScalar |
| └ indexed: function Add(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 6 | function Add(const X: TMtxVec; const Y: TMtxVec; const Z: TMtxVec): TMtxVec; | self = X + Y + Z |
| └ indexed: function Add(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TMtxVec; zIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 7 | function Add(const X: TMtxVec; const Y: TMtxVec; const Z: Double): TMtxVec; | self = X + Y + zScalar |
| └ indexed: function Add(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: Double; Index: Integer; Len: Integer): TMtxVec; | ||
| 8 | function Add(const Vec: TMtxVec; Value: Double): TMtxVec; | Adds Value to the each element of the Vec object and stores the result in the calling object. |
| └ indexed: function Add(const Vec: TMtxVec; Value: Double; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 9 | function Add(Value: Double): TMtxVec; | Adds Value to object elements. |
| └ indexed: function Add(Value: Double; Index: Integer; Len: Integer): TMtxVec; |
Overload 1: function Add(Value: TCplx): TMtxVec;
Adds complex Value to all calling object complex elements.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Value | TCplx | scalar |
Result: stored in self (calling object), returns self for chaining
Indexed: function Add(Value: TCplx; Index: Integer; Len: Integer): TMtxVec;
Adds complex Value to calling object complex elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Value | TCplx | scalar |
| 2 | Index | Integer | start index |
| 3 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
An exception is raised if array borders are overrun.
Overload 2: function Add(const Vec: TMtxVec): TMtxVec;
Array addition.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec |
Result: stored in self (calling object), returns self for chaining
Add each of Vec elements to corresponding elements in the calling object.
var
a, b, expected: Matrix;
begin
a := [[1.0, 2.0], [3.0, 4.0]];
b := [[5.0, 6.0], [7.0, 8.0]];
a.Add(b);
expected := [[6.0, 8.0], [10.0, 12.0]];
if not a.IsEqual(expected, 1e-10, TCompare.cmpAbsolute) then
raise Exception.Create('Matrix.Add: mismatch');
end;
Indexed: function Add(const Vec: TMtxVec; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
Add Vec elements [VecIndex]..[VecIndex+Len-1] to calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec | |
| 2 | VecIndex | Integer | |
| 3 | Index | Integer | start index |
| 4 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
An exception is raised if Matrix.ConditionCheck is true and array borders are overrun.
Overload 3: function Add(const Vec: TMtxVec; Value: TCplx): TMtxVec;
Adds complex Value to each element of the Vec object and store the result to the calling object.
Result: stored in self (calling object), returns self for chaining
Size property of the calling object is set automatically. Matrix.Complex property of the calling object is set to True.
Indexed: function Add(const Vec: TMtxVec; Value: TCplx; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
Adds complex Value to each elements of the Vec object in range [VecIndex]..[VecIndex+Len-1] and stores the result to elements [Index]..[Index+Len-1] of the calling object.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec | |
| 2 | Value | TCplx | scalar |
| 3 | VecIndex | Integer | |
| 4 | Index | Integer | start index |
| 5 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Size of the calling object is not changed. An exception is raised if array borders are overrun. Matrix.Complex property of the calling object is set to True.
Overload 4: function Add(const Vec1: TMtxVec; const Vec2: TMtxVec): TMtxVec;
Add each of Vec2 elements to corresponding elements in Vec1. The results are stored in the calling object.
Result: stored in self (calling object), returns self for chaining
Size and Matrix.Complex properties of the calling object are set implicitly to match Vec1 and Vec2 matrices.
var
a, x, y, expected: Matrix;
begin
x := [[1.0, 2.0], [3.0, 4.0]];
y := [[5.0, 6.0], [7.0, 8.0]];
a.Add(x, y);
expected := [[6.0, 8.0], [10.0, 12.0]];
if not a.IsEqual(expected, 1e-10, TCompare.cmpAbsolute) then
raise Exception.Create('Matrix.Add: mismatch');
end;
Indexed: function Add(const Vec1: TMtxVec; const Vec2: TMtxVec; Vec1Index: Integer; Vec2Index: Integer; Index: Integer; Len: Integer): TMtxVec;
Add Vec1 elements [Vec1Index]..[Vec1Index+Len-1] to Vec2 elements [Vec2Index]..[Vec2Index+Len-1] and store the results in calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec1 | TMtxVec | |
| 2 | Vec2 | TMtxVec | |
| 3 | Vec1Index | Integer | |
| 4 | Vec2Index | Integer | |
| 5 | Index | Integer | start index |
| 6 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
An exception is raised if Matrix.ConditionCheck is true and array borders are overrun.
Overload 5: function Add(const X: TMtxVec; const Y: TMtxVec; const Z: TCplx): TMtxVec;
Compute X + Y + zScalar
Result: stored in self (calling object), returns self for chaining
Indexed: function Add(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TCplx; Index: Integer; Len: Integer): TMtxVec;
Compute X + Y + zScalar on sub arrays
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | Y | TMtxVec | |
| 4 | YIndex | Integer | Y start index |
| 5 | Z | TCplx | |
| 6 | Index | Integer | start index |
| 7 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 6: function Add(const X: TMtxVec; const Y: TMtxVec; const Z: TMtxVec): TMtxVec;
Compute X + Y + Z
Result: stored in self (calling object), returns self for chaining
Indexed: function Add(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TMtxVec; zIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
Compute X + Y + Z on sub arrays
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | Y | TMtxVec | |
| 4 | YIndex | Integer | Y start index |
| 5 | Z | TMtxVec | |
| 6 | zIndex | Integer | |
| 7 | Index | Integer | start index |
| 8 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 7: function Add(const X: TMtxVec; const Y: TMtxVec; const Z: Double): TMtxVec;
Compute X + Y + zScalar
Result: stored in self (calling object), returns self for chaining
Indexed: function Add(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: Double; Index: Integer; Len: Integer): TMtxVec;
Compute X + Y + zScalar on sub arrays
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | Y | TMtxVec | |
| 4 | YIndex | Integer | Y start index |
| 5 | Z | Double | |
| 6 | Index | Integer | start index |
| 7 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 8: function Add(const Vec: TMtxVec; Value: Double): TMtxVec;
Adds Value to the each element of the Vec object and stores the result in the calling object.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec | |
| 2 | Value | Double | scalar |
Result: stored in self (calling object), returns self for chaining
Size and Matrix.Complex properties of the calling object are set automatically.
Indexed: function Add(const Vec: TMtxVec; Value: Double; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
Adds Value to each element of Vec object in range [VecIndex]..[VecIndex+Len-1] and stores result to elements [Index]..[Index+Len-1] of the calling object.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec | |
| 2 | Value | Double | scalar |
| 3 | VecIndex | Integer | |
| 4 | Index | Integer | start index |
| 5 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Size of the calling object is not changed. An exception is raised if array borders are overrun. Matrix.Complex property of the calling object is set implicitly.
Overload 9: function Add(Value: Double): TMtxVec;
Adds Value to object elements.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Value | Double | scalar |
Result: stored in self (calling object), returns self for chaining
Adds Value to all calling object elements.
Indexed: function Add(Value: Double; Index: Integer; Len: Integer): TMtxVec;
Adds Value to calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Value | Double | scalar |
| 2 | Index | Integer | start index |
| 3 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
An exception is raised if array borders are overrun.