polynomials

command
v2.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 11 Imported by: 0

README

ICICLE example: Polynomials in Golang

ICICLE provides Golang bindings to CUDA-accelerated C++ implementation of Polynomials.

Usage

Backend Initialization
InitPolyBackend()
Construction
poly1 := CreateFromCoeffecitients(/* Coefficients of polynomial */ coeffs)
poly2 := CreateFromROUEvaluations(/* evaluations */ evals)
poly3 := Clone(/* polynomial to clone */ poly1)
Arithmetic
polyAdd := poly1.Add(&poly2)
polySub := poly1.Subtract(&poly2)
polyMul := poly1.Multiply(&poly2)
polyMulScalar := MultiplyByScalar(scalar)
quotient, remainder := poly1.Divide(&poly2)
Evaluation
ev := poly1.Eval(scalar)
ev2 := poly1.EvalOnDomain(scalars)

In this example we use BN254 and Babybear fields. The examples shows arithmetic operations and evaluations execution.

What's in the example

  1. Define the size of polynomials.
  2. Initialize backends.
  3. Generate random polynomials.
  4. Execute arithmetic operations.
  5. Execute evaluations.
  6. Execute slicing.

Running the example:

go run main.go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL