<< mps_int mpscilab mps_linspace >>

mpscilab >> mpscilab > mps_inv

mps_inv

Matrix inverse

Calling Sequence

mps_inv( rop, op )
rop = mps_inv( op )

Overloaded usage:

rop = inv( op )

Arguments

rop

multi-precision matrix

op

multi-precision matrix

Description

Computes the matrix inverse of op.

mps_inv( rop, op )

Computes the matrix inverse of op.

rop = mps_inv( op )

Creates a multi-precision matrix the same size and precision as op containing the result.

rop = inv( op )

Overloaded Scilab primitive inv(). Create a multi-precision matrix the same size and precision as op containing the result.

Usage notes

Like most mps functions the mps_inv( rop, op ) form is faster and can reuse the space of an existing matrix but requires an already initialized operand. Also, the same form can be used to perform an in-place operation when rop and op are the same.

Inversion is performed by an in-place Gauss-Jordan elimination with partial pivoting.

Examples

// Standard usage.
A = [1 -2; 3 -4]
mpsA = mps_init2(A,100)
rop = mps_inv(mpsA)

// In-place operation
A = [1 -2; 3 -4]
mpsA = mps_init2(A,100)
mps_inv(mpsA, mpsA)

// Overloaded usage.
A = [1 -2; 3 -4]
mpsA = mps_init2(A,100)
rop = inv(mpsA)

See Also

<< mps_int mpscilab mps_linspace >>