Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Mul(Value: TCplx): TMtxVec; | Multiply all calling object elements with complex Value in-place. |
| └ indexed: function Mul(Value: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 2 | function Mul(const Vec: TMtxVec): TMtxVec; | Vector multiplication. |
| └ indexed: function Mul(const Vec: TMtxVec; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 3 | function Mul(const Vec: TMtxVec; Value: TCplx): TMtxVec; | Multiply each element of Vec with complex Value. |
| └ indexed: function Mul(const Vec: TMtxVec; Value: TCplx; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 4 | function Mul(const Vec1: TMtxVec; const Vec2: TMtxVec): TMtxVec; | Multiply all Vec1 elements with corresponding Vec2 elements. |
| └ indexed: function Mul(const Vec1: TMtxVec; const Vec2: TMtxVec; Vec1Index: Integer; Vec2Index: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 5 | function Mul(const X: TMtxVec; const Y: TMtxVec; const Z: TCplx): TMtxVec; | self = X*Y*zScalar |
| └ indexed: function Mul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 6 | function Mul(const X: TMtxVec; const Y: TMtxVec; const Z: TMtxVec): TMtxVec; | self = X*Y*Z |
| └ indexed: function Mul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TMtxVec; zIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 7 | function Mul(const X: TMtxVec; const Y: TMtxVec; const Z: Double): TMtxVec; | self = X*Y*zScalar |
| └ indexed: function Mul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: Double; Index: Integer; Len: Integer): TMtxVec; | ||
| 8 | function Mul(const Vec: TMtxVec; Value: Double): TMtxVec; | Multiply each element of Vec with Value. |
| └ indexed: function Mul(const Vec: TMtxVec; Value: Double; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 9 | function Mul(Value: Double): TMtxVec; | Multiply object elements with Value. |
| └ indexed: function Mul(Value: Double; Index: Integer; Len: Integer): TMtxVec; |
Overload 1: function Mul(Value: TCplx): TMtxVec;
Multiply all calling object elements with complex Value in-place.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Value | TCplx | scalar |
Result: stored in self (calling object), returns self for chaining
Indexed: function Mul(Value: TCplx; Index: Integer; Len: Integer): TMtxVec;
Multipy calling object elements [Index]..[Index+Len-1] with complex Value in-place.
| # | 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 or underrun.
Overload 2: function Mul(const Vec: TMtxVec): TMtxVec;
Vector multiplication.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec |
Result: stored in self (calling object), returns self for chaining
Multiply each of Vec elements with corresponding elements in the calling object. Size and Vector.Complex property of the calling object are set automatically. The result is stored in the calling object.
var
a, b, expected: Vector;
begin
a := [1.0, 2.0, 3.0, 4.0];
b := [5.0, 6.0, 7.0, 8.0];
a.Mul(b);
expected := [5.0, 12.0, 21.0, 32.0];
if not a.IsEqual(expected, 1e-10, TCompare.cmpAbsolute) then
raise Exception.Create('Vector.Mul: mismatch');
end;
Indexed: function Mul(const Vec: TMtxVec; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
Multiply Vec elements [VecIndex]..[VecIndex+Len-1] with calling object elements [Index]..[Index+Len-1] in-place.
| # | 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 Vec and calling object Vector.Complex property do not match or if array borders are overrun/underrun.
Overload 3: function Mul(const Vec: TMtxVec; Value: TCplx): TMtxVec;
Multiply each element of Vec with complex Value.
Result: stored in self (calling object), returns self for chaining
Store the result in the calling object. Size of the calling object is set automatically. Vector.Complex property of the calling object is set to True.
Indexed: function Mul(const Vec: TMtxVec; Value: TCplx; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
Multiply Vec elements [VecIndex]..[VecIndex+Len-1] with complex Value.
| # | 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
Store the result in calling object elements [Index]..[Index+Len-1]. Size of the calling object is not changed. An exception is raised if array borders are overrun or underrun. Vector.Complex propertiy of the calling object is set to True.
Overload 4: function Mul(const Vec1: TMtxVec; const Vec2: TMtxVec): TMtxVec;
Multiply all Vec1 elements with corresponding Vec2 elements.
Result: stored in self (calling object), returns self for chaining
Store the results in calling object. Size and Vector.Complex property of calling object are adjusted automatically to match those of Vec1 and Vec2. An exception is raised if Vec1 and Vec2 size and Vector.Complex property do not match.
var
a, x, y, expected: Vector;
begin
x := [1.0, 2.0, 3.0, 4.0];
y := [5.0, 6.0, 7.0, 8.0];
a.Mul(x, y);
expected := [5.0, 12.0, 21.0, 32.0];
if not a.IsEqual(expected, 1e-10, TCompare.cmpAbsolute) then
raise Exception.Create('Vector.Mul: mismatch');
end;
Indexed: function Mul(const Vec1: TMtxVec; const Vec2: TMtxVec; Vec1Index: Integer; Vec2Index: Integer; Index: Integer; Len: Integer): TMtxVec;
Multiply Vec1 elements [Vec1Index]..[Vec1Index+Len-1] with Vec2 object 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
Size and Vector.Complex properties of the calling object must be set explicitly. An exception is raised if Vector.ConditionCheck is True and array borders are overrun or underrun.
Overload 5: function Mul(const X: TMtxVec; const Y: TMtxVec; const Z: TCplx): TMtxVec;
Compute X*Y*zScalar
Result: stored in self (calling object), returns self for chaining
The following expression would also run at the same or higher speed, when passing X also for the Z parameter:
X^2*zScalar
Indexed: function Mul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TCplx; Index: Integer; Len: Integer): TMtxVec;
Compute X*Y*zScalar on sub array
| # | 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 Mul(const X: TMtxVec; const Y: TMtxVec; const Z: TMtxVec): TMtxVec;
Compute X*Y*Z
Result: stored in self (calling object), returns self for chaining
The following expression would also run at the same or higher speed, when passing X also for the Z parameter:
X^2*Y
Indexed: function Mul(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 array
| # | 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 Mul(const X: TMtxVec; const Y: TMtxVec; const Z: Double): TMtxVec;
Compute X*Y*zScalar
Result: stored in self (calling object), returns self for chaining
The following expression would also run at the same or higher speed, when passing X also for the Z parameter:
X^2*zScalar
Indexed: function Mul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: Double; Index: Integer; Len: Integer): TMtxVec;
Compute X*Y*zScalar on sub array
| # | 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 Mul(const Vec: TMtxVec; Value: Double): TMtxVec;
Multiply each element of Vec with Value.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec | |
| 2 | Value | Double | scalar |
Result: stored in self (calling object), returns self for chaining
Store the result in the calling object. Size and Vector.Complex properties of the calling object are adjusted automatically.
Indexed: function Mul(const Vec: TMtxVec; Value: Double; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
Multiply Vec elements [VecIndex]..[VecIndex+Len-1] with Value.
| # | 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
Store the result in calling object elements [Index]..[Index+Len-1]. Size of the calling object is not changed. An exception is raised if array borders are overrun or underrun. Vector.Complex propertiy of the calling object is set implicitly.
Overload 9: function Mul(Value: Double): TMtxVec;
Multiply object elements with Value.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Value | Double | scalar |
Result: stored in self (calling object), returns self for chaining
Multiply all calling object elements with Value in-place.
var v: TVec;
begin
v:= TVec.Create;
try
v.SetIt(false,[2,3,5]); // v = [2,3,5]
v.Mul(3); // v = [6,9,15]
finally
v.Free;
end;
end;
Indexed: function Mul(Value: Double; Index: Integer; Len: Integer): TMtxVec;
Multipy calling object elements [Index]..[Index+Len-1] with Value in-place.
| # | 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 or underrun.