PolyBoRi
LiteralFactorization.h
Go to the documentation of this file.
00001 /*
00002  *  LiteralFactorization.h
00003  *  PolyBoRi
00004  *
00005  *  Created by Michael Brickenstein on 29.05.06.
00006  *  Copyright 2006 The PolyBoRi Team. See LICENSE file.
00007  *
00008  */
00009 
00010 #include <algorithm>
00011 #include <vector>
00012 #include <map>
00013 #include <set>
00014 #include <utility>
00015 #include "groebner_defs.h"
00016 
00017 #ifndef PBORI_GB_LF_H
00018 #define PBORI_GB_LF_H
00019 BEGIN_NAMESPACE_PBORIGB
00020 
00021 std::vector<Polynomial> easy_linear_factors(const Polynomial &p);
00022 
00023 class LiteralFactorizationIterator;  // forward declaration
00024 class LiteralFactorization{
00025 
00026 public:
00027   typedef LiteralFactorizationIterator const_iterator;
00028   LiteralFactorization(const Polynomial&);
00029 
00030   typedef std::map<idx_type, int> map_type;
00031   map_type factors;
00032   Polynomial rest;
00033   deg_type lmDeg;
00034   bool occursAsLeadOfFactor(idx_type v) const;
00035   bool trivial() const;
00036   bool is11Factorization() const;
00037   bool is00Factorization() const;
00038   //Theorem: f BoolePolynomial with factor (x+b), b in 0, 1 (considered in the usual Polynomial Ring)
00039   //then f/(x+b) does not involve the variable x
00040   //typedef std::pair<idx_type,idx_type> var_pair_type;
00041   //typedef std::set<var_pair_type> two_var_factors;
00042   typedef std::map<idx_type, idx_type> var2var_map_type;
00043   var2var_map_type var2var_map;
00044 
00045   const_iterator begin();
00046   const_iterator end();
00047 };
00048 
00049 deg_type common_literal_factors_deg(const LiteralFactorization& a, const LiteralFactorization& b);
00050 
00051 Polynomial 
00052 multiply_with_literal_factors(const LiteralFactorization& lf, Polynomial p);
00053 
00054 END_NAMESPACE_PBORIGB
00055 #endif