Documentation ¶
Index ¶
- func ChunkOfEqTable(preallocatedEq []fr.Element, chunkID, chunkSize int, qPrime []fr.Element, ...)
- func ClearPool() int
- func CountPool() int
- func DumpLarge(arrs ...MultiLin) int
- func DumpSmall(arrs ...MultiLin) int
- func EvalEq(qPrime, nextQPrime []fr.Element) fr.Element
- func EvalUnivariate(coeffs []fr.Element, x fr.Element) fr.Element
- func GetLagrangePolynomial(domainSize int) [][]fr.Element
- func InterpolateOnRange(values []fr.Element) []fr.Element
- func LagrangeCoefficient(domainSize int) [][]fr.Element
- type MultiLin
- func (bkt MultiLin) Add(left, right MultiLin)
- func (bkt MultiLin) DeepCopy() MultiLin
- func (bkt MultiLin) DeepCopyLarge() MultiLin
- func (bkt MultiLin) Evaluate(coordinates []fr.Element) fr.Element
- func (bkt *MultiLin) Fold(r fr.Element)
- func (bkt *MultiLin) FoldChunk(r fr.Element, start, stop int)
- func (bkt MultiLin) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChunkOfEqTable ¶
func ChunkOfEqTable(preallocatedEq []fr.Element, chunkID, chunkSize int, qPrime []fr.Element, multiplier ...fr.Element)
Computes only a chunk of the eqTable for a given chunkSize and chunkID
func ClearPool ¶
func ClearPool() int
Clear the pool completely, shields against memory leaks Eg: if we forgot to dump a polynomial at some point, this will ensure the value get dumped eventually Returns how many polynomials were cleared that way
func DumpLarge ¶
Dumps a set of polynomials into the pool Returns the number of deallocated large polys
func DumpSmall ¶
Dumps a set of polynomials into the pool Returns the number of deallocated small polys
func EvalEq ¶
EvalEq computes Eq(q1', ... , qn', h1', ... , hn') = Π_1^n Eq(qi', hi') where Eq(x,y) = xy + (1-x)(1-y) = 1 - x - y + xy + xy interpolates
_________________ | | | | 0 | 1 | |_______|_______| y | | | | 1 | 0 | |_______|_______| x
func EvalUnivariate ¶
EvalUnivariate evaluates a polynomial from its coefficients
func GetLagrangePolynomial ¶
GetLagrangePolynomial returns a precalculated array representing the univariate lagrange polynomials on domainSize.
func InterpolateOnRange ¶
InterpolateOnRange performs the interpolation of the given list of elements On the range [0, 1,..., len(values) - 1]
func LagrangeCoefficient ¶
LagrangeCoefficient returns the matrix of Lagrange polynomials for the domain [[0; n - 1]]
Types ¶
type MultiLin ¶
MultiLin tracks the values of a (dense i.e. not sparse) multilinear polynomial
func FoldedEqTable ¶
func FoldedEqTable(preallocated MultiLin, qPrime []fr.Element, multiplier ...fr.Element) (eq MultiLin)
FoldedEqTable ought to start life as a sparse bookkeepingtable depending on 2n variables and containing 2^n ones only to be folded n times according to the values in qPrime. The resulting table will no longer be sparse. Instead we directly compute the folded array of length 2^n containing the values of Eq(q1, ... , qn, *, ... , *) where qPrime = [q1 ... qn].
func (MultiLin) DeepCopy ¶
DeepCopy creates a deep copy of a book-keeping table. Both ultilinear interpolation and sumcheck require folding an underlying array, but folding changes the array. To do both one requires a deep copy of the book-keeping table.
func (MultiLin) DeepCopyLarge ¶
DeepCopy creates a deep copy of a multi-linear table.
func (MultiLin) Evaluate ¶
Evaluate takes a dense book-keeping table, deep copies it, folds it along the variables on which the table depends by substituting the corresponding coordinate from relevantCoordinates. After folding, bkCopy is reduced to a one item slice containing the evaluation of the original bkt at relevantCoordinates. This is returned.