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_)
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);
A sorter that sorts a sequence (e.g. ) with respect to a given input ordering (e.g....
Definition base_sorter.h:113
partition
Definition partition.h:48
bool undoIntersection()
reverts the last intersection if there is one
Definition partition.h:277
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
unsigned long m_n
Definition refinement.h:103
std::vector< RefinementPtr > m_backtrackRefinements
Definition refinement.h:105
bool initialized() const
true iff refinement is initalized
Definition refinement.h:145
virtual unsigned int apply(Partition &pi) const =0
applies (left-)refinement to pi which is the original partition this refinement was initialized to
void undo(Partition &pi, unsigned int count) const
reverts the last count elementary intersections of partition pi
Definition refinement.h:150
virtual void sort(const BaseSorterByReference &, const Partition *)
sorts siblings in the search tree
Definition refinement.h:100
virtual ~Refinement()
destructor
Definition refinement.h:122
bool initializeAndApply(Partition &pi)
applies (left-)refinement to partition and initializes refinement for future use in R-base
Definition refinement.h:136
Refinement(unsigned long n, RefinementType type)
constructor
Definition refinement.h:117
std::list< int > m_cellPairs
Definition refinement.h:107
RefinementPtrIterator backtrackEnd() const
iterator to end of refinement siblings in the search tree
Definition refinement.h:94
unsigned int alternatives() const
number of sibling of this refinement in the search tree
Definition refinement.h:126
virtual bool init(Partition &pi)=0
initializes refinement
RefinementType type() const
RefinementPtrIterator backtrackBegin() const
iterator to begin of refinement siblings in the search tree
Definition refinement.h:92