libsemigroups  v3.3.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches

This page contains documentation related to converting a libsemigroups object into WordGraph instances.

Note
The class template WordGraph is used extensively throughout libsemigroups, and many of the main algorithms involve constructing a WordGraph. These WordGraph objects are usually accessed via a member function word_graph or current_word_graph. The `to` function is only for conversion between different types that represent (in some sense at least) equivalent mathematical objects.
See also
The `to` function for an overview of possible conversions between libsemigroups types.

Functions

template<template< typename... > typename Result>
auto to (Forest const &f) -> std::enable_if_t< std::is_same_v< Result< int >, WordGraph< int > >, WordGraph< Forest::node_type > >
 Convert a Forest to a WordGraph.
 
template<template< typename... > typename Result, typename Node>
auto to (WordGraphView< Node > const &view) -> std::enable_if_t< std::is_same_v< Result< Node >, WordGraph< Node > >, WordGraph< Node > >
 Convert a WordGraphView to a WordGraph.
 

Function Documentation

◆ to() [1/2]

template<template< typename... > typename Result>
auto to ( Forest const & f) -> std::enable_if_t< std::is_same_v< Result< int >, WordGraph< int > >, WordGraph< Forest::node_type > >

Defined in to-word-graph.hpp

Despite the hideous signature, this function should be invoked as follows:

auto to(detail::KnuthBendixImpl< Rewriter, ReductionOrder > &kb) -> std::enable_if_t< std::is_same_v< Presentation< typename Result::word_type >, Result >, Result >
No doc.

where f is a Forest object. The returned WordGraph object is isomorphic as a graph to f.

Template Parameters
Resultused for SFINAE should be WordGraph.
Parameters
fthe Forest instance to convert.
Returns
A WordGraph instance isomorphic to f.

◆ to() [2/2]

template<template< typename... > typename Result, typename Node>
auto to ( WordGraphView< Node > const & view) -> std::enable_if_t< std::is_same_v< Result< Node >, WordGraph< Node > >, WordGraph< Node > >

Defined in to-word-graph.hpp

Despite the hideous signature, this function should be invoked as follows:

where view is a WordGraphView object. The returned WordGraph only contains those nodes and edges that are covered by view.

Template Parameters
Resultused for SFINAE. Should be WordGraph.
Parameters
viewthe WordGraphView instance to convert.
Returns
A WordGraph instance isomorphic to the WordGraph covered by the view.
Exceptions
LibsemigroupsExceptionif view is in an invalid state, or if the underlying graph has edges which crossed the boundaries of the view.
See also
WordGraphView::throw_if_invalid_view and WordGraphView::throw_if_any_target_out_of_bounds.