Gröbner basis project
Codebase for research into Gröbner basis computation
|
quick-’n-dirty Dense_Univariate integer polynomial class More...
#include <dense_univariate_integer_poly.hpp>
Public Member Functions | |
Construction | |
Dense_Univariate_Integer_Polynomial (DEG_TYPE) | |
construct with the number of expected terms | |
Dense_Univariate_Integer_Polynomial (const Dense_Univariate_Integer_Polynomial &) | |
copy constructor | |
Dense_Univariate_Integer_Polynomial (DEG_TYPE, int64_t *) | |
from serialized data | |
Destruction | |
~Dense_Univariate_Integer_Polynomial () | |
Modification | |
void | expand_poly (DEG_TYPE) |
expand to allow for higher-degree monomials More... | |
void | set_coefficient (DEG_TYPE k, COEF_TYPE a) |
set the coefficient of \(x^k\) to \(\frac{a}{b}\) | |
void | scale_by (COEF_TYPE a) |
multiplies every monomial by a constant | |
void | multiply_by_monomial_of_degree (DEG_TYPE) |
a hopefully efficient multiplication algorithm More... | |
void | multiply_by (const Dense_Univariate_Integer_Polynomial &) |
highly inefficient polynomial multiplication ( \(O(mn)\)) | |
void | negate () |
negates the coefficients | |
void | add (const Dense_Univariate_Integer_Polynomial &q) |
reasonably efficient, given our dense representation | |
Dense_Univariate_Integer_Polynomial & | operator+= (const Dense_Univariate_Integer_Polynomial &q) |
Computation | |
Dense_Univariate_Integer_Polynomial | operator- (const Dense_Univariate_Integer_Polynomial &) const |
returns the result of subtracting the other from this | |
Basic properties | |
COEF_TYPE | coeff (DEG_TYPE k) const |
the \(k\)th coefficient | |
COEF_TYPE | operator[] (DEG_TYPE k) const |
synonym for coeff(k) | |
DEG_TYPE | degree () const |
the polynomial’s degree (exponent of largest nonzero term) | |
bool | is_zero () const |
returns True if and only if every valid coefficient is zero | |
const COEF_TYPE * | coefficient_array () |
all the coefficients | |
Protected Attributes | |
COEF_TYPE * | coeffs |
list of numerators; index 0 is the constant’s | |
DEG_TYPE | deg |
degree of the polynomial (largest nonzero exponent) | |
DEG_TYPE | size |
number of slots for coefficients | |
Friends | |
I/O | |
ostream & | operator<< (ostream &os, const Dense_Univariate_Integer_Polynomial &p) |
quick-’n-dirty Dense_Univariate integer polynomial class
deg
smaller than size
, as deg
indexes the monomial of largest degree, which can be at most size - 1
. Definition at line 20 of file dense_univariate_integer_poly.hpp.
void Dense_Univariate_Integer_Polynomial::expand_poly | ( | DEG_TYPE | n | ) |
expand to allow for higher-degree monomials
Do this at the beginning of any computation that could expand the size of the polynomial.
Definition at line 38 of file dense_univariate_integer_poly.cpp.
void Dense_Univariate_Integer_Polynomial::multiply_by_monomial_of_degree | ( | DEG_TYPE | k | ) |
a hopefully efficient multiplication algorithm
Moves exponents from higher degrees to even higher degrees, freeing up space for smaller exponents.
Definition at line 67 of file dense_univariate_integer_poly.cpp.
|
inline |
Definition at line 66 of file dense_univariate_integer_poly.hpp.