33#ifndef MATRIXREFINEMENT1_H_
34#define MATRIXREFINEMENT1_H_
36#include <permlib/predicate/pointwise_stabilizer_predicate.h>
37#include <permlib/search/partition/refinement.h>
47template<
class PERM,
class MATRIX>
58 const MATRIX& m_matrix;
59 std::vector<std::list<unsigned long> > m_diagonalPartition;
62template<
class PERM,
class MATRIX>
68template<
class PERM,
class MATRIX>
75 unsigned long cell = *cellPairIt;
78 unsigned long diagIndex = *cellPairIt;
79 if (pi.
intersect(m_diagonalPartition[diagIndex].begin(), m_diagonalPartition[diagIndex].end(), cell))
89template<
class PERM,
class MATRIX>
91 m_diagonalPartition.resize(m_matrix.k());
92 for (
unsigned long i = 0; i < m_matrix.dimension(); ++i) {
93 m_diagonalPartition[m_matrix.at(i,i)].push_back(i);
96 bool foundIntersection =
false;
97 for (
unsigned int c = 0; c < pi.
cells(); ++c) {
99 for (
unsigned long i = 0; i < m_diagonalPartition.size(); ++i) {
100 if (pi.
intersect(m_diagonalPartition[i].begin(), m_diagonalPartition[i].end(), c)) {
102 foundIntersection =
true;
107 if (foundIntersection) {
virtual unsigned int apply(Partition &pi) const
applies (left-)refinement to pi which is the original partition this refinement was initialized to
Definition matrix_refinement1.h:69
virtual bool init(Partition &pi)
initializes refinement
Definition matrix_refinement1.h:90
MatrixRefinement1(unsigned long n, const MATRIX &matrix)
constructor
Definition matrix_refinement1.h:63
partition
Definition partition.h:48
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
std::vector< RefinementPtr > m_backtrackRefinements
refinement siblings in the search tree
Definition refinement.h:105
bool initialized() const
true iff refinement is initalized
Definition refinement.h:145
Refinement(unsigned long n, RefinementType type)
constructor
Definition refinement.h:117
std::list< int > m_cellPairs
indices of elementary intersections to apply during refinement application
Definition refinement.h:107