angel
mercurial changeset: <a href="http://mercurial.mcs.anl.gov/ad/RoseFE_angel/rev/b18cec041a55" target="_parent">b18cec041a55</a>
|
Elimination history. More...
#include <eliminations.hpp>
Public Types | |
typedef Ad_graph_t | ad_graph_t |
typedef El_spec_t | el_spec_t |
Public Member Functions | |
elimination_history_t () | |
Default constructor. More... | |
elimination_history_t (const Ad_graph_t &_cg) | |
Constructor with empty sequence. More... | |
elimination_history_t (const Ad_graph_t &_og, const vector< El_spec_t > &_seq, const Ad_graph_t &_cg, int _ccosts=0) | |
Constructor. More... | |
elimination_history_t (const Ad_graph_t &_og, const vector< El_spec_t > &_seq) | |
Constructor. More... | |
elimination_history_t (const elimination_history_t &eh) | |
Copy constructor. More... | |
elimination_history_t & | operator= (const elimination_history_t &eh) |
Assign operator. More... | |
void | swap (elimination_history_t &eh) |
Swap. More... | |
int | elimination (El_spec_t el) |
Eliminate el from cg. More... | |
bool | check_sequence () const |
Checks if og –seq–> cg. More... | |
bool | check () const |
Checks if og –seq–> cg and consistency of both graphs. More... | |
bool | rebuild_graph () |
Rebuild cg from og and seq. More... | |
template<typename Heuristic_t > | |
void | complete_sequence (Heuristic_t h) |
Complete sequence by heuristic h . More... | |
Public Attributes | |
const Ad_graph_t | og |
The original graph. More... | |
vector< El_spec_t > | seq |
Elimination sequence. More... | |
Ad_graph_t | cg |
Current graph. More... | |
int | ccosts |
Current costs (og -> cg) More... | |
Elimination history.
Stores a c- or line graph and an elimination sequence, where the application of the sequence to the original graph shall result in this graph. This class is introduced to use vertex, edge, and face elimination in LSA (see sa.hpp).
Definition at line 587 of file eliminations.hpp.
typedef Ad_graph_t angel::elimination_history_t< Ad_graph_t, El_spec_t >::ad_graph_t |
Definition at line 596 of file eliminations.hpp.
typedef El_spec_t angel::elimination_history_t< Ad_graph_t, El_spec_t >::el_spec_t |
Definition at line 597 of file eliminations.hpp.
|
inline |
Default constructor.
Only for completeness, better not use.
Definition at line 603 of file eliminations.hpp.
|
inline |
Constructor with empty sequence.
_cg | Graph, which is copied into og and cg |
Definition at line 608 of file eliminations.hpp.
References angel::elimination_history_t< Ad_graph_t, El_spec_t >::check(), and THROW_EXCEPT_MACRO.
|
inline |
Constructor.
_og | Original line graph |
_seq | Elimination sequence |
_cg | Current line graph |
_ccosts | Current costs In debug mode it is checked if application of _seq to _og yields _cg |
Definition at line 619 of file eliminations.hpp.
References angel::elimination_history_t< Ad_graph_t, El_spec_t >::check(), and THROW_EXCEPT_MACRO.
|
inline |
Constructor.
_og | Original line graph |
_seq | Elimination sequence |
Current line graph _cg
is built by application of _seq
to _og
Definition at line 630 of file eliminations.hpp.
References angel::elimination_history_t< Ad_graph_t, El_spec_t >::og, angel::elimination_history_t< Ad_graph_t, El_spec_t >::rebuild_graph(), and THROW_EXCEPT_MACRO.
|
inline |
Copy constructor.
Definition at line 638 of file eliminations.hpp.
References angel::elimination_history_t< Ad_graph_t, El_spec_t >::cg, angel::elimination_history_t< Ad_graph_t, El_spec_t >::check_sequence(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::og, and THROW_EXCEPT_MACRO.
|
inline |
Checks if og –seq–> cg and consistency of both graphs.
Definition at line 708 of file eliminations.hpp.
References angel::elimination_history_t< Ad_graph_t, El_spec_t >::cg, angel::elimination_history_t< Ad_graph_t, El_spec_t >::check_sequence(), and angel::elimination_history_t< Ad_graph_t, El_spec_t >::og.
Referenced by angel::elimination_history_t< Ad_graph_t, El_spec_t >::elimination_history_t(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::operator=(), and angel::elimination_history_t< Ad_graph_t, El_spec_t >::swap().
|
inline |
Checks if og –seq–> cg.
Definition at line 674 of file eliminations.hpp.
References angel::elimination_history_t< Ad_graph_t, El_spec_t >::ccosts, angel::elimination_history_t< Ad_graph_t, El_spec_t >::cg, angel::eliminate(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::og, angel::elimination_history_t< Ad_graph_t, El_spec_t >::seq, angel::write_graph(), and angel::write_vector().
Referenced by angel::elimination_history_t< Ad_graph_t, El_spec_t >::check(), and angel::elimination_history_t< Ad_graph_t, El_spec_t >::elimination_history_t().
|
inline |
Complete sequence by heuristic h
.
In SA applications h
must be the same heuristic used cost operator (ANGEL cannot check this).
Definition at line 728 of file eliminations.hpp.
References angel::elimination_history_t< Ad_graph_t, El_spec_t >::cg, angel::eliminatable_objects(), and angel::elimination_history_t< Ad_graph_t, El_spec_t >::elimination().
Referenced by xaifBoosterCrossCountryInterface::compute_elimination_sequence_lsa_face(), and xaifBoosterCrossCountryInterface::compute_elimination_sequence_lsa_vertex().
|
inline |
Eliminate el
from cg.
It calls eliminate_objects (el, cg). The first parameter of eliminate_objects may be a non-const reference, which is for instance useful for triplet_t to return the line graph node inserted or where the absorption took place. The return value of eliminate_objects (el, cg) must be the elimination costs. Costs greater than zero are assumed as successful elimination (trivial eliminations are not considered at this point) and el
is appended to seq. If el
is passed as non-const reference its value after the elimination is appended.
Definition at line 668 of file eliminations.hpp.
References angel::elimination_history_t< Ad_graph_t, El_spec_t >::ccosts, angel::elimination_history_t< Ad_graph_t, El_spec_t >::cg, angel::eliminate(), and angel::elimination_history_t< Ad_graph_t, El_spec_t >::seq.
Referenced by angel::elimination_history_t< Ad_graph_t, El_spec_t >::complete_sequence(), angel::neighbor_last_removable_t::operator()(), angel::neighbor_multi_step_t::operator()(), angel::neighbor_sequence_check_t::operator()(), and angel::neighbor_check_meta_t::operator()().
|
inline |
Assign operator.
Definition at line 646 of file eliminations.hpp.
References angel::elimination_history_t< Ad_graph_t, El_spec_t >::ccosts, angel::elimination_history_t< Ad_graph_t, El_spec_t >::cg, angel::elimination_history_t< Ad_graph_t, El_spec_t >::check(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::og, angel::elimination_history_t< Ad_graph_t, El_spec_t >::seq, and THROW_DEBUG_EXCEPT_MACRO.
|
inline |
Rebuild cg from og and seq.
Definition at line 714 of file eliminations.hpp.
References angel::elimination_history_t< Ad_graph_t, El_spec_t >::ccosts, angel::elimination_history_t< Ad_graph_t, El_spec_t >::cg, angel::eliminate(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::og, and angel::elimination_history_t< Ad_graph_t, El_spec_t >::seq.
Referenced by angel::elimination_history_t< Ad_graph_t, El_spec_t >::elimination_history_t(), angel::neighbor_last_removable_t::operator()(), angel::neighbor_multi_step_t::operator()(), angel::neighbor_sequence_check_t::operator()(), and angel::neighbor_check_meta_t::operator()().
|
inline |
Swap.
Definition at line 652 of file eliminations.hpp.
References angel::elimination_history_t< Ad_graph_t, El_spec_t >::ccosts, angel::elimination_history_t< Ad_graph_t, El_spec_t >::cg, angel::elimination_history_t< Ad_graph_t, El_spec_t >::check(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::og, angel::elimination_history_t< Ad_graph_t, El_spec_t >::seq, and THROW_DEBUG_EXCEPT_MACRO.
int angel::elimination_history_t< Ad_graph_t, El_spec_t >::ccosts |
Current costs (og -> cg)
Definition at line 594 of file eliminations.hpp.
Referenced by angel::elimination_history_t< Ad_graph_t, El_spec_t >::check_sequence(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::elimination(), angel::SA_elimination_cost_t< Heuristic_t >::operator()(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::operator=(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::rebuild_graph(), and angel::elimination_history_t< Ad_graph_t, El_spec_t >::swap().
Ad_graph_t angel::elimination_history_t< Ad_graph_t, El_spec_t >::cg |
Current graph.
Definition at line 593 of file eliminations.hpp.
Referenced by angel::elimination_history_t< Ad_graph_t, El_spec_t >::check(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::check_sequence(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::complete_sequence(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::elimination(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::elimination_history_t(), angel::SA_elimination_cost_t< Heuristic_t >::operator()(), angel::neighbor_last_removable_t::operator()(), angel::neighbor_multi_step_t::operator()(), angel::neighbor_sequence_check_t::operator()(), angel::neighbor_check_meta_t::operator()(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::operator=(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::rebuild_graph(), and angel::elimination_history_t< Ad_graph_t, El_spec_t >::swap().
const Ad_graph_t angel::elimination_history_t< Ad_graph_t, El_spec_t >::og |
The original graph.
Definition at line 591 of file eliminations.hpp.
Referenced by angel::elimination_history_t< Ad_graph_t, El_spec_t >::check(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::check_sequence(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::elimination_history_t(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::operator=(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::rebuild_graph(), and angel::elimination_history_t< Ad_graph_t, El_spec_t >::swap().
vector<El_spec_t> angel::elimination_history_t< Ad_graph_t, El_spec_t >::seq |
Elimination sequence.
Definition at line 592 of file eliminations.hpp.
Referenced by angel::elimination_history_t< Ad_graph_t, El_spec_t >::check_sequence(), xaifBoosterCrossCountryInterface::compute_elimination_sequence_lsa_face(), xaifBoosterCrossCountryInterface::compute_elimination_sequence_lsa_vertex(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::elimination(), angel::neighbor_last_removable_t::operator()(), angel::neighbor_multi_step_t::operator()(), angel::neighbor_sequence_check_t::operator()(), angel::neighbor_check_meta_t::operator()(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::operator=(), angel::elimination_history_t< Ad_graph_t, El_spec_t >::rebuild_graph(), and angel::elimination_history_t< Ad_graph_t, El_spec_t >::swap().