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.

See also

BMat8::one.

Complexity

Constant.

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.

Throws

(None) – This function is noexcept and is guaranteed never to throw.

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 number_of_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.

Complexity

Constant.

Parameters

x – the BMat8 whose number of columns we want.

Throws

(None) – This function is noexcept and is guaranteed never to throw.

Returns

A size_t.

static inline size_t col_space_size(BMat8 const &x)

Find the size of the column space of x.

Complexity

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

Parameters

x – a BMat8.

Throws

(None) – This function guarantees not to throw a LibsemigroupsException.

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.

Complexity

Constant.

Parameters

x – a BMat8.

Throws

(None) – This function is noexcept and is guaranteed never to throw.