Vector.Scale Method

Overload List

#SignatureDescription
1function Scale(Factor: TCplx): TMtxVec;Multiply all calling object elements with a complex Value in-place.
└ indexed: function Scale(Factor: TCplx; Index: Integer; Len: Integer): TMtxVec;
2function Scale(Factor: Double): TMtxVec;Multiply object elements with Value.
└ indexed: function Scale(Factor: Double; Index: Integer; Len: Integer): TMtxVec;

Overload 1: function Scale(Factor: TCplx): TMtxVec;

Multiply all calling object elements with a complex Value in-place.

#NameTypeDescription
1FactorTCplxscalar

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

Indexed: function Scale(Factor: TCplx; Index: Integer; Len: Integer): TMtxVec;

Multipy calling object elements [Index]..[Index+Len-1] with complex Value in-place.

#NameTypeDescription
1FactorTCplxscalar
2IndexIntegerstart index
3LenIntegerelement count

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

Remarks:

An exception is raised if array borders are overrun or underrun.

Overload 2: function Scale(Factor: Double): TMtxVec;

Multiply object elements with Value.

#NameTypeDescription
1FactorDoublescalar

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

Remarks:

Multiply all calling object elements with Value in-place. This method is the same as the Vector.Mul method overloads multiplying with vector elements with a scalar.

Examples
var v: Vector;
begin
    v.SetIt(false,[2,3,5]);  // v = [2,3,5]
    v.Scale(3); // v = [6,9,15]
end;
See Also: Vector.Add

Indexed: function Scale(Factor: Double; Index: Integer; Len: Integer): TMtxVec;

Multipy calling object elements [Index]..[Index+Len-1] with Value in-place.

#NameTypeDescription
1FactorDoublescalar
2IndexIntegerstart index
3LenIntegerelement count

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

Remarks:

An exception is raised if array borders are overrun or underrun.