DynamicMatrix

This page contains information about the constructors for the DynamicMatrix() class.

Default constructors

DynamicMatrix() = delete

The default constructor for this variant of DynamicMatrix is deleted because a valid pointer to a semiring object is required to define the arithmetic at runtime.

DynamicMatrix(DynamicMatrix const&) = default

Default copy constructor.

DynamicMatrix(DynamicMatrix&&) = default

Default move constructor.

DynamicMatrix &operator=(DynamicMatrix const&) = default

Default copy assignment operator.

DynamicMatrix &operator=(DynamicMatrix&&) = default

Default move assignment operator.

Matrix constructors

DynamicMatrix(Semiring const *semiring, size_t r, size_t c)

Construct a matrix over the semiring semiring.

Parameters
  • semiring – a pointer to const semiring object

  • r – the number of rows in the matrix being constructed

  • c – the number of columns in the matrix being constructed

Exceptions

This function guarantees not to throw a LibsemigroupsException.

Complexity

Constant

DynamicMatrix(Semiring const *semiring, std::initializer_list<std::initializer_list<scalar_type>> m)

Construct a matrix over the semiring semiring.

Parameters
  • semiring – a pointer to const semiring object

  • m – the values to be copied into the matrix.

Exceptions

This function guarantees not to throw a LibsemigroupsException.

Complexity

\(O(mn)\) where \(m\) is the template parameter R and \(n\) is the template parameter C.

DynamicMatrix(Semiring const *semiring, std::vector<std::vector<scalar_type>> const &m)

Construct a matrix over the semiring semiring.

Parameters
  • semiring – a pointer to const semiring object

  • m – the values to be copied into the matrix.

Exceptions

This function guarantees not to throw a LibsemigroupsException.

Complexity

\(O(mn)\) where \(m\) is the template parameter R and \(n\) is the template parameter C.

Row constructors

DynamicMatrix(Semiring const *semiring, std::initializer_list<scalar_type> c)

Construct a row over the semiring semiring.

Parameters
  • semiring – a pointer to const semiring object

  • c – the values to be copied into the row.

Exceptions

This function guarantees not to throw a LibsemigroupsException.

Complexity

\(O(n)\) where \(n\) is the size of the row being constructed.

DynamicMatrix(RowView const &rv)

Construct a row from a row view.

Parameters

rv – the row view.

Exceptions

This function guarantees not to throw a LibsemigroupsException.

Complexity

\(O(n)\) where \(n\) is the size of the row being constructed.