Matrix.Inv Method

Overload List

#SignatureDescription
1TMtx InvCalculates matrix inverse (Mtx^-1).
└ indexed: TMtxVec Inv(Int32 Index, Int32 Len)
2TMtx Inv(TMtxType MtxType)self = inverse of the matrix
3TMtxVec Inv(TMtxVec X)Calculate the inverse of all X object elements without the limiting operating.
└ indexed: TMtxVec Inv(TMtxVec X, Int32 XIndex, Int32 Index, Int32 Len)
4TMtxVec Inv(TMtxVec X, Double Threshold)Calculate the inverse of all X object elements anmd store the results to calling object elements.
└ indexed: TMtxVec Inv(TMtxVec X, Double Threshold, Int32 XIndex, Int32 Index, Int32 Len)
5TMtxVec Inv(Double Threshold)Calculate the inverse of all calling object elements in-place.
└ indexed: TMtxVec Inv(Double Threshold, Int32 Index, Int32 Len)

Overload 1: TMtx Inv

Calculates matrix inverse (Mtx^-1).

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

Remarks:

Calculate the inverse (Mtx^-1) of the calling matrix. If the calling matrix is not Dew.Math.Matrix.Quadratic, an exception is raised. Parameter Dew.Math.TMtxType determines which optimized method will be used for calculating the inverse matrix. If MtxType is omitted, the default value mtGeneral (general quadratic matrix) is used.

Note
The MtxType parameter is not verified. To determine if the calling matrix type is actually MtxType, use the Dew.Math.Matrix.DetectMtxType method.

Examples
Matrix A;
A.SetIt(2,2,false,[1,2,
2,4]);  // 2x2, real matrix
A.Inv;
See Also: Matrix.DetectMtxType, Matrix.MtxError

Indexed: TMtxVec Inv(Int32 Index, Int32 Len)

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

#NameTypeDescription
1IndexInt32start index
2LenInt32element count

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

Remarks:

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

Examples
Matrix a;
Matrix b;
a.SetIt(2,2,false,new double[] {1,2,3,4});  // a = new double[] {1, 2, 3, 4}
b.Inv(a,0.01); // b = new double[] {1.0, 0.5, 0.3333, 0.25}
b = Inv(a,0.01);

Overload 2: TMtx Inv(TMtxType MtxType)

Compute inverse of the matrix.

#NameTypeDescription
1MtxTypeTMtxType

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

Remarks:

Specify the matrix type to select the most performance efficient algorithm.

Overload 3: TMtxVec Inv(TMtxVec X)

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

#NameTypeDescription
1XTMtxVecsource TVec or TMtx

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

Remarks:

Store the results in calling object. Size and Dew.Math.Matrix.Complex property of calling object are adjusted automatically. Does not compute matrix inverse. The limiting of the magnitude of each element by the lower bound of Threshold is left out.

Indexed: TMtxVec Inv(TMtxVec X, Int32 XIndex, Int32 Index, Int32 Len)

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

#NameTypeDescription
1XTMtxVecsource TVec or TMtx
2XIndexInt32X start index
3IndexInt32start index
4LenInt32element 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 Dew.Math.Matrix.Complex property does not match or array borders are overrun/underrun.

Overload 4: TMtxVec Inv(TMtxVec X, Double Threshold)

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

#NameTypeDescription
1XTMtxVecsource TVec or TMtx
2ThresholdDoublescalar

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

Remarks:

Size and Dew.Math.Matrix.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.

Note
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: TMtxVec Inv(TMtxVec X, Double Threshold, Int32 XIndex, Int32 Index, Int32 Len)

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

#NameTypeDescription
1XTMtxVecsource TVec or TMtx
2ThresholdDoublescalar
3XIndexInt32X start index
4IndexInt32start index
5LenInt32element count

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

Remarks:

Limit the magnitude of each element by the lower bound of Threshold. Store the results in calling object elements [Index]..[Index+Len-1]. An exception is raised if X and calling object Dew.Math.Matrix.Complex property do not match or array borders are overrun/underrun.

Overload 5: TMtxVec Inv(Double Threshold)

Calculate the inverse of all calling object elements in-place.

#NameTypeDescription
1ThresholdDoublescalar

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

Remarks:

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: TMtxVec Inv(Double Threshold, Int32 Index, Int32 Len)

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

#NameTypeDescription
1ThresholdDoublescalar
2IndexInt32start index
3LenInt32element count

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

Remarks:

Limit the magnitude of each element by the lower bound of Threshold. An exception is raised if array borders are overrun/underrun.