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
number_of_rows()and \(m\) isnumber_of_cols()
-
void product_inplace(StaticMatrix const &A, StaticMatrix 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
number_of_rows()ornumber_of_cols().
Warning
This function only applies to matrices with the same number of rows and columns.