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.

Complexity

At worst linear in degree().

Parameters

that – a Blocks instance

Throws

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

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

Complexity

Linear in degree().

Parameters

that – a Blocks instance

Throws

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

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.

Complexity

At worst linear in degree().

Parameters

that – a Blocks instance

Throws

(None) – This function only throws if std::vector<uint32_t>::operator== does.

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.

Complexity

Constant.

Parameters

i – the point.

Throws

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

Returns

A value const reference to a value of type uint32_t.