1 #ifndef __POLYNOMIAL_GEOBUCKET_H_ 2 #define __POLYNOMIAL_GEOBUCKET_H_ 25 using std::cout;
using std::endl;
26 using std::runtime_error;
29 #include "monomial.hpp" 30 #include "polynomial.hpp" 31 #include "polynomial_array.hpp" 32 #include "polynomial_linked_list.hpp" 33 #include "polynomial_ring.hpp" 37 #define NUM_BUCKETS 32 39 #define BUCKET_SHIFT 2 76 virtual bool fellOff()
const override;
143 virtual void sort_by_order()
override;
150 virtual void set_monomial_ordering(
164 virtual Monomial & leading_monomial()
const override;
183 virtual unsigned length()
const override;
194 virtual bool is_zero()
const override;
218 void recompute_leading_monomial();
239 virtual void add_polynomial_multiple(
283 void print(
unsigned i, ostream & os=cout)
const;
292 virtual void print(ostream & os=cout)
const override;
304 while ((i >>= BUCKET_SHIFT)) { ++result; }
The general class of a polynomial.
Implementation of geobuckets.
virtual bool canMoveLeft() const override
LLPolynomial_Iterator * pi
an iterator for the current bucket
virtual void set_currCoeff(const Prime_Field_Element &a) override
change coefficient in current position
unsigned lglen(unsigned i)
Log-length of , used to select a bucket for a polynomial of length .
Iterator over linked list polynomials.
virtual bool fellOff() const override
const Abstract_Polynomial * p
the polynomial this points to
Polynomial_Linked_List ** buckets
Array of ptrs to linked list polys; most initialized to nullptr.
virtual void restart_iteration() override
This should move the iterator to the leading term.
unsigned bucket_number
the bucket number at which we’re stopped
Polynomials that need arithmetic typically descend from this class.
virtual void moveRight() override
Moves right in the polynomial, to the next smaller monomial.
Implementation of monomials.
Element of a field of prime characteristic.
interface to a monomial ordering
Encapsulates information about a polynomial ring for easy access: ground field, number of indetermina...
virtual void set_currMonomial(const Monomial &t) override
change monomial in current position
A Mutable_Polynomial_Iterator allows one to modify the terms of a polynomial.
virtual const Monomial & currMonomial() const override
Reports the monomial at the current position.
Polynomials represented as a doubly linked list.
Used to iterate through a polynomial.
virtual bool canMoveRight() const override
Can this iterator move right, or would it fall off?
Polynomial_Geobucket * g
to save myself the hassle of static_cast<const Polynomial_Geobucket *>(p) every time I turn around ...
virtual const Prime_Field_Element & currCoeff() const override
Reports the coefficient at the current position.
Iterates through polynomials using a geobucket representation. See Mutable_Polynomial_Iterator for de...
virtual void moveLeft() override
Moves left in the polynomial, to the next larger monomial.