33#ifndef SIMPLEBASECHANGE_H_
34#define SIMPLEBASECHANGE_H_
36#include <permlib/change/base_change.h>
41template<
class PERM,
class TRANS,
class BASETRANSPOSE>
48 template <
class InputIterator>
49 void change(
BSGS<PERM,TRANS> &bsgs, InputIterator baseBegin, InputIterator baseEnd,
bool skipRedundant =
false)
const;
56template<
class PERM,
class TRANS,
class BASETRANSPOSE>
61template<
class PERM,
class TRANS,
class BASETRANSPOSE>
62template<
class InputIterator>
64 if (baseBegin == baseEnd)
67 const unsigned long origOrder __attribute__((unused)) = bsgs.
order();
70 unsigned int baseTargetPos = 0;
71 while (baseBegin != baseEnd && baseTargetPos < bsgs.
B.size()) {
72 unsigned long alpha = *baseBegin;
73 unsigned long beta = bsgs.
B[baseTargetPos];
74 const bool redundant = skipRedundant && this->
isRedundant(bsgs, baseTargetPos, alpha);
76 if (!redundant && beta != alpha) {
78 for (; pos > baseTargetPos; --pos) {
79 trans.transpose(bsgs, pos-1);
89 while (!skipRedundant && baseBegin != baseEnd) {
90 const unsigned long alpha = *baseBegin;
100 BOOST_ASSERT(origOrder == bsgs.
order());
unsigned int m_statScheierGeneratorsConsidered
nuber of Schreier generators considered in transposition since construction
Definition base_change.h:55
bool isRedundant(const BSGSCore< PERM, TRANS > &bsgs, unsigned int baseTargetPos, unsigned long alpha) const
checks if insertion of a base point at given position is redundant
Definition base_change.h:67
unsigned int m_statTranspositions
nuber of base transpositions needed since construction
Definition base_change.h:52
BaseChange()
constructor
Definition base_change.h:49
void 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 simple_base_change.h:63
SimpleBaseChange(const BSGS< PERM, TRANS > &)
constructor
Definition simple_base_change.h:57
std::vector< dom_int > B
base
Definition bsgs_core.h:55
Represents a base and strong generating set (BSGS)
Definition bsgs.h:89
unsigned int insertRedundantBasePoint(unsigned int beta, unsigned int minPos=0)
inserts a redundant base beta
Definition bsgs.h:422
void stripRedundantBasePoints(int minPos=0)
strips redundant base points from the end to the minPos-th base element
Definition bsgs.h:437
Integer order() const
order of the group
Definition bsgs.h:407