DynamicRowView

Defined in matrix.hpp.

This is a class for views into a row of a matrix over a semirings. 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 usual vector operations are defined for row views.

There are two types of DynamicMatrix and two types of DynamicRowView also:

  1. those where the arithmetic is defined at compile time;

  2. those where the arithmetic is defined at run time.

From the perspective of using these DynamicRowViews there is no difference in the interface; the distinction is only important if you want to extend the functionality of libsemigroups to further semirings.

Warning

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

template<
typename PlusOp,
typename ProdOp,
typename ZeroOp,
typename OneOp,
typename Scalar
>
class DynamicRowView final

This class is the type of row views into a DynamicMatrix with the same template parameters; see the documentation for DynamicMatrix 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)

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

template<typename Semiring, typename Scalar>
class DynamicRowView final

This class is the type of row views into a DynamicMatrix with the same template parameters; see the documentation for DynamicMatrix for further details.

Warning

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

Template Parameters
  • Semiring – the type of a semiring object which defines the semiring arithmetic (see requirements below).

  • 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