33 #ifndef CONJUGATINGBASECHANGE_H_ 34 #define CONJUGATINGBASECHANGE_H_ 36 #include <boost/foreach.hpp> 37 #include <boost/scoped_ptr.hpp> 38 #include <boost/cstdint.hpp> 40 #include <permlib/change/base_change.h> 47 template<
class PERM,
class TRANS>
51 template<
class PERM,
class TRANS,
class BASETRANSPOSE>
58 template <
class InputIterator>
59 unsigned int change(
BSGS<PERM,TRANS> &bsgs, InputIterator baseBegin, InputIterator baseEnd,
bool skipRedundant =
false)
const;
62 template <
class InputIterator>
63 unsigned int change(
SymmetricGroup<PERM> &bsgs, InputIterator baseBegin, InputIterator baseEnd,
bool skipRedundant =
false)
const;
66 template<
class PERM,
class TRANS,
class BASETRANSPOSE>
71 template<
class PERM,
class TRANS,
class BASETRANSPOSE>
72 template<
class InputIterator>
74 if (baseBegin == baseEnd)
77 const boost::uint64_t origOrder __attribute__((unused)) = bsgs.
order();
82 bool touchedC =
false;
84 unsigned int baseTargetPos = 0;
85 while (baseBegin != baseEnd && baseTargetPos < bsgs.
B.size()) {
86 const unsigned long alpha = cInv.at(*baseBegin);
87 const unsigned long beta = bsgs.
B[baseTargetPos];
88 const bool redundant = skipRedundant && this->isRedundant(bsgs, baseTargetPos, alpha);
90 if (!redundant && beta != alpha) {
91 boost::scoped_ptr<PERM> r(bsgs.
U[baseTargetPos].at(alpha));
98 for (; pos > baseTargetPos; --pos) {
99 trans.transpose(bsgs, pos-1);
110 while (!skipRedundant && baseBegin != baseEnd) {
111 const unsigned long alpha = cInv.at(*baseBegin);
120 BOOST_FOREACH(
typename PERM::ptr& g, bsgs.
S) {
127 BOOST_FOREACH(dom_int& beta, bsgs.
B) {
137 for (
unsigned int i=0; i<bsgs.
U.size(); ++i) {
138 bsgs.
U[i].permute(c, cInv);
142 BOOST_ASSERT(bsgs.
B.size() == bsgs.
U.size());
143 BOOST_ASSERT(origOrder == bsgs.
order());
145 return baseTargetPos;
148 template<
class PERM,
class TRANS,
class BASETRANSPOSE>
149 template<
class InputIterator>
151 unsigned int basePos = 0;
152 while (baseBegin != baseEnd) {
154 for (
unsigned int i = basePos; i < bsgs.
B.size(); ++i) {
155 if (bsgs.
B[i] == *baseBegin) {
156 std::swap(bsgs.
B[i], bsgs.
B[basePos]);
169 #endif // -- CONJUGATINGBASECHANGE_H_ dom_int n
degree of group
Definition: bsgs_core.h:61
unsigned int insertRedundantBasePoint(unsigned int beta, unsigned int minPos=0)
inserts a redundant base beta
Definition: bsgs.h:421
abstract base class for base change algorithms
Definition: base_change.h:46
base change by conjugation and, if necessary, transpositions
Definition: conjugating_base_change.h:52
core data of a base and strong generating set (BSGS)
Definition: bsgs_core.h:42
representation of a symmetric group
Definition: conjugating_base_change.h:45
Integer order() const
order of the group
Definition: bsgs.h:406
void stripRedundantBasePoints(int minPos=0)
strips redundant base points from the end to the minPos-th base element
Definition: bsgs.h:436
std::vector< dom_int > B
base
Definition: bsgs_core.h:55
unsigned int change(BSGS< PERM, TRANS > &bsgs, InputIterator baseBegin, InputIterator baseEnd, bool skipRedundant=false) const
changes base of bsgs so that it starts with the sequence given by baseBegin to baseEnd ...
Definition: conjugating_base_change.h:73
ConjugatingBaseChange(const BSGSCore< PERM, TRANS > &)
constructor
Definition: conjugating_base_change.h:67
unsigned int m_statScheierGeneratorsConsidered
nuber of Schreier generators considered in transposition since construction
Definition: base_change.h:55
Represents a base and strong generating set (BSGS)
Definition: bsgs.h:58
std::vector< TRANS > U
transversals along the stabilizer chain
Definition: bsgs_core.h:59
PERMlist S
strong generating set
Definition: bsgs_core.h:57
Definition: abstract_bsgs.h:49