BMat8 helpers

Defined in bmat8.hpp.

This page contains the documentation for various helper functions for libsemigroups::BMat8, and HPCombi::BMat8.

namespace libsemigroups::bmat8_helpers

Defined in bmat8.hpp.

This namespace contains various helper functions for the class BMat8. These functions could be member functions of BMat8 but they only use public member functions of BMat8, and so they are declared as free functions instead.

Functions

template<typename T>
T one(size_t dim) noexcept

Returns the identity boolean matrix of a given dimension.

Exceptions

This function is noexcept and is guaranteed never to throw.

Complexity

Constant.

See

BMat8::one.

Template Parameters

T – the type of the boolean matrix being constructed, should be BMat8 or HPCombi::BMat8.

Parameters

dim – the dimension of the identity matrix, must be at most 7.

Returns

A value of type T with the first dim values on the main diagonal equal to 1 and every other entry equal to 0.

static inline size_t nr_cols(BMat8 const &x) noexcept

Returns the number of non-zero columns in x.

BMat8s do not know their “dimension” - in effect they are all of dimension 8. However, this member function can be used to obtain the number of non-zero rows of this.

Exceptions

This function is noexcept and is guaranteed never to throw.

Complexity

Constant.

See

BMat8::nr_rows and bmat8_helpers::minimum_dim.

Parameters

x – the BMat8 whose number of columns we want.

Returns

A size_t.

static inline size_t col_space_size(BMat8 const &x)

Find the size of the column space of x.

Exceptions

This function guarantees not to throw a LibsemigroupsException.

Complexity

\(O(n)\) where \(n\) is the return value of this function.

See

BMat8::row_space_size.

Parameters

x – a BMat8.

Returns

A size_t.

size_t minimum_dim(BMat8 const &x) noexcept

Find the minimum dimension of x.

This member function returns the maximal i such that row i or column i contains a 1.

Exceptions

This function is noexcept and is guaranteed never to throw.

Complexity

Constant.

Parameters

x – a BMat8.