GiNaCRA  0.6.4
SpecialQuotientRingMultiplicationTable.h
Go to the documentation of this file.
00001 /*
00002  * GiNaCRA - GiNaC Real Algebra package
00003  * Copyright (C) 2010-2012  Ulrich Loup, Joachim Redies, Sebastian Junges
00004  *
00005  * This file is part of GiNaCRA.
00006  *
00007  * GiNaCRA is free software: you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation, either version 3 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * GiNaCRA is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with GiNaCRA.  If not, see <http://www.gnu.org/licenses/>.
00019  *
00020  */
00021 
00022 
00023 #ifndef GINACRA_QUOTIENTRINGMULTIPLICATIONTABLE_H
00024 #define GINACRA_QUOTIENTRINGMULTIPLICATIONTABLE_H
00025 
00026 #include "MultivariatePolynomialFactory.h"
00027 #include "operators.h"
00028 
00029 namespace GiNaCRA
00030 {
00057     template<class monomialOrdering>
00058     class SpecialQuotientRingMultiplicationTable
00059     {
00060         public:
00061 
00063             // Con- and destructors //
00065 
00071             SpecialQuotientRingMultiplicationTable<monomialOrdering>( list<MultivariatePolynomial<monomialOrdering> > gb ) throw ( invalid_argument );
00072 
00077             SpecialQuotientRingMultiplicationTable<monomialOrdering>( MultivariatePolynomial<monomialOrdering> p );
00078 
00080             // Selectors //
00082 
00087             const list<MultivariatePolynomial<monomialOrdering> > GroebnerBasis() const;
00088 
00093             const vector<MultivariateTerm<monomialOrdering> > TermsUnderTheStaircase() const;
00094 
00099             inline const int dim() const;
00100 
00104             const list<symbol> Variables() const;
00105 
00107             // Operators //
00109 
00110             // relational operators
00111             const bool operator ==( const SpecialQuotientRingMultiplicationTable<monomialOrdering>& ) const;
00112             const bool operator !=( const SpecialQuotientRingMultiplicationTable<monomialOrdering>& ) const;
00113 
00115             // Operations //
00117 
00124             const MultivariatePolynomial<monomialOrdering> product( const MultivariateTerm<monomialOrdering> m1,
00125                                                                     const MultivariateTerm<monomialOrdering> m2 ) const
00126                     throw ( invalid_argument );
00127 
00134             inline const MultivariatePolynomial<monomialOrdering> product( const int i, const int j ) const throw ( invalid_argument );
00135 
00140             void realRoots() const;
00141 
00146             std::ostream& print( std::ostream& os ) const;
00147 
00148         protected:
00149 
00151             // Operations //
00153 
00158             inline const bool isEqual( const SpecialQuotientRingMultiplicationTable<monomialOrdering>& o ) const;
00159 
00166             inline const MultivariatePolynomial<monomialOrdering> trace( const MultivariatePolynomial<monomialOrdering> p ) const
00167                     throw ( invalid_argument );
00168 
00176             inline const MultivariatePolynomial<monomialOrdering> generalPositionTemplatePowerTrace( const numeric& i,
00177                                                                                                      const unsigned e ) const
00178                     throw ( invalid_argument );
00179 
00180         private:
00181 
00183             // Attributes //
00185 
00186             symbol                                          mInfinitesimal;
00187             list<MultivariatePolynomial<monomialOrdering> > mGroebnerBasis;
00188             MultivariateCoefficient<monomialOrdering>       coefficientLcm;
00189             vector<MultivariateTerm<monomialOrdering> >     mTermsUnderTheStaircase;
00190             list<symbol>                                    mVariables;
00191             // If m_1, ..., m_l are the monomials under the staircase, then m_i * m_j = mMultiplicationTable[ (i,j), 1 ] * m_1 + ... + mMultiplicationTable[ (i,j), l ] * m_l.
00192             map<pair<pair<int, int>, int>, set<ex, ex_is_less>::iterator> mMultiplicationTable;
00193             set<ex, ex_is_less>                                           mProductCoeffs;
00194 
00196             // Auxiliary methods //
00198 
00203             inline void initializeMultiplicationTable();
00204 
00208             inline void initializeBasis();
00209 
00210     };
00211     // class SpecialQuotientRingMultiplicationTable
00212 
00213 #include "SpecialQuotientRingMultiplicationTable.tpp"
00214 
00215 }    // namespace GiNaC
00216 
00217 #endif // GINACRA_QUOTIENTRINGMULTIPLICATIONTABLE_H