37 #include <boost/shared_ptr.hpp> 39 #include <permlib/search/partition/partition.h> 84 typedef typename boost::shared_ptr<Refinement<PERM> > RefinementPtr;
85 typedef typename std::vector<RefinementPtr>::const_iterator RefinementPtrIterator;
88 RefinementType
type()
const;
113 RefinementType m_type;
118 : m_n(n_), m_initialized(false), m_type(type_)
127 return m_backtrackRefinements.size();
137 if (!m_initialized) {
138 m_initialized =
true;
146 return m_initialized;
151 for (
unsigned int i=0; i<count; ++i)
157 return this->apply(pi);
163 #endif // -- REFINEMENT_H_ bool initializeAndApply(Partition &pi)
applies (left-)refinement to partition and initializes refinement for future use in R-base ...
Definition: refinement.h:136
std::vector< RefinementPtr > m_backtrackRefinements
refinement siblings in the search tree
Definition: refinement.h:105
virtual unsigned int apply2(Partition &pi, const PERM &t) const
applies (right-)refinement to pi which is the image of the original partition this refinement was ini...
Definition: refinement.h:156
virtual bool init(Partition &pi)=0
initializes refinement
bool initialized() const
true iff refinement is initalized
Definition: refinement.h:145
RefinementPtrIterator backtrackBegin() const
iterator to begin of refinement siblings in the search tree
Definition: refinement.h:92
base class for a -refinement which is used in an R-base and bound to an initial partition ...
Definition: refinement.h:53
virtual void sort(const BaseSorterByReference &, const Partition *)
sorts siblings in the search tree
Definition: refinement.h:100
partition
Definition: partition.h:48
A sorter that sorts a sequence (e.g. ) with respect to a given input ordering (e.g. a base)
Definition: base_sorter.h:113
unsigned long m_n
length of partitions to work with
Definition: refinement.h:103
unsigned int alternatives() const
number of sibling of this refinement in the search tree
Definition: refinement.h:126
Refinement(unsigned long n, RefinementType type)
constructor
Definition: refinement.h:117
virtual unsigned int apply(Partition &pi) const =0
applies (left-)refinement to pi which is the original partition this refinement was initialized to ...
RefinementPtrIterator backtrackEnd() const
iterator to end of refinement siblings in the search tree
Definition: refinement.h:94
RefinementType type() const
the type of this refinement
Definition: refinement.h:131
virtual ~Refinement()
destructor
Definition: refinement.h:122
bool undoIntersection()
reverts the last intersection if there is one
Definition: partition.h:277
void undo(Partition &pi, unsigned int count) const
reverts the last count elementary intersections of partition pi
Definition: refinement.h:150
std::list< int > m_cellPairs
indices of elementary intersections to apply during refinement application
Definition: refinement.h:107
Definition: abstract_bsgs.h:49