|
| UnivariateCoefficientBasis ()=default |
|
| UnivariateCoefficientBasis (const UnivariateCoefficientBasis< Fr, domain_end, true > &other) |
|
| ~UnivariateCoefficientBasis ()=default |
|
| UnivariateCoefficientBasis (const UnivariateCoefficientBasis &other)=default |
|
| UnivariateCoefficientBasis (UnivariateCoefficientBasis &&other) noexcept=default |
|
UnivariateCoefficientBasis & | operator= (const UnivariateCoefficientBasis &other)=default |
|
UnivariateCoefficientBasis & | operator= (UnivariateCoefficientBasis &&other) noexcept=default |
|
template<size_t other_domain_end, bool other_has_a0_plus_a1 = true>
requires (domain_end > other_domain_end) |
| UnivariateCoefficientBasis (const UnivariateCoefficientBasis< Fr, other_domain_end, other_has_a0_plus_a1 > &other) |
|
size_t | size () |
|
bool | is_zero () const |
|
bool | is_zero () const |
|
std::vector< uint8_t > | to_buffer () const |
|
bool | operator== (const UnivariateCoefficientBasis &other) const =default |
|
template<size_t other_domain_end, bool other_has_a0_plus_a1> |
UnivariateCoefficientBasis< Fr, domain_end, false > & | operator+= (const UnivariateCoefficientBasis< Fr, other_domain_end, other_has_a0_plus_a1 > &other) |
|
template<size_t other_domain_end, bool other_has_a0_plus_a1> |
UnivariateCoefficientBasis< Fr, domain_end, false > & | operator-= (const UnivariateCoefficientBasis< Fr, other_domain_end, other_has_a0_plus_a1 > &other) |
|
template<bool other_has_a0_plus_a1>
requires (LENGTH == 2) |
UnivariateCoefficientBasis< Fr, 3, false > | operator* (const UnivariateCoefficientBasis< Fr, domain_end, other_has_a0_plus_a1 > &other) const |
|
template<size_t other_domain_end, bool other_has_a0_plus_a1> |
UnivariateCoefficientBasis< Fr, domain_end, false > | operator+ (const UnivariateCoefficientBasis< Fr, other_domain_end, other_has_a0_plus_a1 > &other) const |
|
template<size_t other_domain_end, bool other_has_a0_plus_a1> |
UnivariateCoefficientBasis< Fr, domain_end, false > | operator- (const UnivariateCoefficientBasis< Fr, other_domain_end, other_has_a0_plus_a1 > &other) const |
|
UnivariateCoefficientBasis< Fr, domain_end, false > | operator- () const |
|
UnivariateCoefficientBasis< Fr, 3, false > | sqr () const |
|
UnivariateCoefficientBasis & | operator+= (const Fr &scalar) |
|
UnivariateCoefficientBasis & | operator-= (const Fr &scalar) |
|
UnivariateCoefficientBasis< Fr, domain_end, false > & | operator*= (const Fr &scalar) |
|
UnivariateCoefficientBasis< Fr, domain_end, false > | operator+ (const Fr &scalar) const |
|
UnivariateCoefficientBasis< Fr, domain_end, false > | operator- (const Fr &scalar) const |
|
UnivariateCoefficientBasis< Fr, domain_end, false > | operator* (const Fr &scalar) const |
|
auto | begin () |
|
auto | begin () const |
|
auto | end () |
|
auto | end () const |
|
template<class
Fr, size_t domain_end, bool has_a0_plus_a1>
class bb::UnivariateCoefficientBasis< Fr, domain_end, has_a0_plus_a1 >
A view of a univariate, also used to truncate univariates.
For optimization purposes, it makes sense to define univariates with large lengths and then reuse only some of the data in those univariates. We do that by taking a view of those elements and then, as needed, using this to populate new containers.
A univariate polynomial represented by its values on {domain_start, domain_start + 1,..., domain_end - 1}. For memory efficiency purposes, we store the coefficients in an array starting from 0 and make the mapping to the right domain under the hood.
We represent a UnivariateCoefficientBasis as a polynomial P(X) = a0 + a1.X + a2.X^2
- Template Parameters
-
has_a0_plus_a1 | This is true if we know the sum of the above coefficients a0 + a1 This is an optimisation to improve the performance of Karatsuba polynomial multiplication, which requires this term. When converting from a degree-1 Monomial in the Lagrange basis, into a UnivariateCoefficientBasis, we can get a0
- a1 for free. i.e. for a Lagrange-basis poly, we have P(X) = v0.L0(X) + v1.L1(X) = v0.(1 - X) + v1.X = v0 + (v1 - v0).X From this we can see that a0 = v0, a1 = v1 - v0 and therefore (a0 + a1) = v1
|
- Note
has_a0_plus_a1
should only be true in the case where LENGTH == 2
as this is the only case where we can acquire this term for free
-
After performing any arithmetic operation on UnivaraiteMonomial, the output will have has_a0_plus_a1 = false
Definition at line 39 of file univariate_coefficient_basis.hpp.