Gröbner basis project
Codebase for research into Gröbner basis computation
indeterminate.cpp
1 #include "indeterminate.hpp"
2 
3 /*****************************************************************************\
4 * This file is part of DynGB. *
5 * *
6 * DynGB is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * Foobar is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with DynGB. If not, see <http://www.gnu.org/licenses/>. *
18 \*****************************************************************************/
19 
20 Indeterminate & Indeterminate::operator=(const Indeterminate & other) {
21  R = other.R; i = other.i;
22  return *this;
23 }
24 
26  EXP_TYPE * A = new EXP_TYPE[R->number_of_variables()] { 0 };
27  A[i] = a;
29  delete [] A;
30  return t;
31 }
32 
35  u.set_exponent(i,1);
36  u.set_exponent(y.i, 1);
37  return u;
38 }
39 
40 ostream & operator << (ostream & os, Indeterminate & x) {
41  os << x.R->name(x.i);
42  return os;
43 }
virtual NVAR_TYPE number_of_variables() const
number of indeterminates (variables) in the ring
void set_exponent(NVAR_TYPE i, DEG_TYPE e)
change th exponent to
Definition: monomial.cpp:78
friend ostream & operator<<(ostream &, Indeterminate &)
prints this with the appropriate name
NVAR_TYPE i
which indeterminate in R this is
virtual const string name(NVAR_TYPE i) const
name of the th indeterminate
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
Monomial operator^(EXP_TYPE a)
returns this to the ath power
Polynomial_Ring * R
the ring this lives in