Gröbner basis project
Codebase for research into Gröbner basis computation
indeterminate.hpp
1 #ifndef __INDETERMINATE_HPP_
2 #define __INDETERMINATE_HPP_
3 
4 /*****************************************************************************\
5 * This file is part of DynGB. *
6 * *
7 * DynGB is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * Foobar is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with DynGB. If not, see <http://www.gnu.org/licenses/>. *
19 \*****************************************************************************/
20 
21 #include <iostream>
22 
23 #include "system_constants.hpp"
24 
25 #include "monomial.hpp"
26 #include "polynomial_ring.hpp"
27 
28 class Polynomial_Ring;
29 
64 
65 public:
66 
68 
71  Indeterminate(Polynomial_Ring & P, NVAR_TYPE xi) : R(&P), i(xi) { }
72 
74  Indeterminate(const Indeterminate & other) : R(other.R), i(other.i) { }
75 
76  Indeterminate & operator =(const Indeterminate & other);
77 
79 
81 
84  Polynomial_Ring & base_ring() { return *R; }
85 
87  NVAR_TYPE index_in_ring() { return i; }
88 
90 
92 
95  Monomial operator ^(EXP_TYPE a);
96 
99 
102  Monomial u(t);
103  u.set_exponent(i, u.degree(i) + 1);
104  return u;
105  }
106 
108 
110 
113  friend ostream & operator << (ostream &, Indeterminate &);
114 
116 
117 protected:
118 
122  NVAR_TYPE i;
123 };
124 
125 #endif
void set_exponent(NVAR_TYPE i, DEG_TYPE e)
change th exponent to
Definition: monomial.cpp:78
Polynomial_Ring & base_ring()
the Polynomial_Ring this lives in
friend ostream & operator<<(ostream &, Indeterminate &)
prints this with the appropriate name
NVAR_TYPE i
which indeterminate in R this is
Indeterminate(Polynomial_Ring &P, NVAR_TYPE xi)
this will correspond to the xith indeterminate of P.
Monomial operator*(Indeterminate y)
returns the product of this and y
Implementation of indeterminates, for easier building of polynomials.
Implementation of monomials.
Definition: monomial.hpp:69
Encapsulates information about a polynomial ring for easy access: ground field, number of indetermina...
NVAR_TYPE index_in_ring()
which variable in base_ring() this is
DEG_TYPE degree(NVAR_TYPE i) const
Degree of th variable.
Definition: monomial.cpp:183
Monomial operator^(EXP_TYPE a)
returns this to the ath power
Polynomial_Ring * R
the ring this lives in
Indeterminate(const Indeterminate &other)
copy constructor