Vector.AddAndMul Method

Overload List

#SignatureDescription
1function 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;
2function 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;
3function 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;
4function 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;
5function 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;
6function 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;
7function 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;
8function 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;
9function 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;
10function 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;
11function 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;
12function 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;
13function 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;
14function 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;
15function 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;
16function 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;
17function 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;
18function 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;
19function 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;
20function 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;
21function 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;
22function 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;
23function 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;
24function 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;
25function 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

#NameTypeDescription
1XTMtxVec
2YTCplx
3ZTCplx

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YTCplx
4ZTCplx
5IndexIntegerstart index
6LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2xScaleTCplx
3YTCplx
4ZTCplx

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3xScaleTCplx
4YTCplx
5ZTCplx
6IndexIntegerstart index
7LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2xScaleTCplx
3YTCplx
4ZTMtxVec

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3xScaleTCplx
4YTCplx
5ZTMtxVec
6zIndexInteger
7IndexIntegerstart index
8LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2xScaleTCplx
3YTCplx
4ZTMtxVec
5zScaleTCplx

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3xScaleTCplx
4YTCplx
5ZTMtxVec
6zIndexInteger
7zScaleTCplx
8IndexIntegerstart index
9LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2YTCplx
3ZTMtxVec

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YTCplx
4ZTMtxVec
5zIndexInteger
6IndexIntegerstart index
7LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2YTCplx
3ZTMtxVec
4zScaleTCplx

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YTCplx
4ZTMtxVec
5zIndexInteger
6zScaleTCplx
7IndexIntegerstart index
8LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2xScaleTCplx
3YTMtxVec
4yScaleTCplx
5ZTCplx

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3xScaleTCplx
4YTMtxVec
5YIndexIntegerY start index
6yScaleTCplx
7ZTCplx
8IndexIntegerstart index
9LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2xScaleTCplx
3YTMtxVec
4yScaleTCplx
5ZTMtxVec
6zScaleTCplx

Result: stored in self (calling object), returns self for chaining

Remarks:

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3xScaleTCplx
4YTMtxVec
5YIndexIntegerY start index
6yScaleTCplx
7ZTMtxVec
8zIndexInteger
9zScaleTCplx
10IndexIntegerstart index
11LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2YTMtxVec
3ZTCplx

Result: stored in self (calling object), returns self for chaining

Examples
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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YTMtxVec
4YIndexIntegerY start index
5ZTCplx
6IndexIntegerstart index
7LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2YTMtxVec
3yScaleTCplx
4ZTCplx

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YTMtxVec
4YIndexIntegerY start index
5yScaleTCplx
6ZTCplx
7IndexIntegerstart index
8LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2YTMtxVec
3yScaleTCplx
4ZTMtxVec
5zScaleTCplx

Result: stored in self (calling object), returns self for chaining

Examples
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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YTMtxVec
4YIndexIntegerY start index
5yScaleTCplx
6ZTMtxVec
7zIndexInteger
8zScaleTCplx
9IndexIntegerstart index
10LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Examples
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

#NameTypeDescription
1XTMtxVec
2YTMtxVec
3ZTMtxVec

Result: stored in self (calling object), returns self for chaining

Examples
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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YTMtxVec
4YIndexIntegerY start index
5ZTMtxVec
6zIndexInteger
7IndexIntegerstart index
8LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Examples
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

#NameTypeDescription
1XTMtxVec
2YTMtxVec
3ZTMtxVec
4zScaleTCplx

Result: stored in self (calling object), returns self for chaining

Examples
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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YTMtxVec
4YIndexIntegerY start index
5ZTMtxVec
6zIndexInteger
7zScaleTCplx
8IndexIntegerstart index
9LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Examples
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

#NameTypeDescription
1XTMtxVec
2YTMtxVec
3ZTMtxVec
4zScaleDouble

Result: stored in self (calling object), returns self for chaining

Examples
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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YTMtxVec
4YIndexIntegerY start index
5ZTMtxVec
6zIndexInteger
7zScaleDouble
8IndexIntegerstart index
9LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Examples
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

#NameTypeDescription
1XTMtxVec
2YTMtxVec
3ZDouble

Result: stored in self (calling object), returns self for chaining

Examples
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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YTMtxVec
4YIndexIntegerY start index
5ZDouble
6IndexIntegerstart index
7LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Examples
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

#NameTypeDescription
1XTMtxVec
2YTMtxVec
3yScaleDouble
4ZTMtxVec
5zScaleDouble

Result: stored in self (calling object), returns self for chaining

Examples
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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YTMtxVec
4YIndexIntegerY start index
5yScaleDouble
6ZTMtxVec
7zIndexInteger
8zScaleDouble
9IndexIntegerstart index
10LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Examples
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

#NameTypeDescription
1XTMtxVec
2YTMtxVec
3yScaleDouble
4ZDouble

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YTMtxVec
4YIndexIntegerY start index
5yScaleDouble
6ZDouble
7IndexIntegerstart index
8LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2YDouble
3ZTMtxVec

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YDouble
4ZTMtxVec
5zIndexInteger
6IndexIntegerstart index
7LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2YDouble
3ZTMtxVec
4zScaleDouble

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YDouble
4ZTMtxVec
5zIndexInteger
6zScaleDouble
7IndexIntegerstart index
8LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2xScaleDouble
3YTMtxVec
4yScaleDouble
5ZTMtxVec
6zScaleDouble

Result: stored in self (calling object), returns self for chaining

Remarks:

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3xScaleDouble
4YTMtxVec
5YIndexIntegerY start index
6yScaleDouble
7ZTMtxVec
8zIndexInteger
9zScaleDouble
10IndexIntegerstart index
11LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2xScaleDouble
3YTMtxVec
4yScaleDouble
5ZDouble

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3xScaleDouble
4YTMtxVec
5YIndexIntegerY start index
6yScaleDouble
7ZDouble
8IndexIntegerstart index
9LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2YDouble
3ZDouble

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3YDouble
4ZDouble
5IndexIntegerstart index
6LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2xScaleDouble
3YDouble
4ZTMtxVec

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3xScaleDouble
4YDouble
5ZTMtxVec
6zIndexInteger
7IndexIntegerstart index
8LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2xScaleDouble
3YDouble
4ZTMtxVec
5zScaleDouble

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3xScaleDouble
4YDouble
5ZTMtxVec
6zIndexInteger
7zScaleDouble
8IndexIntegerstart index
9LenIntegerelement 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

#NameTypeDescription
1XTMtxVec
2xScaleDouble
3YDouble
4ZDouble

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

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3xScaleDouble
4YDouble
5ZDouble
6IndexIntegerstart index
7LenIntegerelement count

Result: stored in self (calling object), returns self for chaining