Number Theory Utils 0.2.0
|
A polynomial with signed integer coefficients. More...
#include <polynomial.h>
Data Fields | |
uint64_t | len |
Length of the polynomial. | |
uint64_t | cap |
Maximum length polynomial the coeffs buffer can currently store. | |
int64_t * | coeffs |
Array of coefficients. | |
A polynomial with signed integer coefficients.
Uses a dense representation, ideal for low degree polynomials and polynomials with almost no zero coefficients. The coefficient array goes from lowest power to highest power (constant term up). For the zero polynomial, len should be 1 and the constant coefficient should be 0. For all other polynomials, len should be 1 greater than the degree of the polynomial. In particular, the coefficient on the highest term should not be 0 (nut_Poly_normalize
).
Definition at line 26 of file polynomial.h.
uint64_t nut_Poly::len |
Length of the polynomial.
1 greater than the degree for nonzero polynomials, 1 for the zero polynomial.
Definition at line 29 of file polynomial.h.
uint64_t nut_Poly::cap |
Maximum length polynomial the coeffs buffer can currently store.
Definition at line 31 of file polynomial.h.
int64_t* nut_Poly::coeffs |
Array of coefficients.
Should be managed by nut_Poly_init
, nut_Poly_destroy
, and nut_Poly_ensure_cap
.
Definition at line 34 of file polynomial.h.