FGLMStrategy.h
Go to the documentation of this file.
//
// FGLMStrategy.h
// PolyBoRi
//
// Created by Michael Brickenstein on 2008-11-13.
// Copyright 2008 The PolyBoRi Team
//
#ifndef fglm_header
#define fglm_header
#include <polybori/BoolePolyRing.h>
#include "groebner_alg.h"
extern "C" {
#include <m4ri/m4ri.h>
}
BEGIN_NAMESPACE_PBORIGB
typedef std::vector<Polynomial> poly_vec;
class FGLMStrategy{
FGLMStrategy(const FGLMStrategy& rhs);
FGLMStrategy& operator=(const FGLMStrategy& rhs);
public:
typedef BoolePolyRing ring_with_ordering_type;
FGLMStrategy(const ring_with_ordering_type& from_ring, const ring_with_ordering_type& to_ring, const PolynomialVector& gb);
PolynomialVector main();
void analyzeGB(const ReductionStrategy& gb);
void setupMultiplicationTables();
void setupStandardMonomialsFromTables();
void writeRowToVariableDivisors(mzd_t* row, Monomial lm);
void testMultiplicationTables();
void transposeMultiplicationTables();
void writeTailToRow(MonomialSet tail, mzd_t* row);
Polynomial rowToPoly(mzd_t* row);
//allocates a window, free it with mzd_free_window
void findVectorInMultTables(mzd_t* dst, Monomial m);
mzd_t* multiplicationTableForVariable(const Variable& v){
return multiplicationTables[ring2Index[v.index()]];
}
~FGLMStrategy(){
for(std::size_t i=0;i<multiplicationTables.size();i++){
mzd_free(multiplicationTables[i]);
}
}
typedef std::vector<idx_type> IndexVector;
private:
bool prot;
Monomial vars;
size_t varietySize;
typedef std::vector<Monomial> MonomialVector;
typedef std::vector<mzd_t*> MatrixVector;
typedef std::vector<Variable> VariableVector;
MonomialSet standardMonomialsFrom;
MonomialVector standardMonomialsFromVector;
MonomialSet leadingTermsFrom;
MonomialSet varsSet;
VariableVector varsVector;
ReductionStrategy gbFrom; //reduced gb
MonomialSet edgesUnitedVerticesFrom;
ring_with_ordering_type from;
ring_with_ordering_type to;
//indices in multiplicationTables correspond to reverse standard BooleSet iteration of standardMonomialsFrom
IndexVector ring2Index;
IndexVector index2Ring;
IndexVector rowStartingWithIndex;
MonomialSet::size_type nVariables;
bool transposed;
std::vector<IndexVector> tableXRowYIsMonomialFromWithIndex;
lm2Index_map_type standardMonomialsFrom2Index;
lm2Index_map_type monomial2MultiplicationMatrix;
lm2Index_map_type monomial2MultiplicationMatrixRowIndex;
MatrixVector multiplicationTables;
bool canAddThisElementLaterToGB(Polynomial p);
PolynomialVector addTheseLater;
IndexVector rowIsStandardMonomialToWithIndex;
Exponent::idx_map_type standardExponentsFrom2Index;
Polynomial reducedNormalFormInFromRing(Polynomial f);
IndexVector rowVectorIsLinearCombinationOfRows(mzd_t* mat, mzd_t* v);
};
END_NAMESPACE_PBORIGB
#endif
polybori::groebner::lm2Index_map_type
Monomial::idx_map_type lm2Index_map_type
Definition: PolyEntryIndices.h:25
polybori::groebner::FGLMStrategy::ring_with_ordering_type
BoolePolyRing ring_with_ordering_type
Definition: FGLMStrategy.h:34
END_NAMESPACE_PBORIGB
#define END_NAMESPACE_PBORIGB
Definition: groebner_defs.h:16
polybori::groebner::FGLMStrategy::~FGLMStrategy
~FGLMStrategy()
Definition: FGLMStrategy.h:52
polybori::BoolePolyRing
This class reinterprets decicion diagram managers as Boolean polynomial rings, adds an ordering and v...
Definition: BoolePolyRing.h:40
BEGIN_NAMESPACE_PBORIGB
#define BEGIN_NAMESPACE_PBORIGB
Definition: groebner_defs.h:15
polybori::groebner::FGLMStrategy::multiplicationTableForVariable
mzd_t * multiplicationTableForVariable(const Variable &v)
Definition: FGLMStrategy.h:49
polybori::BooleVariable::index
idx_type index() const
Get index of the variable.
Definition: BooleVariable.h:74
polybori::BoolePolynomial
This class wraps the underlying decicion diagram type and defines the necessary operations.
Definition: BoolePolynomial.h:85
polybori::BooleExponent::idx_map_type
generate_index_map< self >::type idx_map_type
Type for index maps.
Definition: BooleExponent.h:76
polybori::groebner::FGLMStrategy
Definition: FGLMStrategy.h:23
groebner_alg.h
BoolePolyRing.h
polybori::groebner::PolynomialVector
std::vector< Polynomial > PolynomialVector
Definition: groebner_defs.h:34
polybori::CAuxTypes::size_type
std::size_t size_type
Type for lengths, dimensions, etc.
Definition: pbori_defs.h:219
polybori::BooleSet
Definition: BooleSet.h:57
polybori::groebner::ReductionStrategy
This class defines ReductionStrategy.
Definition: ReductionStrategy.h:34
polybori::BooleMonomial
This class is just a wrapper for using variables from cudd's decicion diagram.
Definition: BooleMonomial.h:50
polybori::groebner::FGLMStrategy::IndexVector
std::vector< idx_type > IndexVector
Definition: FGLMStrategy.h:57
polybori::groebner::poly_vec
std::vector< Polynomial > poly_vec
Definition: FGLMStrategy.h:21
polybori::BooleVariable
This class is just a wrapper for using variables from cudd's decicion diagram.
Definition: BooleVariable.h:39