StaticRowView

Defined in matrix.hpp.

template<
typename PlusOp,
typename ProdOp,
typename ZeroOp,
typename OneOp,
size_t C,
typename Scalar
>
class StaticRowView final

This is a class for views into a row of a matrix over a semiring. An instance of this class provides access to the elements in a row of a matrix and is cheap to create and copy. Addition, scalar multiplication, and other standard vector operations are defined for row views.

This class is the type of row views into a StaticMatrix; see the documentation for StaticMatrix for further details.

warning If the underlying matrix is destroyed, then any row views for that matrix are invalidated.

Template Parameters
  • PlusOp – a stateless type with a call operator of signature scalar_type operator()(scalar_type, scalar_type) implementing the addition of the semiring

  • ProdOp – a stateless type with a call operator of signature scalar_type operator()(scalar_type, scalar_type) implementing the multiplication of the semiring

  • ZeroOp – 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)

  • C – the number of columns of the underlying matrix

  • Scalar – the type of the entries in the matrices (the type of elements in the underlying semiring)

Member types

Member type

Definition

scalar_type

the type of scalars contained in the row (Scalar)

scalar_reference

the type of references to scalars contained in the row

scalar_const_reference

the type of const references to scalars contained in the row

matrix_type

type of the underlying matrix of the row view

Row

type of a row for the row view

iterator

type of iterators to entries in the underlying row

const_iterator

type of iterators to entries in the underlying row

Member functions

(constructor)

constructs the matrix

size

the length of the row (the template parameter C)

Iterators

begin/cbegin

returns an iterator to the beginning

end/cend

returns an iterator to the end

Accessors

operator()

access specified element

operator[]

access specified element

Arithmetic operators

operator+=

add a (matrix, scalar, or row view) to the matrix in place

operator*=

multiply the matrix by a matrix or scalar in place

operator+

add a (matrix, scalar, or row view) to the matrix

operator*

multiply the matrix by a matrix or scalar

Comparison operators

operator==

compare matrices

operator!=

compare matrices

operator<

compare matrices

operator>

compare matrices