DynamicMatrix (with compile time arithmetic)¶
Defined in matrix.hpp
.
-
template<
typename PlusOp,
typename ProdOp,
typename ZeroOp,
typename OneOp,
typename Scalar
>
class DynamicMatrix final¶ This is a class for matrices where the arithmetic operations in the underlying semiring are known at compile time, and the dimensions of the matrix can be set at run time.
- Template Parameters
PlusOp – a stateless type with a call operator of signature
scalar_type operator()(scalar_type, scalar_type)
implementing the addition of the semiringProdOp – a stateless type with a call operator of signature
scalar_type operator()(scalar_type, scalar_type)
implementing the multiplication of the semiringZeroOp – a stateless type with a call operator of signature
scalar_type operator()()
returning the zero of the semiring (the additive identity element)OneOp – a stateless type with a call operator of signature
scalar_type operator()()
returning the one of the semiring (the multiplicative identity element)Scalar – the type of the entries in the matrices (the type of elements in the underlying semiring)
Note
Certain member functions only work for square matrices and some only work for rows.
Member types¶
Member type |
Definition |
---|---|
the type of scalars contained in the matrix ( |
|
the type of references to scalars contained in the matrix |
|
the type of const references to scalars contained in the matrix |
|
type of a row of the matrix |
|
type of a row view int the matrix |
|
the template parameter |
|
the template parameter |
|
the template parameter |
|
the template parameter |
|
|
Member functions¶
constructs the matrix |
|
the number of rows/columns in the matrix |
Static member functions¶
constructs a matrix and checks that its entries are valid |
|
constructs an identity matrix |
Iterators¶
returns an iterator to the beginning |
|
returns an iterator to the end |
|
returns the coordinates corresponding to an iterator |
Accessors¶
access specified element |
|
access specified row |
|
add all rows to a container |
Arithmetic operators¶
add a (matrix, scalar, or row view) to the matrix in place |
|
multiply the matrix by a matrix or scalar in place |
|
add a (matrix, scalar, or row view) to the matrix |
|
multiply the matrix by a matrix or scalar |
Comparison operators¶
compare matrices |
|
compare matrices |
|
compare matrices |
|
compare matrices |
Modifiers¶
swaps the contents |
|
transposes the matrix |