5.15.4. visitor.hpp¶
Full path: graph_canon/visitor/visitor.hpp
-
class
no_result
¶ A helper-class to derive visitors from that do not want to return data.
-
template<typename
State
>
tagged_list<>extract_result
(const State&)¶ - Returns
tagged_list<>()
-
template<typename
-
class
no_instance_data
¶ A helper-class to derive visitors from that do not need extra instance-wide data.
-
template<typename
Config
, typenameTreeNode
>
classInstanceData
¶ -
using
type
= tagged_list<>¶
-
using
-
template<typename
-
class
no_tree_node_data
¶ A helper-class to derive visitors from that do not need extra data in each tree node.
-
template<typename
Config
, typenameTreeNode
>
classTreeNodeData
¶ -
using
type
= tagged_list<>¶
-
using
-
template<typename
-
class
null_visitor
: no_instance_data, no_tree_node_data, no_result¶ A visitor that does nothing. That is, it provides a default implementation for each event.
-
template<typename
Vis
>
conceptVisitor
¶ The central concept for plugins. When writing new plugins it may be useful to derive from
null_visitor
to start with default-implementations of all elements.Notation
-
State
state
¶ A specialization of
canon_state
.
-
TreeNode
t
¶ A specialization of
tree_node
.
-
Perm
aut
¶ A
perm_group::Permutation
.
Associated Types-
template<typename
Config
, typenameTreeNode
>
classVis
::
InstanceData
¶ - Template Parameters
Config – a specialization of
config
.TreeNode – a specialization of
tree_node
.
-
type
type
¶ An alias for either a
tagged_list
or atagged_element
. An object of the this type will be instantiated in eachcanon_state
. If non is needed, you can derive fromno_instance_data
.
-
template<typename
Config
, typenameTreeNode
>
classVis
::
TreeNodeData
¶ -
type
type
¶ An alias for either a
tagged_list
or atagged_element
. An object of the this type will be instantiated in eachtree_node
. If non is needed, you can derive fromno_tree_node_data
.
-
type
-
type
Vis
::
can_select_target_cell
¶ An alias for either
std::true_type
orstd::false_type
to denote whether the visitor want to be the target cell selector. If so, the expressionvis.select_target_cell(state, t)
must be valid, and return a non-negative integer strictly less than \(n\).
-
type
Vis
::
can_explore_tree
¶ An alias for either
std::true_type
orstd::false_type
to denote whether the visitor want to provide the tree traversal algorithm. If so, the expressionvis.explore_tree(state)
must be valid.
Valid ExpressionsTree Node Methods
- Return type: a specialization of either
tagged_list
ortagged_element
.Called: when the complete tree has been explored. - Return type:
void
Called: in the beginning ofcanon_state::report_leaf
.
Canonical Form Methods
- Return type:
void
Called: incanon_state::report_leaf
after a new best leaf has been assigned. A pointer to a previous leaf, if any, is given. - Return type:
void
Called: incanon_state::report_leaf
when the candidate nodet
is worse than the current best leaf. - Return type:
void
Called: incanon_state::prune_canon_leaf
if there is a best leaf, before it is unassigned.
Automorphism Methods
- Return type:
void
Called: incanon_state::prune_canon_leaf
when the candidate leaft
is as good as the current best leaf.
Refinement Methods
- Return type:
RefinementResult
Called: by thecanon_state
through thetree_node
constructor. - Return type:
void
Called: by visitors before the cell starting atrefinee_begin
and ending atrefinee_end
is being split.The partition oft
must be in a valid state when this method is called.Therefiner_begin
may becanon_state::n
or the cell which the calling visitor defines as being responsible for the splits.After this method call thevis.refine_new_cell
method may be invoked with numbers in the rangerefinee_begin
torefinee_end
.A matching call tovis.refine_cell_split_end
with the same arguments must be made before a new cell can be split.This method will not be called before an individualization operation. - Return type:
void
Called: by visitors for each new cell-beginning being created. E.g., for a cell 0 to 10, split into 0 to 2 and 2 to 10, only a call with 2 will be made.The method may only be called between a matching pair ofvis.refine_cell_split_begin
andvis.refine_cell_split_end
, and only with cell beginnings in the range specified by those calls.The partition oft
must be in a valid state when this method is called, and the cell must have been created at this time. That is, aftervis.refine_cell_split_begin
the partition is fully modified (all splits are made), and then all calls tovis.refine_new_cell
is made.Thetype
variable of typestd::size_t
is a visitor-defined number to communicate which kind of split it made.This method will not be called before an individualization operation. - Return type:
bool
Called: by visitors after the cell starting atrefinee_begin
and ending atrefinee_end
was split.The partition oft
must be in a valid state when this method is called.The call must be after a matchingvis.refine_cell_begin
and must be given the same arguments.Returningfalse
means refinement should be aborted and the tree node pruned.This method will not be called before an individualization operation. - Return type:
bool
Called: by visitors, probably mostly Weisfeiler-Leman-style visitors.The partition oft
must be in a valid state when this method is called.Deprecated since version 0.2: This method will be refactored not too far in the future.
- Return type:
bool
Called: by visitors, probably mostly Weisfeiler-Leman-style visitors.The partition oft
must be in a valid state when this method is called.Deprecated since version 0.2: This method will be refactored not too far in the future.
- Return type:
void
Called: by visitors and by thetree_node
constructor when refinement is being aborted.The partition oft
must be in a valid state when this method is called.Deprecated since version 0.2: This method will be refactored not too far in the future.
Node Invariant Methods
- Return type:
void
Called: byinvariant_coordinator::better_invariant
when a visitor reports that it has a better invariant value.
-
State