<< mps_copy mpscilab mps_diag >>

mpscilab >> mpscilab > mps_det

mps_det

Matrix determinant

Calling Sequence

mps_det( rop, op )
mps_det( rop, op, tmp )
rop = mps_det( op )

Overloaded usage:

rop = det( op )

Arguments

rop

multi-precision scalar

op, tmp

multi-precision matrix

Description

Compute the matrix determinant of op.

mps_det( rop, op )

Computes the matrix determinant of op. The temporary matrix required for evaluating the determinant is automatically created and cleared.

mps_det( rop, op, tmp )

Compute the matrix determinant of op. The third argument is used as the temporary matrix to evaluate the determinant. If op and tmp are the same the decomposition will be performed in place without any temporary storage requirement.

rop = mps_inv( op )

Creates a multi-precision scalar the same precision as op containing the result.

rop = det( op )

Overloaded Scilab primitive det().

Usage notes

When the input matrix is not needed it can be passed as the temporary matrix to perform the intermediary decomposition in-place.

The determinant is evaluated by performing an in-place lu decomposition with partial pivoting.

Examples

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

// Standard usage with an explicit temporary matrix.
A = [1 -2; 3 -4]
mpsA = mps_init2(A,100)
tmp = mps_init(2,2,100)
rop = mps_init(1,1,100)
mps_det(rop, mpsA)

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

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

See Also

<< mps_copy mpscilab mps_diag >>