Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function AddAndMul(const X: TMtxVec; const Y: TCplx; const Z: TCplx): TMtxVec; | self = (X + yScalar)*zScalar |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TCplx; const Z: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 2 | function AddAndMul(const X: TMtxVec; const xScale: TCplx; const Y: TCplx; const Z: TCplx): TMtxVec; | self = (X*xScale + yScalar)*zScalar |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: TCplx; const Y: TCplx; const Z: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 3 | function AddAndMul(const X: TMtxVec; const xScale: TCplx; const Y: TCplx; const Z: TMtxVec): TMtxVec; | self = (X*xScale + yScalar)*Z |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: TCplx; const Y: TCplx; const Z: TMtxVec; zIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 4 | function AddAndMul(const X: TMtxVec; const xScale: TCplx; const Y: TCplx; const Z: TMtxVec; const zScale: TCplx): TMtxVec; | self = (X* xScale + yScalar)*Z*zScale |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: TCplx; const Y: TCplx; const Z: TMtxVec; zIndex: Integer; const zScale: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 5 | function AddAndMul(const X: TMtxVec; const Y: TCplx; const Z: TMtxVec): TMtxVec; | self = (X + yScalar)*Z |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TCplx; const Z: TMtxVec; zIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 6 | function AddAndMul(const X: TMtxVec; const Y: TCplx; const Z: TMtxVec; const zScale: TCplx): TMtxVec; | self = (X + yScalar)*Z*zScale |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TCplx; const Z: TMtxVec; zIndex: Integer; const zScale: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 7 | function AddAndMul(const X: TMtxVec; const xScale: TCplx; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): TMtxVec; | self = (X*xScale + Y*yScale)*zScalar |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: TCplx; const Y: TMtxVec; YIndex: Integer; const yScale: TCplx; const Z: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 8 | function AddAndMul(const X: TMtxVec; const xScale: TCplx; const Y: TMtxVec; const yScale: TCplx; const Z: TMtxVec; const zScale: TCplx): TMtxVec; | self = (X*xScale + Y*yScale)*Z*zScale |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: TCplx; const Y: TMtxVec; YIndex: Integer; const yScale: TCplx; const Z: TMtxVec; zIndex: Integer; const zScale: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 9 | function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const Z: TCplx): TMtxVec; | self = (X + Y)*zScalar |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 10 | function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): TMtxVec; | self = (X + Y*yScale)*zScalar |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const yScale: TCplx; const Z: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 11 | function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const yScale: TCplx; const Z: TMtxVec; const zScale: TCplx): TMtxVec; | self = (X + Y*yScale)*Z*zScale |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const yScale: TCplx; const Z: TMtxVec; zIndex: Integer; const zScale: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 12 | function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const Z: TMtxVec): TMtxVec; | self = (X + Y)*Z |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TMtxVec; zIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 13 | function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const Z: TMtxVec; const zScale: TCplx): TMtxVec; | self = (X + Y)*Z*zScale |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TMtxVec; zIndex: Integer; const zScale: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 14 | function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const Z: TMtxVec; const zScale: Double): TMtxVec; | self = (X + Y)*Z*zScale |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TMtxVec; zIndex: Integer; const zScale: Double; Index: Integer; Len: Integer): TMtxVec; | ||
| 15 | function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const Z: Double): TMtxVec; | self = (X + Y)*zScalar |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: Double; Index: Integer; Len: Integer): TMtxVec; | ||
| 16 | function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const yScale: Double; const Z: TMtxVec; const zScale: Double): TMtxVec; | self = (X + Y*yScale)*Z*zScale |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const yScale: Double; const Z: TMtxVec; zIndex: Integer; const zScale: Double; Index: Integer; Len: Integer): TMtxVec; | ||
| 17 | function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const yScale: Double; const Z: Double): TMtxVec; | self = (X + Y*yScale)*zScalar |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const yScale: Double; const Z: Double; Index: Integer; Len: Integer): TMtxVec; | ||
| 18 | function AddAndMul(const X: TMtxVec; const Y: Double; const Z: TMtxVec): TMtxVec; | self = (X + yScalar)*Z |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: Double; const Z: TMtxVec; zIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 19 | function AddAndMul(const X: TMtxVec; const Y: Double; const Z: TMtxVec; const zScale: Double): TMtxVec; | self = (X + yScalar)*Z*zScale |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: Double; const Z: TMtxVec; zIndex: Integer; const zScale: Double; Index: Integer; Len: Integer): TMtxVec; | ||
| 20 | function AddAndMul(const X: TMtxVec; const xScale: Double; const Y: TMtxVec; const yScale: Double; const Z: TMtxVec; const zScale: Double): TMtxVec; | self = (X*xScale + Y*yScale)*Z*zScale |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: Double; const Y: TMtxVec; YIndex: Integer; const yScale: Double; const Z: TMtxVec; zIndex: Integer; const zScale: Double; Index: Integer; Len: Integer): TMtxVec; | ||
| 21 | function AddAndMul(const X: TMtxVec; const xScale: Double; const Y: TMtxVec; const yScale: Double; const Z: Double): TMtxVec; | self = (X*xScale + Y*yScale)*zScalar |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: Double; const Y: TMtxVec; YIndex: Integer; const yScale: Double; const Z: Double; Index: Integer; Len: Integer): TMtxVec; | ||
| 22 | function AddAndMul(const X: TMtxVec; const Y: Double; const Z: Double): TMtxVec; | self = (X + yScalar)*zScalar |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: Double; const Z: Double; Index: Integer; Len: Integer): TMtxVec; | ||
| 23 | function AddAndMul(const X: TMtxVec; const xScale: Double; const Y: Double; const Z: TMtxVec): TMtxVec; | self = (X*xScale + yScalar)*Z |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: Double; const Y: Double; const Z: TMtxVec; zIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 24 | function AddAndMul(const X: TMtxVec; const xScale: Double; const Y: Double; const Z: TMtxVec; const zScale: Double): TMtxVec; | self = (X* xScale + yScalar)*Z*zScale |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: Double; const Y: Double; const Z: TMtxVec; zIndex: Integer; const zScale: Double; Index: Integer; Len: Integer): TMtxVec; | ||
| 25 | function AddAndMul(const X: TMtxVec; const xScale: Double; const Y: Double; const Z: Double): TMtxVec; | self = (X*xScale + yScalar)*zScalar |
| └ indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: Double; const Y: Double; const Z: Double; Index: Integer; Len: Integer): TMtxVec; |
Overload 1: function AddAndMul(const X: TMtxVec; const Y: TCplx; const Z: TCplx): TMtxVec;
Compute (X + yScalar)*zScalar
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TCplx; const Z: TCplx; Index: Integer; Len: Integer): TMtxVec;
Compute (X + yScalar)*zScalar on sub-array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | Y | TCplx | |
| 4 | Z | TCplx | |
| 5 | Index | Integer | start index |
| 6 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 2: function AddAndMul(const X: TMtxVec; const xScale: TCplx; const Y: TCplx; const Z: TCplx): TMtxVec;
Compute (X*xScale + yScalar)*zScalar
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: TCplx; const Y: TCplx; const Z: TCplx; Index: Integer; Len: Integer): TMtxVec;
Compute (X*xScale + yScalar)*zScalar on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | xScale | TCplx | |
| 4 | Y | TCplx | |
| 5 | Z | TCplx | |
| 6 | Index | Integer | start index |
| 7 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 3: function AddAndMul(const X: TMtxVec; const xScale: TCplx; const Y: TCplx; const Z: TMtxVec): TMtxVec;
Compute (X*xScale + yScalar)*Z
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: TCplx; const Y: TCplx; const Z: TMtxVec; zIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
Compute (X*xScale + yScalar)*Z on sub-array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | xScale | TCplx | |
| 4 | Y | TCplx | |
| 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 4: function AddAndMul(const X: TMtxVec; const xScale: TCplx; const Y: TCplx; const Z: TMtxVec; const zScale: TCplx): TMtxVec;
Compute (X* xScale + yScalar)*Z*zScale
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: TCplx; const Y: TCplx; const Z: TMtxVec; zIndex: Integer; const zScale: TCplx; Index: Integer; Len: Integer): TMtxVec;
Compute (X* xScale + yScalar)*Z*zScale on sub-array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | xScale | TCplx | |
| 4 | Y | TCplx | |
| 5 | Z | TMtxVec | |
| 6 | zIndex | Integer | |
| 7 | zScale | TCplx | |
| 8 | Index | Integer | start index |
| 9 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 5: function AddAndMul(const X: TMtxVec; const Y: TCplx; const Z: TMtxVec): TMtxVec;
Compute (X + yScalar)*Z
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TCplx; const Z: TMtxVec; zIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
Compute (X + yScalar)*Z on sub-array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | Y | TCplx | |
| 4 | Z | TMtxVec | |
| 5 | zIndex | Integer | |
| 6 | Index | Integer | start index |
| 7 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 6: function AddAndMul(const X: TMtxVec; const Y: TCplx; const Z: TMtxVec; const zScale: TCplx): TMtxVec;
Compute (X + yScalar)*Z*zScale
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TCplx; const Z: TMtxVec; zIndex: Integer; const zScale: TCplx; Index: Integer; Len: Integer): TMtxVec;
Compute (X + yScalar)*Z*zScale on sub-array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | Y | TCplx | |
| 4 | Z | TMtxVec | |
| 5 | zIndex | Integer | |
| 6 | zScale | TCplx | |
| 7 | Index | Integer | start index |
| 8 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 7: function AddAndMul(const X: TMtxVec; const xScale: TCplx; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): TMtxVec;
Compute (X*xScale + Y*yScale)*zScalar
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: TCplx; const Y: TMtxVec; YIndex: Integer; const yScale: TCplx; const Z: TCplx; Index: Integer; Len: Integer): TMtxVec;
Compute (X*xScale + Y*yScale)*zScalar on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | xScale | TCplx | |
| 4 | Y | TMtxVec | |
| 5 | YIndex | Integer | Y start index |
| 6 | yScale | TCplx | |
| 7 | Z | TCplx | |
| 8 | Index | Integer | start index |
| 9 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 8: function AddAndMul(const X: TMtxVec; const xScale: TCplx; const Y: TMtxVec; const yScale: TCplx; const Z: TMtxVec; const zScale: TCplx): TMtxVec;
Compute (X*xScale + Y*yScale)*Z*zScale
Result: stored in self (calling object), returns self for chaining
The following is also possible at the same or higher speed:
X^2 xScale + XY yScale
by passing X also for the Z parameter.
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: TCplx; const Y: TMtxVec; YIndex: Integer; const yScale: TCplx; const Z: TMtxVec; zIndex: Integer; const zScale: TCplx; Index: Integer; Len: Integer): TMtxVec;
Compute (X*xScale + Y*yScale)*Z*Scale on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | xScale | TCplx | |
| 4 | Y | TMtxVec | |
| 5 | YIndex | Integer | Y start index |
| 6 | yScale | TCplx | |
| 7 | Z | TMtxVec | |
| 8 | zIndex | Integer | |
| 9 | zScale | TCplx | |
| 10 | Index | Integer | start index |
| 11 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 9: function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const Z: TCplx): TMtxVec;
Compute (X + Y)*zScalar
Result: stored in self (calling object), returns self for chaining
uses MtxVec, MtxExpr, Math387;
var
X, Z, A1, A2, A3: Vector;
yScalar: Double;
begin
yScalar := 2.0;
X := [1,2,3,4];
Z := [3,4,5,6];
A1 := (X + yScalar) * Z;
A2 := AddAndMul(X, yScalar, Z);
A3.AddAndMul(X, yScalar, Z);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Indexed: function AddAndMul(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 10: function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): TMtxVec;
Compute (X + Y*yScale)*zScalar
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const yScale: TCplx; const Z: TCplx; Index: Integer; Len: Integer): TMtxVec;
Compute (X + Y*yScale)*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 | yScale | TCplx | |
| 6 | Z | TCplx | |
| 7 | Index | Integer | start index |
| 8 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 11: function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const yScale: TCplx; const Z: TMtxVec; const zScale: TCplx): TMtxVec;
Compute (X + Y*yScale)*Z*zScale
Result: stored in self (calling object), returns self for chaining
uses MtxVec, MtxExpr, Math387;
var
X, Y, A1, A2, A3: Vector;
zScalar: Double;
begin
zScalar := 3.0;
X := [1,2,3,4];
Y := [2,3,4,5];
A1 := (X + Y) * zScalar;
A2 := AddAndMul(X, Y, zScalar);
A3.AddAndMul(X, Y, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const yScale: TCplx; const Z: TMtxVec; zIndex: Integer; const zScale: TCplx; Index: Integer; Len: Integer): TMtxVec;
Compute (X + Y*yScale)*Z*zScale 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 | yScale | TCplx | |
| 6 | Z | TMtxVec | |
| 7 | zIndex | Integer | |
| 8 | zScale | TCplx | |
| 9 | Index | Integer | start index |
| 10 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
uses MtxVec, MtxExpr, Math387;
var
X, Z, A1, A2, A3: Vector;
yScalar, zScale: Double;
begin
yScalar := 2.0;
zScale := 3.0;
X := [1,2,3,4];
Z := [3,4,5,6];
A1 := (X + yScalar) * Z * zScale;
A2 := AddAndMul(X, yScalar, Z, zScale);
A3.AddAndMul(X, yScalar, Z, zScale);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Overload 12: function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const Z: TMtxVec): TMtxVec;
Compute (X + Y)*Z
Result: stored in self (calling object), returns self for chaining
uses MtxVec, MtxExpr, Math387;
var
X, Y, Z, A1, A2, A3: Vector;
xScale, yScale, zScale: Double;
begin
xScale := 1.0;
yScale := 2.0;
zScale := 3.0;
X := [1,2,3,4];
Y := [2,3,4,5];
Z := [3,4,5,6];
A1 := (X * xScale + Y * yScale) * Z * zScale;
A2 := AddAndMul(X, xScale, Y, yScale, Z, zScale);
A3.AddAndMul(X, xScale, Y, yScale, Z, zScale);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Indexed: function AddAndMul(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
uses MtxVec, MtxExpr, Math387;
var
X, Z, A1, A2, A3: Vector;
xScale, yScalar, zScale: Double;
begin
xScale := 1.0;
yScalar := 2.0;
zScale := 3.0;
X := [1,2,3,4];
Z := [3,4,5,6];
A1 := (X * xScale + yScalar) * Z * zScale;
A2 := AddAndMul(X, xScale, yScalar, Z, zScale);
A3.AddAndMul(X, xScale, yScalar, Z, zScale);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Overload 13: function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const Z: TMtxVec; const zScale: TCplx): TMtxVec;
Compute (X + Y)*Z*zScale
Result: stored in self (calling object), returns self for chaining
uses MtxVec, MtxExpr, Math387;
var
X, A1, A2, A3: Vector;
xScale, yScalar, zScalar: Double;
begin
xScale := 1.0;
yScalar := 2.0;
zScalar := 3.0;
X := [1,2,3,4];
A1 := (X * xScale + yScalar) * zScalar;
A2 := AddAndMul(X, xScale, yScalar, zScalar);
A3.AddAndMul(X, xScale, yScalar, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TMtxVec; zIndex: Integer; const zScale: TCplx; Index: Integer; Len: Integer): TMtxVec;
Compute (X + Y)*Z*zScale 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 | zScale | TCplx | |
| 8 | Index | Integer | start index |
| 9 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
uses MtxVec, MtxExpr, Math387;
var
X, Y, Z, A1, A2, A3: Vector;
zScale: Double;
begin
zScale := 2.0;
X := [1,2,3,4];
Y := [2,3,4,5];
Z := [3,4,5,6];
A1 := (X + Y) * Z * zScale;
A2 := AddAndMul(X, Y, Z, zScale);
A3.AddAndMul(X, Y, Z, zScale);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Overload 14: function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const Z: TMtxVec; const zScale: Double): TMtxVec;
Compute (X + Y)*Z*zScale
Result: stored in self (calling object), returns self for chaining
uses MtxVec, MtxExpr, Math387;
var
X, Y, A1, A2, A3: Vector;
xScale, yScale, zScalar: Double;
begin
xScale := 1.0;
yScale := 2.0;
zScalar := 3.0;
X := [1,2,3,4];
Y := [2,3,4,5];
A1 := (X * xScale + Y * yScale) * zScalar;
A2 := AddAndMul(X, xScale, Y, yScale, zScalar);
A3.AddAndMul(X, xScale, Y, yScale, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TMtxVec; zIndex: Integer; const zScale: Double; Index: Integer; Len: Integer): TMtxVec;
Compute (X + Y)*Z*zScale 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 | zScale | Double | |
| 8 | Index | Integer | start index |
| 9 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
uses MtxVec, MtxExpr, Math387;
var
X, Y, Z, A1, A2, A3: Vector;
begin
X := [1,2,3,4];
Y := [2,3,4,5];
Z := [3,4,5,6];
A1 := (X + Y) * Z;
A2 := AddAndMul(X, Y, Z);
A3.AddAndMul(X, Y, Z);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Overload 15: function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const Z: Double): TMtxVec;
Compute (X + Y)*zScalar
Result: stored in self (calling object), returns self for chaining
uses MtxVec, MtxExpr, Math387;
var
X, Z, A1, A2, A3: Vector;
xScale, yScalar: Double;
begin
xScale := 1.0;
yScalar := 2.0;
X := [1,2,3,4];
Z := [3,4,5,6];
A1 := (X * xScale + yScalar) * Z;
A2 := AddAndMul(X, xScale, yScalar, Z);
A3.AddAndMul(X, xScale, yScalar, Z);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Indexed: function AddAndMul(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
uses MtxVec, MtxExpr, Math387;
var
X, A1, A2, A3: Vector;
yScalar, zScalar: Double;
begin
yScalar := 2.0;
zScalar := 3.0;
X := [1,2,3,4];
A1 := (X + yScalar) * zScalar;
A2 := AddAndMul(X, yScalar, zScalar);
A3.AddAndMul(X, yScalar, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Overload 16: function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const yScale: Double; const Z: TMtxVec; const zScale: Double): TMtxVec;
Compute (X + Y*yScale)*Z*zScale
Result: stored in self (calling object), returns self for chaining
uses MtxVec, MtxExpr, Math387;
var
X, Y, Z, A1, A2, A3: Vector;
yScale, zScale: Double;
begin
yScale := 1.5;
zScale := 2.0;
X := [1,2,3,4];
Y := [2,3,4,5];
Z := [3,4,5,6];
A1 := (X + Y * yScale) * Z * zScale;
A2 := AddAndMul(X, yScale, Y, yScale, Z, zScale); // Note: Overload parameter order as needed.
A3.AddAndMul(X, yScale, Y, yScale, Z, zScale);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const yScale: Double; const Z: TMtxVec; zIndex: Integer; const zScale: Double; Index: Integer; Len: Integer): TMtxVec;
Compute (X + Y*yScale)*Z*zScale 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 | yScale | Double | |
| 6 | Z | TMtxVec | |
| 7 | zIndex | Integer | |
| 8 | zScale | Double | |
| 9 | Index | Integer | start index |
| 10 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
uses MtxVec, MtxExpr, Math387;
var
X, Y, A1, A2, A3: Vector;
yScale, zScalar: Double;
begin
yScale := 1.5;
zScalar := 3.0;
X := [1,2,3,4];
Y := [2,3,4,5];
A1 := (X + Y * yScale) * zScalar;
A2 := AddAndMul(X, yScale, Y, yScale, zScalar);
A3.AddAndMul(X, yScale, Y, yScale, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Overload 17: function AddAndMul(const X: TMtxVec; const Y: TMtxVec; const yScale: Double; const Z: Double): TMtxVec;
Compute (X + Y*yScale)*zScalar
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const yScale: Double; const Z: Double; Index: Integer; Len: Integer): TMtxVec;
Compute (X + Y*yScale)*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 | yScale | Double | |
| 6 | Z | Double | |
| 7 | Index | Integer | start index |
| 8 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 18: function AddAndMul(const X: TMtxVec; const Y: Double; const Z: TMtxVec): TMtxVec;
Compute (X + yScalar)*Z
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: Double; const Z: TMtxVec; zIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
Compute (X + yScalar)*Z on sub-array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | Y | Double | |
| 4 | Z | TMtxVec | |
| 5 | zIndex | Integer | |
| 6 | Index | Integer | start index |
| 7 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 19: function AddAndMul(const X: TMtxVec; const Y: Double; const Z: TMtxVec; const zScale: Double): TMtxVec;
Compute (X + yScalar)*Z*zScale
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: Double; const Z: TMtxVec; zIndex: Integer; const zScale: Double; Index: Integer; Len: Integer): TMtxVec;
Compute (X + yScalar)*Z*zScale on sub-array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | Y | Double | |
| 4 | Z | TMtxVec | |
| 5 | zIndex | Integer | |
| 6 | zScale | Double | |
| 7 | Index | Integer | start index |
| 8 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 20: function AddAndMul(const X: TMtxVec; const xScale: Double; const Y: TMtxVec; const yScale: Double; const Z: TMtxVec; const zScale: Double): TMtxVec;
Compute (X*xScale + Y*yScale)*Z*zScale
Result: stored in self (calling object), returns self for chaining
The following is also possible at the same or higher speed:
X^2 xScale + XY yScale
by passing X also for the Z parameter.
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: Double; const Y: TMtxVec; YIndex: Integer; const yScale: Double; const Z: TMtxVec; zIndex: Integer; const zScale: Double; Index: Integer; Len: Integer): TMtxVec;
Compute (X*xScale + Y*yScale)*Z*Scale on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | xScale | Double | |
| 4 | Y | TMtxVec | |
| 5 | YIndex | Integer | Y start index |
| 6 | yScale | Double | |
| 7 | Z | TMtxVec | |
| 8 | zIndex | Integer | |
| 9 | zScale | Double | |
| 10 | Index | Integer | start index |
| 11 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 21: function AddAndMul(const X: TMtxVec; const xScale: Double; const Y: TMtxVec; const yScale: Double; const Z: Double): TMtxVec;
Compute (X*xScale + Y*yScale)*zScalar
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: Double; const Y: TMtxVec; YIndex: Integer; const yScale: Double; const Z: Double; Index: Integer; Len: Integer): TMtxVec;
Compute (X*xScale + Y*yScale)*zScalar on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | xScale | Double | |
| 4 | Y | TMtxVec | |
| 5 | YIndex | Integer | Y start index |
| 6 | yScale | Double | |
| 7 | Z | Double | |
| 8 | Index | Integer | start index |
| 9 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 22: function AddAndMul(const X: TMtxVec; const Y: Double; const Z: Double): TMtxVec;
Compute (X + yScalar)*zScalar
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | Y | Double | |
| 3 | Z | Double |
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const Y: Double; const Z: Double; Index: Integer; Len: Integer): TMtxVec;
Compute (X + yScalar)*zScalar on sub-array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | Y | Double | |
| 4 | Z | Double | |
| 5 | Index | Integer | start index |
| 6 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 23: function AddAndMul(const X: TMtxVec; const xScale: Double; const Y: Double; const Z: TMtxVec): TMtxVec;
Compute (X*xScale + yScalar)*Z
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: Double; const Y: Double; const Z: TMtxVec; zIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
Compute (X*xScale + yScalar)*Z on sub-array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | xScale | Double | |
| 4 | Y | Double | |
| 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 24: function AddAndMul(const X: TMtxVec; const xScale: Double; const Y: Double; const Z: TMtxVec; const zScale: Double): TMtxVec;
Compute (X* xScale + yScalar)*Z*zScale
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: Double; const Y: Double; const Z: TMtxVec; zIndex: Integer; const zScale: Double; Index: Integer; Len: Integer): TMtxVec;
Compute (X* xScale + yScalar)*Z*zScale on sub-array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | xScale | Double | |
| 4 | Y | Double | |
| 5 | Z | TMtxVec | |
| 6 | zIndex | Integer | |
| 7 | zScale | Double | |
| 8 | Index | Integer | start index |
| 9 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 25: function AddAndMul(const X: TMtxVec; const xScale: Double; const Y: Double; const Z: Double): TMtxVec;
Compute (X*xScale + yScalar)*zScalar
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | xScale | Double | |
| 3 | Y | Double | |
| 4 | Z | Double |
Result: stored in self (calling object), returns self for chaining
Indexed: function AddAndMul(const X: TMtxVec; XIndex: Integer; const xScale: Double; const Y: Double; const Z: Double; Index: Integer; Len: Integer): TMtxVec;
Compute (X*xScale + yScalar)*zScalar on sub array
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | |
| 2 | XIndex | Integer | X start index |
| 3 | xScale | Double | |
| 4 | Y | Double | |
| 5 | Z | Double | |
| 6 | Index | Integer | start index |
| 7 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining