33 #ifndef SETIMAGEREFINEMENT_H_ 34 #define SETIMAGEREFINEMENT_H_ 36 #include <permlib/predicate/pointwise_stabilizer_predicate.h> 38 #include <permlib/search/partition/partition.h> 39 #include <permlib/search/partition/refinement.h> 42 #include <boost/dynamic_bitset.hpp> 43 #include <boost/foreach.hpp> 61 template<
class InputIterator>
62 SetImageRefinement(
unsigned long n, InputIterator begin, InputIterator end, InputIterator beginImg, InputIterator endImg);
69 std::vector<unsigned long> delta;
70 std::vector<unsigned long> gamma;
74 template<
class InputIterator>
76 :
Refinement<PERM>(n, Default), delta(begin, end), gamma(beginImg, endImg)
78 std::sort(delta.begin(), delta.end());
79 std::sort(gamma.begin(), gamma.end());
84 BOOST_ASSERT( this->initialized() );
87 PERMLIB_DEBUG(std::cout <<
"apply set image1 " << cell << std::endl;)
88 if (pi.
intersect(delta.begin(), delta.end(), cell))
96 BOOST_ASSERT( this->initialized() );
99 PERMLIB_DEBUG(std::cout <<
"apply set image2 " << cell << std::endl;)
100 if (pi.
intersect(gamma.begin(), gamma.end(), cell))
108 for (
unsigned int c = 0; c < pi.
cells(); ++c) {
109 if (pi.
intersect(delta.begin(), delta.end(), c))
123 #endif // -- SETIMAGEREFINEMENT_H_ Definition: set_image_refinement.h:51
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: set_image_refinement.h:95
base class for a -refinement which is used in an R-base and bound to an initial partition ...
Definition: refinement.h:53
partition
Definition: partition.h:48
virtual unsigned int apply(Partition &pi) const
applies (left-)refinement to pi which is the original partition this refinement was initialized to ...
Definition: set_image_refinement.h:83
unsigned long cells() const
number of cells in this partition
Definition: partition.h:157
bool intersect(ForwardIterator begin, ForwardIterator end, unsigned int j)
intersects the j-th cell of this partition with a given set
Definition: partition.h:186
SetImageRefinement(unsigned long n, InputIterator begin, InputIterator end, InputIterator beginImg, InputIterator endImg)
constructor
Definition: set_image_refinement.h:75
virtual bool init(Partition &pi)
initializes refinement
Definition: set_image_refinement.h:107
Definition: abstract_bsgs.h:49