Inferno
0.2
|
#include <simple_compare.hpp>
Public Member Functions | |
bool | operator() (TreePtr< Node > x, TreePtr< Node > y) |
Pass in two pointers to nodes, which can point to subtrees. Result is true if they match. O(1) locally. | |
bool | operator() (SequenceInterface &x, SequenceInterface &y) |
Pass in two sequences of pointers to nodes, which can point to subtrees. Result is true if they match. O(n) locally. | |
bool | operator() (CollectionInterface &x, CollectionInterface &y) |
Pass in two collection of pointers to nodes, which can point to subtrees. Result is true if they match. O(n^2) locally. |
A subtree comparison algorithm that only operates on program nodes (not S&R patterns) and therefore can avoid O(n!) algorithms.
Definition at line 11 of file simple_compare.hpp.
Pass in two pointers to nodes, which can point to subtrees. Result is true if they match. O(1) locally.
Definition at line 3 of file simple_compare.cpp.
References ASSERT, ASSERTFAIL, and OOStd::SharedPtr< SUB_BASE, VALUE_INTERFACE, VALUE_TYPE >::get().
bool SimpleCompare::operator() | ( | SequenceInterface & | x, |
SequenceInterface & | y | ||
) |
Pass in two sequences of pointers to nodes, which can point to subtrees. Result is true if they match. O(n) locally.
Definition at line 57 of file simple_compare.cpp.
References OOStd::ContainerInterface< SUB_BASE, VALUE_INTERFACE >::begin(), OOStd::ContainerInterface< SUB_BASE, VALUE_INTERFACE >::end(), and OOStd::ContainerInterface< SUB_BASE, VALUE_INTERFACE >::size().
bool SimpleCompare::operator() | ( | CollectionInterface & | x, |
CollectionInterface & | y | ||
) |
Pass in two collection of pointers to nodes, which can point to subtrees. Result is true if they match. O(n^2) locally.
Definition at line 77 of file simple_compare.cpp.
References ASSERT, OOStd::SimpleAssociativeContainer< SUB_BASE, VALUE_INTERFACE, CONTAINER_IMPL >::erase(), FOREACH, OOStd::SimpleAssociativeContainer< SUB_BASE, VALUE_INTERFACE, CONTAINER_IMPL >::insert(), and OOStd::ContainerInterface< SUB_BASE, VALUE_INTERFACE >::size().