Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function AddScaled(const Vec: TMtxVec; const aScale: TCplx): TMtxVec; | Add each of Vec elements to corresponding elements in the calling object. |
| └ indexed: function AddScaled(const Vec: TMtxVec; const aScale: TCplx; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 2 | function AddScaled(const X: TMtxVec; const xScale: TCplx; const Y: TMtxVec; const yScale: TCplx): TMtxVec; | self = X*xScale + Y*yScale |
| └ indexed: function AddScaled(const X: TMtxVec; XIndex: Integer; const xScale: TCplx; const Y: TMtxVec; YIndex: Integer; const yScale: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 3 | function AddScaled(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 AddScaled(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; | ||
| 4 | function AddScaled(const X: TMtxVec; const Y: TMtxVec; const yScale: TCplx): TMtxVec; | self = X + Y*yScale with complex arguments |
| └ indexed: function AddScaled(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const yScale: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 5 | function AddScaled(const X: TMtxVec; const Y: TMtxVec; const yScale: TCplx; const Z: TMtxVec; const zScale: TCplx): TMtxVec; | self = X + Y*yScale + Z*zScale |
| └ indexed: function AddScaled(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; | ||
| 6 | function AddScaled(const X: TMtxVec; const Y: TMtxVec; const Z: TMtxVec; const zScale: TCplx): TMtxVec; | self = X + Y + Z*zScale |
| └ indexed: function AddScaled(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TMtxVec; zIndex: Integer; const zScale: TCplx; Index: Integer; Len: Integer): TMtxVec; | ||
| 7 | function AddScaled(const X: TMtxVec; const Y: TMtxVec; const Z: TMtxVec; const zScale: Double): TMtxVec; | self = X + Y + Z*zScale |
| └ indexed: function AddScaled(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const Z: TMtxVec; zIndex: Integer; const zScale: Double; Index: Integer; Len: Integer): TMtxVec; | ||
| 8 | function AddScaled(const X: TMtxVec; const Y: TMtxVec; const yScale: Double): TMtxVec; | self = X + Y*yScale |
| └ indexed: function AddScaled(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const yScale: Double; Index: Integer; Len: Integer): TMtxVec; | ||
| 9 | function AddScaled(const X: TMtxVec; const Y: TMtxVec; const yScale: Double; const Z: TMtxVec; const zScale: Double): TMtxVec; | self = X + Y*yScale + Z*zScale |
| └ indexed: function AddScaled(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; | ||
| 10 | function AddScaled(const Vec: TMtxVec; const aScale: Double): TMtxVec; | Add each of Vec elements to corresponding elements in the calling object. |
| └ indexed: function AddScaled(const Vec: TMtxVec; const aScale: Double; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 11 | function AddScaled(const X: TMtxVec; const xScale: Double; const Y: TMtxVec; const yScale: Double): TMtxVec; | self = X*xScale + Y*yScale |
| └ indexed: function AddScaled(const X: TMtxVec; XIndex: Integer; const xScale: Double; const Y: TMtxVec; YIndex: Integer; const yScale: Double; Index: Integer; Len: Integer): TMtxVec; | ||
| 12 | function AddScaled(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 AddScaled(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; | ||
| 13 | function AddScaled(const Vec: TMtxVec; const RScale: Double; const IScale: Double): TMtxVec; | Add each of Vec elements to corresponding elements in the calling object. |
Overload 1: function AddScaled(const Vec: TMtxVec; const aScale: TCplx): TMtxVec;
Add each of Vec elements to corresponding elements in the calling object.
Result: stored in self (calling object), returns self for chaining
In addition, the following formula is being used:
result = result+ aScale*Vec .
The results are stored in the calling object. Size and TMtxVec.Complex properties of the calling object are set implicitly to match the Vec object.
uses MtxVec, MtxExpr, Math387;
var
X, Y, A1, A2, A3: Vector;
yScale: Double;
begin
yScale := 1.5;
X := [1,2,3,4];
Y := [2,3,4,5];
A1 := X + Y * yScale;
A2 := AddScaled(X, Y, yScale);
A3.AddScaled(X, Y, yScale);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Indexed: function AddScaled(const Vec: TMtxVec; const aScale: TCplx; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
Adds Vec elements [VecIndex]..[VecIndex+Len-1] to calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec | source TVec or TMtx |
| 2 | aScale | 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
In addition, the following formula is being used:
result = result+ aScale*Vec .
An exception is raised if TMtxVecBase.ConditionCheck is true and array borders are overrun.
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 := AddScaled(X, Y, yScale, Z, zScale);
A3.AddScaled(X, Y, yScale, Z, zScale);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Overload 2: function AddScaled(const X: TMtxVec; const xScale: TCplx; const Y: TMtxVec; const yScale: TCplx): TMtxVec;
Compute X*xScale + Y*yScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | xScale | TCplx | scalar |
| 3 | Y | TMtxVec | source TVec or TMtx |
| 4 | yScale | TCplx | scalar |
Result: stored in self (calling object), returns self for chaining
Indexed: function AddScaled(const X: TMtxVec; XIndex: Integer; const xScale: TCplx; const Y: TMtxVec; YIndex: Integer; const yScale: TCplx; Index: Integer; Len: Integer): TMtxVec;
Compute X*xScale + Y*yScale on sub arrays
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | XIndex | Integer | X start index |
| 3 | xScale | TCplx | scalar |
| 4 | Y | TMtxVec | source TVec or TMtx |
| 5 | YIndex | Integer | Y start index |
| 6 | yScale | TCplx | scalar |
| 7 | Index | Integer | start index |
| 8 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 3: function AddScaled(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
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | xScale | TCplx | scalar |
| 3 | Y | TMtxVec | source TVec or TMtx |
| 4 | yScale | TCplx | scalar |
| 5 | Z | TMtxVec | source TVec or TMtx |
| 6 | zScale | TCplx | scalar |
Result: stored in self (calling object), returns self for chaining
Indexed: function AddScaled(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*zScale on sub arrays
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | XIndex | Integer | X start index |
| 3 | xScale | TCplx | scalar |
| 4 | Y | TMtxVec | source TVec or TMtx |
| 5 | YIndex | Integer | Y start index |
| 6 | yScale | TCplx | scalar |
| 7 | Z | TMtxVec | source TVec or TMtx |
| 8 | zIndex | Integer | |
| 9 | zScale | TCplx | scalar |
| 10 | Index | Integer | start index |
| 11 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 4: function AddScaled(const X: TMtxVec; const Y: TMtxVec; const yScale: TCplx): TMtxVec;
Compute X + Y*yScale with complex arguments.
Result: stored in self (calling object), returns self for chaining
Indexed: function AddScaled(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const yScale: TCplx; Index: Integer; Len: Integer): TMtxVec;
Compute X + Y*yScale on sub arrays with complex arguments.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | XIndex | Integer | X start index |
| 3 | Y | TMtxVec | source TVec or TMtx |
| 4 | YIndex | Integer | Y start index |
| 5 | yScale | TCplx | scalar |
| 6 | Index | Integer | start index |
| 7 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 5: function AddScaled(const X: TMtxVec; const Y: TMtxVec; const yScale: TCplx; const Z: TMtxVec; const zScale: TCplx): TMtxVec;
Compute X + Y*yScale + Z*zScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | Y | TMtxVec | source TVec or TMtx |
| 3 | yScale | TCplx | scalar |
| 4 | Z | TMtxVec | source TVec or TMtx |
| 5 | zScale | TCplx | scalar |
Result: stored in self (calling object), returns self for chaining
Indexed: function AddScaled(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 arrays
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | XIndex | Integer | X start index |
| 3 | Y | TMtxVec | source TVec or TMtx |
| 4 | YIndex | Integer | Y start index |
| 5 | yScale | TCplx | scalar |
| 6 | Z | TMtxVec | source TVec or TMtx |
| 7 | zIndex | Integer | |
| 8 | zScale | TCplx | scalar |
| 9 | Index | Integer | start index |
| 10 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 6: function AddScaled(const X: TMtxVec; const Y: TMtxVec; const Z: TMtxVec; const zScale: TCplx): TMtxVec;
Compute X + Y + Z*zScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | Y | TMtxVec | source TVec or TMtx |
| 3 | Z | TMtxVec | source TVec or TMtx |
| 4 | zScale | TCplx | scalar |
Result: stored in self (calling object), returns self for chaining
Indexed: function AddScaled(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 arrays
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | XIndex | Integer | X start index |
| 3 | Y | TMtxVec | source TVec or TMtx |
| 4 | YIndex | Integer | Y start index |
| 5 | Z | TMtxVec | source TVec or TMtx |
| 6 | zIndex | Integer | |
| 7 | zScale | TCplx | scalar |
| 8 | Index | Integer | start index |
| 9 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 7: function AddScaled(const X: TMtxVec; const Y: TMtxVec; const Z: TMtxVec; const zScale: Double): TMtxVec;
Compute X + Y + Z*zScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | Y | TMtxVec | source TVec or TMtx |
| 3 | Z | TMtxVec | source TVec or TMtx |
| 4 | zScale | Double | scalar |
Result: stored in self (calling object), returns self for chaining
Indexed: function AddScaled(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 arrays
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | XIndex | Integer | X start index |
| 3 | Y | TMtxVec | source TVec or TMtx |
| 4 | YIndex | Integer | Y start index |
| 5 | Z | TMtxVec | source TVec or TMtx |
| 6 | zIndex | Integer | |
| 7 | zScale | Double | scalar |
| 8 | Index | Integer | start index |
| 9 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 8: function AddScaled(const X: TMtxVec; const Y: TMtxVec; const yScale: Double): TMtxVec;
Compute X + Y*yScale
Result: stored in self (calling object), returns self for chaining
Indexed: function AddScaled(const X: TMtxVec; XIndex: Integer; const Y: TMtxVec; YIndex: Integer; const yScale: Double; Index: Integer; Len: Integer): TMtxVec;
Compute X + Y*yScale on sub arrays.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | XIndex | Integer | X start index |
| 3 | Y | TMtxVec | source TVec or TMtx |
| 4 | YIndex | Integer | Y start index |
| 5 | yScale | Double | scalar |
| 6 | Index | Integer | start index |
| 7 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 9: function AddScaled(const X: TMtxVec; const Y: TMtxVec; const yScale: Double; const Z: TMtxVec; const zScale: Double): TMtxVec;
Compute X + Y*yScale + Z*zScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | Y | TMtxVec | source TVec or TMtx |
| 3 | yScale | Double | scalar |
| 4 | Z | TMtxVec | source TVec or TMtx |
| 5 | zScale | Double | scalar |
Result: stored in self (calling object), returns self for chaining
Indexed: function AddScaled(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 arrays
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | XIndex | Integer | X start index |
| 3 | Y | TMtxVec | source TVec or TMtx |
| 4 | YIndex | Integer | Y start index |
| 5 | yScale | Double | scalar |
| 6 | Z | TMtxVec | source TVec or TMtx |
| 7 | zIndex | Integer | |
| 8 | zScale | Double | scalar |
| 9 | Index | Integer | start index |
| 10 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 10: function AddScaled(const Vec: TMtxVec; const aScale: Double): TMtxVec;
Add each of Vec elements to corresponding elements in the calling object.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec | source TVec or TMtx |
| 2 | aScale | Double | scalar |
Result: stored in self (calling object), returns self for chaining
In addition, the following formula is being used:
result = result+ aScale*Vec .
The results are stored in the calling object. Size and TMtxVec.Complex properties of the calling object are set implicitly to match the Vec object.
uses MtxVec, MtxExpr, Math387;
var
X, Y, A1, A2, A3: Vector;
xScale, yScale: Double;
begin
xScale := 1.5;
yScale := -1.5;
X := [1,2,3,4];
Y := [2,3,4,5];
A1 := X * xScale + Y * yScale; // easiest to read, but creates temporaries
A2 := AddScaled(X, xScale, Y, yScale); // faster, but still one temporary
A3.AddScaled(X, xScale, Y, yScale); // fastest (in-place)
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Indexed: function AddScaled(const Vec: TMtxVec; const aScale: Double; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
Adds Vec elements [VecIndex]..[VecIndex+Len-1] to calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec | source TVec or TMtx |
| 2 | aScale | 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
The following formula is being used:
result = result + aScale*Vec .
An exception is raised if TMtxVecBase.ConditionCheck is true and array borders are overrun.
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 := AddScaled(X, Y, Z, zScale);
A3.AddScaled(X, Y, Z, zScale);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Overload 11: function AddScaled(const X: TMtxVec; const xScale: Double; const Y: TMtxVec; const yScale: Double): TMtxVec;
Compute X*xScale + Y*yScale
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | xScale | Double | scalar |
| 3 | Y | TMtxVec | source TVec or TMtx |
| 4 | yScale | Double | scalar |
Result: stored in self (calling object), returns self for chaining
Indexed: function AddScaled(const X: TMtxVec; XIndex: Integer; const xScale: Double; const Y: TMtxVec; YIndex: Integer; const yScale: Double; Index: Integer; Len: Integer): TMtxVec;
Compute X*xScale + Y*yScale on sub arrays
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | XIndex | Integer | X start index |
| 3 | xScale | Double | scalar |
| 4 | Y | TMtxVec | source TVec or TMtx |
| 5 | YIndex | Integer | Y start index |
| 6 | yScale | Double | scalar |
| 7 | Index | Integer | start index |
| 8 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 12: function AddScaled(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
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | xScale | Double | scalar |
| 3 | Y | TMtxVec | source TVec or TMtx |
| 4 | yScale | Double | scalar |
| 5 | Z | TMtxVec | source TVec or TMtx |
| 6 | zScale | Double | scalar |
Result: stored in self (calling object), returns self for chaining
Indexed: function AddScaled(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*zScale on sub arrays
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVec | source TVec or TMtx |
| 2 | XIndex | Integer | X start index |
| 3 | xScale | Double | scalar |
| 4 | Y | TMtxVec | source TVec or TMtx |
| 5 | YIndex | Integer | Y start index |
| 6 | yScale | Double | scalar |
| 7 | Z | TMtxVec | source TVec or TMtx |
| 8 | zIndex | Integer | |
| 9 | zScale | Double | scalar |
| 10 | Index | Integer | start index |
| 11 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Overload 13: function AddScaled(const Vec: TMtxVec; const RScale: Double; const IScale: Double): TMtxVec;
Add each of Vec elements to corresponding elements in the calling object.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec | source TVec or TMtx |
| 2 | RScale | Double | scalar |
| 3 | IScale | Double | scalar |
Result: stored in self (calling object), returns self for chaining
In addition, the following formula is being used:
result = result+ Cplx(RScale,IScale)*Vec .
When default values for parameters are being used the "normal" addition is being performed. The results are stored in the calling object. Size and TMtxVec.Complex properties of the calling object are set implicitly to match the Vec object.
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 := AddScaled(X, xScale, Y, yScale, Z, zScale);
A3.AddScaled(X, xScale, Y, yScale, Z, zScale);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;