operation

package
v0.0.2-0...-db6250e Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: CC0-1.0, CC0-1.0, CC0-1.0, + 1 more Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

Add returns the sum f + g, where f is the polynomial defined by the parallel slices esf and csf of exponents and coefficients, and similarly g is defined by esg and csg. The sum is returned as two parallel slices of exponents and coefficients.

func Multiply

Multiply returns the product f * g, where f is the polynomial defined by the parallel slices esf and csf of exponents and coefficients, and similarly g is defined by esg and csg. The product is returned as two parallel slices of exponents and coefficients.

func Negate

Negate returns the negation -f, where f is the polynomial defined by the slice cs of coefficients. The coefficients of -f will be returned.

func Power

Power returns f^k. Here f is the polynomial defined by the parallel slices es and cs of exponents and coefficients. The power is returned as two parallel slices of exponents and coefficients.

func PowerInt64

PowerInt64 returns f^k. Here f is the polynomial defined by the parallel slices es and cs of exponents and coefficients. The power is returned as two parallel slices of exponents and coefficients.

func ScalarMultiplyByCoefficient

ScalarMultiplyByCoefficient returns a * f, where a is an element in the coefficient ring and f is the polynomial defined by the parallel slices es and cs of exponents and coefficients. The result is returned as two parallel slices of exponents and coefficients.

func ScalarMultiplyByInteger

ScalarMultiplyByInteger returns n * f, where this is defined to be f + ... + f (n times) if n is positive, -f - ... - f (|n| times) if n is negative, and 0 if n is zero. Here f is the polynomial defined by the parallel slices es and cs of exponents and coefficients. The result is returned as two parallel slices of exponents and coefficients.

func Subtract

Subtract returns the difference f - g, where f is the polynomial defined by the parallel slices esf and csf of exponents and coefficients, and similarly g is defined by esg and csg. The difference is returned as two parallel slices of exponents and coefficients.

func Sum

Sum returns the sum of the polynomials described by the parallel slices Es and Cs, where the i-th entry Es[i] and Cs[i] in each slice are parallel slices describing the exponents and coefficients, respectively, of a polynomial. The sum is returned as two parallel slices of exponents and coefficients. The slices Es and Cs are assumed to be of the same length.

Types

This section is empty.

Jump to

Keyboard shortcuts

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