DynamicMatrix

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

Default constructors

DynamicMatrix() = default

Default constructor.

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(size_t r, size_t c)

Construct a matrix.

Parameters
  • 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

Example

Mat m(2, 3); // construct a 2 x 3 matrix
DynamicMatrix(std::initializer_list<std::initializer_list<scalar_type>> m)

Construct a matrix.

Parameters

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 number of rows and \(n\) is the number of columns in the matrix being constructed.

Example

Mat m({{1, 1}, {0, 0}});
DynamicMatrix(std::vector<std::vector<scalar_type>> const &m)

Construct a matrix.

Parameters

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 number of rows and \(n\) is the number of columns in the matrix being constructed.

Row constructors

DynamicMatrix(std::initializer_list<scalar_type> c)

Construct a row.

Parameters

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.