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_rows
and \(m\) isDynamicMatrix::number_of_cols
-
void product_inplace(DynamicMatrix const &A, DynamicMatrix const &B)¶
Multiplies
A
andB
and stores the result inthis
.Redefines
this
to be the product ofA
andB
. 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_rows
orDynamicMatrix::number_of_cols
Warning
This function only applies to matrices with the same number of rows and columns.