Scythe-1.0.3
template<typename T_type , matrix_order ORDER, matrix_style STYLE, matrix_order L_ORDER, matrix_style L_STYLE, matrix_order R_ORDER, matrix_style R_STYLE>
Matrix< T_type, ORDER, STYLE > scythe::operator* ( const Matrix< T_type, L_ORDER, L_STYLE > &  lhs,
const Matrix< T_type, R_ORDER, R_STYLE > &  rhs 
) [inline]

Multiply two matrices.

This operator multiplies the matrices lhs and rhs together, returning the result in a new Matrix object. This operator is overloaded to provide both Matrix by Matrix multiplication and Matrix by scalar multiplication. In the latter case, the scalar on the left- or right-hand side of the operator is promoted to a 1x1 Matrix and then multiplied with the Matrix on the other side of the operator. In either case, the matrices must conform; that is, the number of columns in the left-hand side argument must equal the number of rows in the right-hand side argument. The one exception is when one matrix is a scalar. In this case we allow Matrix by scalar multiplication with the "*" operator that is comparable to element-by-element multiplication of a Matrix by a scalar value, for convenience.

In addition, we define multiple templates of the overloaded operator to provide maximal flexibility when working with matrices with differing matrix_order and/or matrix_style. Each version of the overloaded operator (Matrix by Matrix, scalar by Matrix, and Matrix by scalar) provides both a default and general behavior, using templates. By default, the returned Matrix is concrete and has the same matrix_order as the left-hand (or only) Matrix argument. Alternatively, one may coerce the matrix_order and matrix_style of the returned Matrix to preferred values by using the full template declaration of the operator.

Scythe will use LAPACK/BLAS routines to multiply concrete column-major matrices of double-precision floating point numbers if LAPACK/BLAS is available and you compile your program with the SCYTHE_LAPACK flag enabled.

Parameters:
lhsThe left-hand-side Matrix or scalar.
rhsThe right-hand-side Matrix or scalar.
See also:
operator*(const Matrix<T_type, L_ORDER, L_STYLE>& lhs, const Matrix<T_type, R_ORDER, R_STYLE>& rhs)
operator*(const Matrix<T_type, ORDER, L_STYLE>& lhs, const Matrix<T_type, R_ORDER, R_STYLE>& rhs)
operator*(const Matrix<T_type, L_ORDER, L_STYLE>& lhs, const T_type& rhs)
operator*(const Matrix<T_type, ORDER, L_STYLE>& lhs, const T_type& rhs)
operator*(const T_type& lhs, const Matrix<T_type, R_ORDER, R_STYLE>& rhs)
operator*(const T_type& lhs, const Matrix<T_type, ORDER, R_STYLE>& rhs)
Exceptions:
scythe_conformation_error(Level 1)
scythe_alloc_error(Level 1)

References scythe::Matrix_base< ORDER, STYLE >::cols(), scythe::Matrix_base< ORDER, STYLE >::rows(), SCYTHE_CHECK_10, and scythe::Matrix_base< ORDER, STYLE >::size().