Vector.Inv Method

Overload List

#SignatureDescription
1function Inv: TMtxVec;Invert elements.
└ indexed: function Inv(Index: Integer; Len: Integer): TMtxVec;
2function Inv(const X: TMtxVec): TMtxVec;Calculate the inverse of all X object elements without limiting operating.
└ indexed: function Inv(const X: TMtxVec; XIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
3function Inv(const X: TMtxVec; Threshold: Double): TMtxVec;Calculate the inverse of all X object elements anmd store the results to calling object elements.
└ indexed: function Inv(const X: TMtxVec; Threshold: Double; XIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
4function Inv(Threshold: Double): TMtxVec;Calculate the inverse of all calling object elements in-place. The computation occurs after first limiting the magnitude of each element by the lower bound of Threshold.
└ indexed: function Inv(Threshold: Double; Index: Integer; Len: Integer): TMtxVec;

Overload 1: function Inv: TMtxVec;

Invert elements.

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

Remarks:

Calculates the inverse of all calling object elements in-place without limiting inverse operation.

Examples
var a,b: Vector;
begin
    a.SetIt(False,[1,2,3,4]);  // a = [1, 2, 3, 4]
    b.Inv(a); // b = [1.0, 0.5, 0.3333, 0.25]
    b := Inv(a);
end;
See Also: Vector.Divide

Indexed: function Inv(Index: Integer; Len: Integer): TMtxVec;

Calculate the inverse of calling object elements [Index]..[Index+Len-1] in-place.

#NameTypeDescription
1IndexIntegerstart index
2LenIntegerelement count

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

Remarks:

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

Overload 2: function Inv(const X: TMtxVec): TMtxVec;

Calculate the inverse of all X object elements without limiting operating.

#NameTypeDescription
1XTMtxVec

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

Remarks:

Store the results in calling object. Size and Vector.Complex property of calling object are adjusted automatically.

Indexed: function Inv(const X: TMtxVec; XIndex: Integer; Index: Integer; Len: Integer): TMtxVec;

Calculate the inverse of X object elements [XIndex]..[XIndex+Len-1] without limiting operating.

#NameTypeDescription
1XTMtxVec
2XIndexIntegerX start index
3IndexIntegerstart index
4LenIntegerelement count

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

Remarks:

Store the results in calling object elements [Index]..[Index+Len-1]. An exception is raised if X and calling object Vector.Complex property does not match or array borders are overrun/underrun.

Overload 3: function Inv(const X: TMtxVec; Threshold: Double): TMtxVec;

Calculate the inverse of all X object elements anmd store the results to calling object elements.

#NameTypeDescription
1XTMtxVec
2ThresholdDoublescalar

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

Remarks:

Size and Vector.Complex property of calling obhect are adjusted automatically. The computation occurs after first limiting the magnitude of each element by the lower bound of Threshold. The limiting operation is performed to avoid division by zero. Since Threshold represents a magnitude, it is always real and must always be positive. For complex versions, the magnitude of the input is limited, but the phase remains unchanged. Zero-valued input is assumed to have zero phase.

Indexed: function Inv(const X: TMtxVec; Threshold: Double; XIndex: Integer; Index: Integer; Len: Integer): TMtxVec;

Calculate the inverse of X object elements [XIndex]..[XIndex+Len-1] after limiting the magnitude of each element by the lower bound of Threshold.

#NameTypeDescription
1XTMtxVec
2ThresholdDoublescalar
3XIndexIntegerX start index
4IndexIntegerstart index
5LenIntegerelement count

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

Remarks:

Store the results in calling object elements [Index]..[Index+Len-1]. An exception is raised if X and calling object Vector.Complex property do not match or array borders are overrun/underrun.

Overload 4: function Inv(Threshold: Double): TMtxVec;

Calculate the inverse of all calling object elements in-place. The computation occurs after first limiting the magnitude of each element by the lower bound of Threshold.

#NameTypeDescription
1ThresholdDoublescalar

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

Remarks:

The limiting operation is performed to avoid division by zero. Since Threshold represents a magnitude, it is always real and must always be positive. For complex versions, the magnitude of the input is limited, but the phase remains unchanged. Zero-valued input is assumed to have zero phase.

Indexed: function Inv(Threshold: Double; Index: Integer; Len: Integer): TMtxVec;

Calculate the inverse of calling object elements [Index]..[Index+Len-1] in-place after limiting the magnitude of each element by the lower bound of Threshold.

#NameTypeDescription
1ThresholdDoublescalar
2IndexIntegerstart index
3LenIntegerelement count

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

Remarks:

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