clMatrix.Power Method

Overload List

#SignatureDescription
1TOpenCLMtxVec Power(TCplx Exponent)Raises all calling vector elements to complex power Exponent in-place.
2TOpenCLMtxVec Power(TCplx aBase, TOpenCLMtxVec Exponent)Raises Base complex value to Exponent object values powers.
3TOpenCLMtxVec Power(TOpenCLMtxVec aBase, TCplx Exponent)Raises each of the Base object elements to complex Exponent power.
4TOpenCLMtxVec Power(TOpenCLMtxVec aBase, TOpenCLMtxVec Exponent)Raises each of Base object elements to corresponding power, stored in Exponenet elements.
5TOpenCLMtxVec Power(TOpenCLMtxVec aBase, Double Exponent)Raises each of the Base object elements to real Exponent power.
6TOpenCLMtxVec Power(Double Exponent)Raises base object elements to any power.
7TOpenCLMtxVec Power(Double aBase, TOpenCLMtxVec Exponent)Raises base elements to exponent power.

Overload 1: TOpenCLMtxVec Power(TCplx Exponent)

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 Dew.Math.clMatrix.ExtendToComplex 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: TOpenCLMtxVec Power(TCplx aBase, TOpenCLMtxVec Exponent)

Raises Base complex value to Exponent object values powers.

#NameTypeDescription
1aBaseTCplxscalar
2ExponentTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix

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

Remarks:

Store the results to calling object values. Size and Dew.Math.clMatrix.Complex properties of calling object are adjusted automatically.

Overload 3: TOpenCLMtxVec Power(TOpenCLMtxVec aBase, TCplx Exponent)

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

#NameTypeDescription
1aBaseTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
2ExponentTCplxscalar

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

Remarks:

Size and Dew.Math.clMatrix.Complex properties of calling object are adjusted automatically.

Overload 4: TOpenCLMtxVec Power(TOpenCLMtxVec aBase, TOpenCLMtxVec Exponent)

Raises each of Base object elements to corresponding power, stored in Exponenet elements.

#NameTypeDescription
1aBaseTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
2ExponentTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix

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

Remarks:

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

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

Overload 5: TOpenCLMtxVec Power(TOpenCLMtxVec aBase, Double Exponent)

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

#NameTypeDescription
1aBaseTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
2ExponentDoublescalar

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

Remarks:

Size and Dew.Math.clMatrix.Complex properties of calling object are adjusted automatically.

Overload 6: TOpenCLMtxVec Power(Double Exponent)

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 Dew.Math.clMatrix.IntPower is faster, if Exponent is an integer. Real valued power can handle only positive Exponent. Dew.Math.clMatrix.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
clMatrix a;
a.CopyFromArray(2,2,TSingleArray.Create(1,2,3,4));
a.Power(1.2);
See Also: clMatrix.IntPower, clMatrix.PowerVec

Overload 7: TOpenCLMtxVec Power(Double aBase, TOpenCLMtxVec Exponent)

Raises base elements to exponent power.

#NameTypeDescription
1aBaseDoublescalar
2ExponentTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix

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 Dew.Math.clMatrix.Complex properties of calling object are adjusted automatically.

See Also: clMatrix.PowerVec