Skip to content

Commit

Permalink
unexport lagrange (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray authored Aug 20, 2024
1 parent ca5fb4e commit cbaf630
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/poly/poly.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ func PolyMul(a, b PolynomialCoeff) PolynomialCoeff {
return result
}

// LagrangeInterpolate computes the polynomial in coefficient form that passes through the given points.
// lagrangeInterpolate computes the polynomial in coefficient form that passes through the given points.
// It takes two slices of equal length: xVec (x-coordinates) and yVec (y-coordinates).
//
// Note: This will only be used in tests.
func LagrangeInterpolate(xVec, yVec []fr.Element) PolynomialCoeff {
func lagrangeInterpolate(xVec, yVec []fr.Element) PolynomialCoeff {
n := len(xVec)
if n != len(yVec) {
panic("Input vectors must have the same length")
Expand Down
2 changes: 1 addition & 1 deletion internal/poly/poly_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestPolyMul(t *testing.T) {
func TestPolyInterpolate(t *testing.T) {
points := []fr.Element{fr.NewElement(1), fr.NewElement(2), fr.NewElement(3), fr.NewElement(4)}
values := []fr.Element{fr.NewElement(1), fr.NewElement(2), fr.NewElement(3), fr.NewElement(4)}
poly := LagrangeInterpolate(points, values)
poly := lagrangeInterpolate(points, values)
for i, point := range points {
eval := PolyEval(poly, point)
if !eval.Equal(&values[i]) {
Expand Down

0 comments on commit cbaf630

Please sign in to comment.