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

Implementation of indeterminates, for easier building of polynomials. More...

#include <indeterminate.hpp>

Public Member Functions

Construction
 Indeterminate (Polynomial_Ring &P, NVAR_TYPE xi)
 this will correspond to the xith indeterminate of P.
 
 Indeterminate (const Indeterminate &other)
 copy constructor
 
Indeterminateoperator= (const Indeterminate &other)
 
Basic properties
Polynomial_Ringbase_ring ()
 the Polynomial_Ring this lives in
 
NVAR_TYPE index_in_ring ()
 which variable in base_ring() this is
 
Computation
Monomial operator^ (EXP_TYPE a)
 returns this to the ath power
 
Monomial operator* (Indeterminate y)
 returns the product of this and y
 
Monomial operator* (Monomial t)
 returns the product of this and t
 

Protected Attributes

NVAR_TYPE i
 which indeterminate in R this is
 
Polynomial_RingR
 the ring this lives in
 

Friends

I/O
ostream & operator<< (ostream &, Indeterminate &)
 prints this with the appropriate name
 

Detailed Description

Implementation of indeterminates, for easier building of polynomials.

Author
John Perry
Date
2016

The main purpose of this class is to help make it easier to build polynomials. It is not especially useful otherwise, and is highly efficient. However, it makes the following possible:

string var_names [] = { "x", "y" };
P = Polynomial_Ring(2, F, var_names);
Monomial x3y = (x^3) * (x*y);

…and the result should be \(x^3y\). Alternately, you could do:

Indeterminate * X = P.indeterminates();
Monomial x3y = (X[0]^3) * (X[0]*X[1]);
free(X);

…with the same result. Just be careful in the second case to destroy the evidence.

Examples:
test_monomials.cpp.

Definition at line 46 of file indeterminate.hpp.


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