Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- toPoly :: (Ring c, Eq c) => Vector c -> Poly c
- constant :: c -> Poly c
- monomial :: Ring c => Natural -> c -> Poly c
- fromPoly :: Poly c -> Vector c
- data Poly c
- evalPoly :: Ring c => Poly c -> c -> c
- removeZeros :: (Ring c, Eq c) => Poly c -> Poly c
- scaleP :: Ring c => c -> Natural -> Poly c -> Poly c
- qr :: (Field c, Eq c) => Poly c -> Poly c -> (Poly c, Poly c)
- eea :: (Field c, Eq c) => Poly c -> Poly c -> (Poly c, Poly c)
- lt :: Poly c -> c
- deg :: Poly c -> Integer
- vec2poly :: (Ring c, Eq c) => PolyVec c size -> Poly c
- poly2vec :: forall c size. (Ring c, KnownNat size) => Poly c -> PolyVec c size
- data PolyVec c (size :: Natural)
- fromPolyVec :: PolyVec c size -> Vector c
- toPolyVec :: forall c size. (Ring c, KnownNat size) => Vector c -> PolyVec c size
- (.*.) :: forall c size. (Field c, KnownNat size) => PolyVec c size -> PolyVec c size -> PolyVec c size
- (./.) :: forall c size. (Field c, KnownNat size) => PolyVec c size -> PolyVec c size -> PolyVec c size
- (.*) :: forall c size. Field c => PolyVec c size -> c -> PolyVec c size
- (*.) :: forall c size. Field c => c -> PolyVec c size -> PolyVec c size
- (.+) :: forall c size. Field c => PolyVec c size -> c -> PolyVec c size
- (+.) :: forall c size. Field c => c -> PolyVec c size -> PolyVec c size
- rewrapPolyVec :: (Vector c -> Vector c) -> PolyVec c size -> PolyVec c size
- castPolyVec :: forall c size size'. (Ring c, KnownNat size, KnownNat size', Eq c) => PolyVec c size -> PolyVec c size'
- evalPolyVec :: Ring c => PolyVec c size -> c -> c
- scalePV :: Ring c => c -> PolyVec c size -> PolyVec c size
- polyVecZero :: forall c n size. (Field c, KnownNat n, KnownNat size, Eq c) => PolyVec c size
- polyVecDiv :: forall c size. (Field c, KnownNat size, Eq c) => PolyVec c size -> PolyVec c size -> PolyVec c size
- polyVecLagrange :: forall c n size. (Field c, Eq c, KnownNat n, KnownNat size) => Natural -> c -> PolyVec c size
- polyVecGrandProduct :: forall c size. (Field c, KnownNat size) => PolyVec c size -> PolyVec c size -> PolyVec c size -> c -> c -> PolyVec c size
- polyVecInLagrangeBasis :: forall c n size. (Field c, Eq c, KnownNat n, KnownNat size) => c -> PolyVec c n -> PolyVec c size
- polyVecConstant :: forall c size. (Ring c, KnownNat size) => c -> PolyVec c size
- polyVecLinear :: forall c size. (Ring c, KnownNat size) => c -> c -> PolyVec c size
- polyVecQuadratic :: forall c size. (Ring c, KnownNat size) => c -> c -> c -> PolyVec c size
- mulVector :: forall a. Field a => Vector a -> Vector a -> Vector a
- mulDft :: forall c. Field c => Integer -> c -> Vector c -> Vector c -> Vector c
- mulKaratsuba :: forall a. Field a => Vector a -> Vector a -> Vector a
- mulPoly :: forall a. Field a => Poly a -> Poly a -> Poly a
- mulPolyKaratsuba :: (Eq a, Field a) => Poly a -> Poly a -> Poly a
- mulPolyDft :: forall a. (Eq a, Field a) => Poly a -> Poly a -> Poly a
- mulPolyNaive :: Field a => Poly a -> Poly a -> Poly a
Documentation
Instances
eea :: (Field c, Eq c) => Poly c -> Poly c -> (Poly c, Poly c) Source #
Extended Euclidean algorithm.
data PolyVec c (size :: Natural) Source #
Instances
fromPolyVec :: PolyVec c size -> Vector c Source #
(.*.) :: forall c size. (Field c, KnownNat size) => PolyVec c size -> PolyVec c size -> PolyVec c size infixl 7 Source #
Multiply the corresponding coefficients of two polynomials.
(./.) :: forall c size. (Field c, KnownNat size) => PolyVec c size -> PolyVec c size -> PolyVec c size infixl 7 Source #
Divide the corresponding coefficients of two polynomials.
(.*) :: forall c size. Field c => PolyVec c size -> c -> PolyVec c size infixl 7 Source #
Multiply every coefficient of the polynomial by a constant.
(*.) :: forall c size. Field c => c -> PolyVec c size -> PolyVec c size infixl 7 Source #
Multiply every coefficient of the polynomial by a constant.
(.+) :: forall c size. Field c => PolyVec c size -> c -> PolyVec c size infixl 6 Source #
Add a constant to every coefficient of the polynomial.
(+.) :: forall c size. Field c => c -> PolyVec c size -> PolyVec c size infixl 6 Source #
Add a constant to every coefficient of the polynomial.
castPolyVec :: forall c size size'. (Ring c, KnownNat size, KnownNat size', Eq c) => PolyVec c size -> PolyVec c size' Source #
evalPolyVec :: Ring c => PolyVec c size -> c -> c Source #
polyVecZero :: forall c n size. (Field c, KnownNat n, KnownNat size, Eq c) => PolyVec c size Source #
polyVecDiv :: forall c size. (Field c, KnownNat size, Eq c) => PolyVec c size -> PolyVec c size -> PolyVec c size Source #
polyVecLagrange :: forall c n size. (Field c, Eq c, KnownNat n, KnownNat size) => Natural -> c -> PolyVec c size Source #
polyVecGrandProduct :: forall c size. (Field c, KnownNat size) => PolyVec c size -> PolyVec c size -> PolyVec c size -> c -> c -> PolyVec c size Source #
polyVecInLagrangeBasis :: forall c n size. (Field c, Eq c, KnownNat n, KnownNat size) => c -> PolyVec c n -> PolyVec c size Source #
polyVecQuadratic :: forall c size. (Ring c, KnownNat size) => c -> c -> c -> PolyVec c size Source #
mulPoly :: forall a. Field a => Poly a -> Poly a -> Poly a Source #
Naive vector multiplication, O(n^2)