Gröbner basis project
Codebase for research into Gröbner basis computation
polynomial_ring.hpp
1 #ifndef __POLYNOMIAL_RING_H_
2 #define __POLYNOMIAL_RING_H_
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 
30 #include <string>
31 
32 using std::string;
33 
34 #include "system_constants.hpp"
35 
36 #include "fields.hpp"
37 
38 #include "indeterminate.hpp"
39 
40 class Indeterminate;
41 
43 public:
45 
56  NVAR_TYPE num_vars, Prime_Field & field, string * var_names = nullptr
57  );
59 
60 
64 
65 
77  bool set_names(string * new_names, NVAR_TYPE length);
79 
80 
82  virtual NVAR_TYPE number_of_variables() const;
84  virtual Indeterminate * indeterminates();
86  virtual Prime_Field & ground_field() const;
88  virtual const string name(NVAR_TYPE i) const;
90  virtual const string * name_list() const { return names; }
92 protected:
102  NVAR_TYPE n;
104  string * names;
105 };
106 
107 #endif
Polynomial_Ring(NVAR_TYPE num_vars, Prime_Field &field, string *var_names=nullptr)
Initialize the ring for the given field and number of indeterminates.
virtual Prime_Field & ground_field() const
ground field
~Polynomial_Ring()
Deletes the names.
Prime_Field & F
the ring&#39;s ground field
virtual NVAR_TYPE number_of_variables() const
number of indeterminates (variables) in the ring
Information necessary for a field modulo a prime.
Definition: fields.hpp:49
bool set_names(string *new_names, NVAR_TYPE length)
sets the names of the indeterminates, if you do not want the default
virtual Indeterminate * indeterminates()
an array of the ring’s indeterminates; use only to biuld polynomials
virtual const string name(NVAR_TYPE i) const
name of the th indeterminate
Implementation of indeterminates, for easier building of polynomials.
Encapsulates information about a polynomial ring for easy access: ground field, number of indetermina...
virtual const string * name_list() const
names of all the variabiles
string * names
optional names for the variables
NVAR_TYPE n
the number of indeterminates for every monomial in the ring