Vector.Power Method

Overload List

#SignatureDescription
1function Power(Exponent: TCplx): TMtxVec;Raises all calling vector elements to complex power Exponent in-place.
2function Power(Base: TCplx; Exponent: TMtxVec): TMtxVec;Raises Base complex value to Exponent object values powers and store the results to calling object values.
3function Power(Base: TMtxVec; Exponent: TCplx): TMtxVec;Raises each of the Base object elements to complex Exponent power.
4function Power(Base: TMtxVec; Exponent: TMtxVec): TMtxVec;Raises each of Base object elements to corresponding power
5function Power(Base: TMtxVec; Exponent: Double): TMtxVec;Raises each of the Base object elements to real Exponent power.
6function Power(Exponent: Double): TMtxVec;Raises base object elements to any power.
7function Power(Base: Double; Exponent: TMtxVec): TMtxVec;Raises base elements to exponent power.

Overload 1: function Power(Exponent: TCplx): TMtxVec;

Raises all calling vector elements to complex power Exponent in-place.

#NameTypeDescription
1ExponentTCplxscalar

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

Remarks:

If the calling vector is real and has negative elements, the result will be NAN at those entries. To obtain a valid result in this case, extend the calling vector to complex with method. In all real/complex combinations, the Power method will not automatically assume that a number is complex to speed up the computation. Alternatively the user can of course always convert the real numbers to complex before passing them to the Power routine.

Overload 2: function Power(Base: TCplx; Exponent: TMtxVec): TMtxVec;

Raises Base complex value to Exponent object values powers and store the results to calling object values.

#NameTypeDescription
1BaseTCplxscalar
2ExponentTMtxVecsource TVec or TMtx

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

Remarks:

Size and Vector.Complex properties of calling object are adjusted automatically.

Overload 3: function Power(Base: TMtxVec; Exponent: TCplx): TMtxVec;

Raises each of the Base object elements to complex Exponent power.

#NameTypeDescription
1BaseTMtxVecsource TVec or TMtx
2ExponentTCplxscalar

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

Remarks:

Size and Vector.Complex properties of calling object are adjusted automatically.

Overload 4: function Power(Base: TMtxVec; Exponent: TMtxVec): TMtxVec;

Raises each of Base object elements to corresponding power

#NameTypeDescription
1BaseTMtxVecsource TVec or TMtx
2ExponentTMtxVecsource TVec or TMtx

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

Remarks:

Powers are stored in Exponenet elements:

Power[i] = Base[i]^Exponent[i]

Size and property of calling object are adjusted automatically. An exception is raised if Base and Exponent sizes do not match.

Overload 5: function Power(Base: TMtxVec; Exponent: Double): TMtxVec;

Raises each of the Base object elements to real Exponent power.

#NameTypeDescription
1BaseTMtxVecsource TVec or TMtx
2ExponentDoublescalar

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

Remarks:

Size and Vector.Complex properties of calling object are adjusted automatically.

Overload 6: function Power(Exponent: Double): TMtxVec;

Raises base object elements to any power.

#NameTypeDescription
1ExponentDoublescalar

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

Remarks:

Raises Base calling object elements to any power. The Vector.IntPower is faster, if Exponent is an integer. Real valued power can handle only positive Exponent. Vector.IntPower can handle negative exponent also. To compute a power to the negative exponent in general case or when the base is negative, use the complex version of the function.

Examples
var a: Vector;
begin
    a.SetIt(False,[1,2,3,4]);
    a.Power(1.2);
end;
See Also: Vector.IntPower, Vector.PowerVec

Overload 7: function Power(Base: Double; Exponent: TMtxVec): TMtxVec;

Raises base elements to exponent power.

#NameTypeDescription
1BaseDoublescalar
2ExponentTMtxVecsource TVec or TMtx

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

Remarks:

Raises Base value to Exponent object values powers and store the results to calling object values. Size and Vector.Complex properties of calling object are adjusted automatically.

See Also: Vector.PowerVec