operator*=¶
-
void operator*=(scalar_type const a)¶
Multiplies every entry of the matrix by a scalar in-place.
- Parameters:
a – the scalar to multiply every entry of
this.- Returns:
(None)
- Throws:
if the implementation of the semiring multiplication throws.
- Complexity:
\(O(mn)\) where \(m\) is
DynamicMatrix::number_of_rowsand \(m\) isDynamicMatrix::number_of_cols
-
void product_inplace(DynamicMatrix const &A, DynamicMatrix const &B)¶
Multiplies
AandBand stores the result inthis.Redefines
thisto be the product ofAandB. This is in-place multiplication to avoid allocation of memory for products which do not need to be stored for future use.- Parameters:
A – the first matrix to multiply
B – the second matrix to multiply
- Returns:
(None)
- Throws:
Throws if the implementation of the semiring plus or product throws or
std::bad_alloc.- Complexity:
\(O(n ^ 3)\) where \(n\) is
DynamicMatrix::number_of_rowsorDynamicMatrix::number_of_cols
Warning
This function only applies to matrices with the same number of rows and columns.