Operators

This page contains information about the comparison operators for the Blocks class.

inline bool libsemigroups::Blocks::operator!=(Blocks const &that) const

Compare two blocks objects for inequality.

Two Blocks objects are equal if and only if their underlying signed partitions are equal. It is ok to compare blocks of different degree with this operator.

Exceptions

This function guarantees not to throw a LibsemigroupsException.

Complexity

At worst linear in degree().

Parameters

that – a Blocks instance

Returns

true if this equals that.

bool libsemigroups::Blocks::operator<(Blocks const &that) const

Compare two blocks objects for less.

This operator defines a total order on the set of all Blocks objects (including those of different degree).

Exceptions

This function only throws if std::vector<uint32_t>::operator[] does.

Complexity

Linear in degree().

Parameters

that – a Blocks instance

Returns

true if this is less than that.

bool libsemigroups::Blocks::operator==(Blocks const &that) const

Compare two blocks objects for equality.

Two Blocks objects are equal if and only if their underlying signed partitions are equal. It is ok to compare blocks of different degree with this operator.

Exceptions

This function only throws if std::vector<uint32_t>::operator== does.

Complexity

At worst linear in degree().

Parameters

that – a Blocks instance

Returns

true if this equals that.

inline uint32_t const &libsemigroups::Blocks::operator[](size_t i) const

Returns a const reference to the index of the block containing a point.

Exceptions

This function guarantees not to throw a LibsemigroupsException.

Complexity

Constant.

Parameters

i – the point.

Returns

A value const reference to a value of type uint32_t.