A univariate polynomial represented by its values on {domain_start, domain_start + 1,..., domain_end - 1}. For memory efficiency purposes, we store the evaluations in an array starting from 0 and make the mapping to the right domain under the hood.
More...
|
|
| Univariate (std::array< Fr, LENGTH > evaluations) |
| |
|
| Univariate (const Univariate &other)=default |
| |
|
| Univariate (Univariate &&other) noexcept=default |
| |
|
Univariate & | operator= (const Univariate &other)=default |
| |
|
Univariate & | operator= (Univariate &&other) noexcept=default |
| |
|
| Univariate (Fr value) |
| |
|
| Univariate (UnivariateView< Fr, domain_end, domain_start > in) |
| |
|
Fr & | value_at (size_t i) |
| |
|
const Fr & | value_at (size_t i) const |
| |
|
size_t | size () |
| |
|
std::vector< uint8_t > | to_buffer () const |
| |
|
bool | operator== (const Univariate &other) const =default |
| |
|
Univariate & | operator+= (const Univariate &other) |
| |
|
Univariate & | operator-= (const Univariate &other) |
| |
|
Univariate & | operator*= (const Univariate &other) |
| |
|
Univariate | operator+ (const Univariate &other) const |
| |
|
Univariate | operator- (const Univariate &other) const |
| |
|
Univariate | operator- () const |
| |
|
Univariate | operator* (const Univariate &other) const |
| |
|
Univariate & | operator+= (const Fr &scalar) |
| |
|
Univariate & | operator-= (const Fr &scalar) |
| |
|
Univariate & | operator*= (const Fr &scalar) |
| |
|
Univariate | operator+ (const Fr &scalar) const |
| |
|
Univariate | operator- (const Fr &scalar) const |
| |
|
Univariate | operator* (const Fr &scalar) const |
| |
|
Univariate & | operator+= (const UnivariateView< Fr, domain_end, domain_start > &view) |
| |
|
Univariate & | operator-= (const UnivariateView< Fr, domain_end, domain_start > &view) |
| |
|
Univariate & | operator*= (const UnivariateView< Fr, domain_end, domain_start > &view) |
| |
|
Univariate | operator+ (const UnivariateView< Fr, domain_end, domain_start > &view) const |
| |
|
Univariate | operator- (const UnivariateView< Fr, domain_end, domain_start > &view) const |
| |
|
Univariate | operator* (const UnivariateView< Fr, domain_end, domain_start > &view) const |
| |
| template<size_t EXTENDED_DOMAIN_END> |
| Univariate< Fr, EXTENDED_DOMAIN_END > | extend_to () const |
| | Given a univariate f represented by {f(domain_start), ..., f(domain_end - 1)}, compute the evaluations {f(domain_end),..., f(extended_domain_end -1)} and return the Univariate represented by {f(domain_start),..., f(extended_domain_end -1)}.
|
| |
| Fr | evaluate (const Fr &u) |
| | Evaluate a univariate at a point u not known at compile time and assumed not to be in the domain (else we divide by zero).
|
| |
template<class
Fr, size_t domain_end, size_t domain_start = 0>
class barretenberg::Univariate< Fr, domain_end, domain_start >
A univariate polynomial represented by its values on {domain_start, domain_start + 1,..., domain_end - 1}. For memory efficiency purposes, we store the evaluations in an array starting from 0 and make the mapping to the right domain under the hood.
template<class
Fr , size_t domain_end, size_t domain_start = 0>
template<size_t EXTENDED_DOMAIN_END>
Given a univariate f represented by {f(domain_start), ..., f(domain_end - 1)}, compute the evaluations {f(domain_end),..., f(extended_domain_end -1)} and return the Univariate represented by {f(domain_start),..., f(extended_domain_end -1)}.
Write v_i = f(x_i) on a the domain {x_{domain_start}, ..., x_{domain_end-1}}. To efficiently compute the needed values of f, we use the barycentric formula
- f(x) = B(x) Σ_{i=domain_start}^{domain_end-1} v_i / (d_i*(x-x_i)) where
- B(x) = Π_{i=domain_start}^{domain_end-1} (x-x_i)
- d_i = Π_{j ∈ {domain_start, ..., domain_end-1}, j≠i} (x_i-x_j) for i ∈ {domain_start, ..., domain_end-1}
When the domain size is two, extending f = v0(1-X) + v1X to a new value involves just one addition and a subtraction: setting Δ = v1-v0, the values of f(X) are f(0)=v0, f(1)= v0 + Δ, v2 = f(1) + Δ, v3 = f(2) + Δ...