Gröbner basis project
Codebase for research into Gröbner basis computation
Polynomial_Ring Class Reference

Encapsulates information about a polynomial ring for easy access: ground field, number of variables, …. More...

#include <polynomial_ring.hpp>

Public Member Functions

Construction
 Polynomial_Ring (NVAR_TYPE num_vars, Prime_Field &field, string *var_names=nullptr)
 Initialize the ring for the given field and number of variables. More...
 
Destruction
 ~Polynomial_Ring ()
 Deletes the names.
 
Modification
bool set_names (string *new_names, NVAR_TYPE length)
 sets the names of the variables, if you do not want the default More...
 
Basic properties
virtual NVAR_TYPE number_of_variables () const
 number of indeterminates (variables) in the ring
 
virtual Indeterminateindeterminates ()
 an array of the ring’s indeterminates; use only to biuld polynomials
 
virtual Prime_Fieldground_field () const
 ground field
 
virtual const string name (NVAR_TYPE i) const
 name of the \(i\)th variable
 
virtual const string * name_list () const
 names of all the variabiles
 

Protected Attributes

Prime_FieldF
 the ring's ground field
 
NVAR_TYPE n
 the number of variables for every monomial in the ring More...
 
string * names
 optional names for the variables
 

Detailed Description

Encapsulates information about a polynomial ring for easy access: ground field, number of variables, ….

Author
John Perry
Date
2015
Examples:
test_4by4.cpp, test_cyclic4.cpp, test_cyclicn.cpp, and test_monomials.cpp.

Definition at line 25 of file polynomial_ring.hpp.

Constructor & Destructor Documentation

◆ Polynomial_Ring()

Polynomial_Ring::Polynomial_Ring ( NVAR_TYPE  num_vars,
Prime_Field field,
string *  var_names = nullptr 
)

Initialize the ring for the given field and number of variables.

The array of names is copied, so you can reuse or discard the memory as you prefer.

Definition at line 8 of file polynomial_ring.cpp.

Member Function Documentation

◆ set_names()

bool Polynomial_Ring::set_names ( string *  new_names,
NVAR_TYPE  length 
)

sets the names of the variables, if you do not want the default

Returns True if and only if successful. The array is copied, so you can reuse or discard the memory as you prefer.

Warning
If length is not the same as the number of variables, this will fail immediately.

Definition at line 23 of file polynomial_ring.cpp.

Member Data Documentation

◆ n

NVAR_TYPE Polynomial_Ring::n
protected

the number of variables for every monomial in the ring

Warning
The system does not verify that the number of variables in a monomial agrees with the number specified in this ring. This information is easily available through the number_of_variables() command.

Definition at line 77 of file polynomial_ring.hpp.


The documentation for this class was generated from the following files: