<< mps_log2 mpscilab mps_mul >>

mpscilab >> mpscilab > mps_mat_mul

mps_mat_mul

Matrix multiplication

Calling Sequence

mps_mat_mul( rop, op1, op2 )
rop = mps_mat_mul( op1, op2 )

Overloaded usage:

rop = op1 * op2

Arguments

rop

multi-precision matrix

op, op2

Scilab double or multi-precision matrix

Description

Compute the matrix multiplication of op1 and op2. Exceptionally, if either op1 or op2 is a scalar and element-wise multiplication is performed.

mps_mat_mul( rop, op1, op2 )

In-place matrix inversion. rop will be overwritten with the result.

rop = mps_mat_mul( op1, op2 )

Creates a multi-precision matrix of the correct size containing the result.

rop = op1 * op2

Overloaded Scilab matrix multiplication operator. Create a multi-precision matrix the required size and with the same precision as o1p.

Usage notes

Like most mps functions the mps_mat_mul( rop, op1, op2 ) 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.

Limitations

At least one of the input operand must be a multi-precision matrix. Matrix multiplication between two Scilab matrix of double is not implemented .

Examples

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

// Matrix multiplication between and MPS matrix and a double Matrix.
A = [1 -2; 3 -4]
mpsA = mps_init2(A,100)
rop = mps_init(2,2,100)
mps_mat_mul(rop, mpsA, A)

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

See Also

<< mps_log2 mpscilab mps_mul >>