summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiromiIshii <>2017-12-07 06:42:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2017-12-07 06:42:00 (GMT)
commitb7b7e7f22f4764cc6bb3f701a0a12e6b50be25f0 (patch)
treec1345b476865b2a121e90b58b8b62fd957c08b6c
parent6e8dfcee72b4b820ac3f4c20059300ecd1200f24 (diff)
version 0.5.1.0HEAD0.5.1.0master
-rw-r--r--Algebra/Algorithms/Groebner.hs2
-rw-r--r--Algebra/Field/AlgebraicReal.hs19
-rw-r--r--Algebra/Field/Galois/Internal.hs4
-rw-r--r--Algebra/Internal.hs6
-rw-r--r--Algebra/LinkedMatrix.hs39
-rw-r--r--Algebra/Prelude/Core.hs2
-rw-r--r--Algebra/Ring/Ideal.hs1
-rw-r--r--Algebra/Ring/Polynomial/Class.hs1
-rw-r--r--Algebra/Ring/Polynomial/Internal.hs43
-rw-r--r--Algebra/Ring/Polynomial/Labeled.hs19
-rw-r--r--Algebra/Ring/Polynomial/Monomial.hs56
-rw-r--r--Algebra/Ring/Polynomial/Univariate.hs19
-rw-r--r--Algebra/Scalar.hs2
-rw-r--r--computational-algebra.cabal1443
-rw-r--r--examples/hensel-prof.hs20
-rw-r--r--examples/sandpit-poly.hs12
16 files changed, 788 insertions, 900 deletions
diff --git a/Algebra/Algorithms/Groebner.hs b/Algebra/Algorithms/Groebner.hs
index 8222f9f..f8287c6 100644
--- a/Algebra/Algorithms/Groebner.hs
+++ b/Algebra/Algorithms/Groebner.hs
@@ -18,7 +18,7 @@ module Algebra.Algorithms.Groebner
, NormalStrategy(..), SugarStrategy(..), GradedStrategy(..)
-- * Ideal operations
, isIdealMember, intersection, thEliminationIdeal, thEliminationIdealWith
- , unsafeThEliminationIdealWith
+ , unsafeThEliminationIdealWith, eliminatePadding
, quotIdeal, quotByPrincipalIdeal
, saturationIdeal, saturationByPrincipalIdeal
-- * Resultant
diff --git a/Algebra/Field/AlgebraicReal.hs b/Algebra/Field/AlgebraicReal.hs
index bda7c1c..940bc46 100644
--- a/Algebra/Field/AlgebraicReal.hs
+++ b/Algebra/Field/AlgebraicReal.hs
@@ -150,6 +150,8 @@ instance RightModule (Fraction Integer) Algebraic where
instance Multiplicative Algebraic where
(*) = multA
{-# INLINE (*) #-}
+ pow1p a = powA a . succ
+ {-# INLINE pow1p #-}
instance LeftModule (Scalar (Fraction Integer)) Algebraic where
(.*) = multA . Rational . runScalar
@@ -308,10 +310,6 @@ sqFreePart f = f `quot` gcd f (diff 0 f)
minusA (plusA x y) x = y
"plusminus/left" [~1] forall x (y :: Algebraic) .
plusA x (minusA y x) = y
-"plus-zero-left" [~1] forall x.
- plusA 0 x = x
-"plus-zero-right" [~1] forall x.
- plusA x 0 = x
#-}
plusA :: Algebraic -> Algebraic -> Algebraic
@@ -368,11 +366,6 @@ catcher _ _ _ _ = error "rational is impossible"
normalize :: (Eq r, Euclidean r, Division r) => Unipol r -> Unipol r
normalize = monoize . sqFreePart
-shiftP :: (Domain r, Division r, Eq r, Euclidean r)
- => Unipol r -> Unipol r
-shiftP f | isZero (coeff one f) = f `quot` var 0
- | otherwise = f
-
stabilize :: Algebraic -> Algebraic
stabilize r@Rational{} = r
stabilize ar@(Algebraic f ss int)
@@ -525,10 +518,6 @@ multA a b =
int = catcher multInt fg (stabilize a) (stabilize b)
in fromJust $ algebraic fg int
-defEqn :: Algebraic -> Unipol Rational
-defEqn (Rational a) = var 0 - injectCoeff a
-defEqn a@Algebraic{} = eqn a
-
improveNonzero :: Algebraic -> Interval Rational
improveNonzero (Algebraic _ ss int0) = go int0
where
@@ -637,10 +626,6 @@ powA r n | n < 0 = nthRoot' (abs $ fromIntegral n) r
| otherwise = r ^ P.fromIntegral n
{-# INLINE powA #-}
-iterateImprove :: Rational -> Unipol Rational -> Interval Rational -> Interval Rational
-iterateImprove eps f =
- iterateImproveStrum eps (strum f)
-
iterateImproveStrum :: Rational -> [Unipol Rational] -> Interval Rational -> Interval Rational
iterateImproveStrum eps ss int0 =
until (\int -> size int < eps) (improveWith ss) int0
diff --git a/Algebra/Field/Galois/Internal.hs b/Algebra/Field/Galois/Internal.hs
index 4389300..d64ef0c 100644
--- a/Algebra/Field/Galois/Internal.hs
+++ b/Algebra/Field/Galois/Internal.hs
@@ -6,13 +6,13 @@ module Algebra.Field.Galois.Internal
(ConwayPolynomial(..),
Conway,
buildInstance,
- parseLine) where
+ parseLine
+ ) where
import Algebra.Field.Finite
import Algebra.Prelude.Core hiding (lex, lift)
import Algebra.Ring.Polynomial.Univariate (Unipol)
import Data.Char (isDigit)
import Data.Char (digitToInt)
-import qualified Data.Map as M
import Data.Reflection
import qualified GHC.TypeLits as TL
import Language.Haskell.TH
diff --git a/Algebra/Internal.hs b/Algebra/Internal.hs
index 0464e74..2f1a358 100644
--- a/Algebra/Internal.hs
+++ b/Algebra/Internal.hs
@@ -3,7 +3,7 @@
{-# LANGUAGE MultiParamTypeClasses, PatternSynonyms, PolyKinds, RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables, StandaloneDeriving, TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
-{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
+{-# OPTIONS_GHC -Wincomplete-patterns -Wno-orphans #-}
module Algebra.Internal
( (:~:)(..), withRefl,
module Data.Proxy,
@@ -41,6 +41,7 @@ import Data.Type.Equality ((:~:) (..))
import Data.Type.Natural.Class as Algebra.Internal
import qualified Data.Type.Ordinal as O
import qualified Data.Vector as DV
+import Data.ListLike (ListLike)
import GHC.TypeLits as Algebra.Internal
import Proof.Equational (coerce, withRefl)
import Proof.Equational as Algebra.Internal (because,
@@ -64,7 +65,8 @@ coerceLength eql = _Unwrapping Flipped.Flipped %~ coerce eql
type SNat (n :: Nat) = Sing n
-sizedLength f = (S.sLength f)
+sizedLength :: ListLike (f a) a => S.Sized f n a -> Sing n
+sizedLength f = S.sLength f
padVecs :: forall a n m. a -> Sized' n a -> Sized' m a
-> (SNat (Max n m), Sized' (Max n m) a, Sized' (Max n m) a)
diff --git a/Algebra/LinkedMatrix.hs b/Algebra/LinkedMatrix.hs
index 3e0161a..ac87ff4 100644
--- a/Algebra/LinkedMatrix.hs
+++ b/Algebra/LinkedMatrix.hs
@@ -19,7 +19,7 @@ module Algebra.LinkedMatrix (Matrix, toLists, fromLists, fromList,
scaleCol, clearRow, clearCol, index, (!),
nonZeroEntries, rankLM, splitIndependentDirs,
structuredGauss, multWithVector, solveWiedemann,
- henselLift, solveHensel, structuredGauss') where
+ henselLift, solveHensel, structuredGauss', intDet) where
import Algebra.Algorithms.ChineseRemainder
import Algebra.Field.Finite
import Algebra.Instances ()
@@ -587,31 +587,6 @@ structuredGauss' = evalState go . newGaussianState
nonZeroEntries :: Matrix a -> Vector ((Int, Int), a)
nonZeroEntries mat = V.map (view idx &&& view value) $ mat ^. coefficients
-matListView :: (Show a, Monoidal a) => Matrix a -> String
-matListView = unlines . map (('\t':).show) . toLists
-
-prettyMat :: Show a => Matrix a -> String
-prettyMat mat =
- unlines [ "row start: " <> starter Row
- , "col start: " <> starter Column
- , "[" <> (intercalate ", " $ V.toList $ V.imap (\i e -> "(#" <> show i <> ") " <> prettyEntry e) $ mat^.coefficients) <> "]"
- ]
- where
- starter dir = intercalate ", " (map (\(a,b) -> show a ++ " -> " ++ show b) (mat^.startL dir.to IM.toList))
-
-prettyEntry :: Show a => Entry a -> String
-prettyEntry ent =
- concat [ show $ ent^.value, " "
- , show $ ent^.idx
- , "->("
- ,showMaybe (ent^.nextL Row)
- , ", "
- ,showMaybe (ent^.nextL Column)
- , ")"
- ]
- where
- showMaybe = maybe "_" show
-
multWithVector :: (Multiplicative a, Monoidal a)
=> Matrix a -> Vector a -> Vector a
multWithVector mat v =
@@ -627,6 +602,7 @@ nonZeroRows = nonZeroDirs Row
nonZeroCols :: Matrix r -> [Int]
nonZeroCols = nonZeroDirs Column
+{-
testCase :: Matrix (Fraction Integer)
testCase = fromLists [[0,0,0,0,0,0,2,-3,-1,0]
,[0,0,0,2,-3,-1,0,0,0,0]
@@ -635,6 +611,7 @@ testCase = fromLists [[0,0,0,0,0,0,2,-3,-1,0]
,[2,-3,0,-1,0,0,0,0,0,0]
,[1,0,1,0,0,1,0,0,0,-1]
,[1,0,1,0,0,1,-2,0,0,0]]
+-}
newtype Square n r = Square { runSquare :: Matrix r
} deriving (Show, Eq, Additive, Multiplicative)
@@ -839,16 +816,6 @@ triangulateModular mat0 =
((l,m):mn) | i == l -> build (m : ans) (i-1) mn vecs
_ -> build (V.empty : ans) (i-1) mns vecs
-(.!) :: (a -> b) -> (t -> a) -> t -> b
-(f .! g) x = f $! g x
-
-infixr 9 .!
-
-clearDenom :: Euclidean a => Matrix (Fraction a) -> (a, Matrix a)
-clearDenom mat =
- let g = V.foldr' (lcm' . denominator . snd) one $ nonZeroEntries mat
- in (g, cmap (numerator . (* (g % one))) mat)
-
lcm' :: Euclidean r => r -> r -> r
lcm' n m = n * m `quot` gcd n m
diff --git a/Algebra/Prelude/Core.hs b/Algebra/Prelude/Core.hs
index 458d555..1887685 100644
--- a/Algebra/Prelude/Core.hs
+++ b/Algebra/Prelude/Core.hs
@@ -23,8 +23,6 @@ import Data.Type.Ordinal.Builtin (Ordinal, enumOrdinal, od)
n % m = injectCoeff (n / m)
infixl 7 %
-type Rational = Fraction Integer
-
logBase2 :: Int -> Int
logBase2 x = finiteBitSize x - 1 - countLeadingZeros x
{-# INLINE logBase2 #-}
diff --git a/Algebra/Ring/Ideal.hs b/Algebra/Ring/Ideal.hs
index 8fd15de..841d277 100644
--- a/Algebra/Ring/Ideal.hs
+++ b/Algebra/Ring/Ideal.hs
@@ -50,7 +50,6 @@ principalIdeal = Ideal . singleton
mapIdeal :: (r -> r') -> Ideal r -> Ideal r'
mapIdeal fun (Ideal xs) = Ideal $ S.map fun xs
{-# INLINE [1] mapIdeal #-}
-{-# RULES "mapIdeal/id" [~1] forall x. mapIdeal id x = x #-}
instance NFData r => NFData (Ideal r) where
rnf (Ideal is) = rnf is
diff --git a/Algebra/Ring/Polynomial/Class.hs b/Algebra/Ring/Polynomial/Class.hs
index d7e8073..576f388 100644
--- a/Algebra/Ring/Polynomial/Class.hs
+++ b/Algebra/Ring/Polynomial/Class.hs
@@ -201,7 +201,6 @@ class (CoeffRing (Coefficient poly), Eq poly, DecidableZero poly, KnownNat (Arit
{-# RULES
"liftMap/identity" liftMap (\ x -> x) = (P.id :: poly -> poly)
-"liftMap/identity-2" liftMap P.id = (P.id :: poly -> poly)
#-}
-- | Class to lookup ordering from its (type-level) name.
diff --git a/Algebra/Ring/Polynomial/Internal.hs b/Algebra/Ring/Polynomial/Internal.hs
index 87288b7..ef1025b 100644
--- a/Algebra/Ring/Polynomial/Internal.hs
+++ b/Algebra/Ring/Polynomial/Internal.hs
@@ -33,7 +33,6 @@ import AlgebraicPrelude
import Control.DeepSeq (NFData)
import Control.Lens hiding (assign)
import qualified Data.Coerce as C
-import qualified Data.Foldable as F
import qualified Data.HashSet as HS
import Data.Map (Map)
import qualified Data.Map.Strict as M
@@ -93,9 +92,6 @@ instance (KnownNat n, IsMonomialOrder n ord, CoeffRing r) => IsPolynomial (Order
extractPower = runMult . ifoldMap (\ o -> Mult . pow (mor o) . fromIntegral) . getMonomial
{-# INLINE liftMap #-}
-ordVec :: forall n. KnownNat n => Sized n (Ordinal n)
-ordVec = unsafeFromList' $ enumOrdinal (sing :: SNat n)
-
instance (KnownNat n, CoeffRing r, IsMonomialOrder n ord)
=> IsOrderedPolynomial (OrderedPolynomial r ord n) where
-- | coefficient for a degree.
@@ -170,7 +166,7 @@ instance (Eq r) => Eq (OrderedPolynomial r order n) where
-- -- | By Hilbert's finite basis theorem, a polynomial ring over a noetherian ring is also a noetherian ring.
instance (IsMonomialOrder n order, CoeffRing r, KnownNat n) => Ring (OrderedPolynomial r order n) where
fromInteger 0 = Polynomial M.empty
- fromInteger n = Polynomial $ M.singleton one (fromInteger' n)
+ fromInteger n = Polynomial $ M.singleton one (NA.fromInteger n)
{-# INLINE fromInteger #-}
decZero :: DecidableZero r => r -> Maybe r
@@ -239,41 +235,17 @@ instance (KnownNat n, CoeffRing r, IsMonomialOrder n order, PrettyCoeff r)
=> Show (OrderedPolynomial r order n) where
showsPrec = showsPolynomialWith $ generate sing (\i -> "X_" ++ show (fromEnum i))
-showPolynomialWithVars :: (CoeffRing a, Show a, KnownNat n, IsMonomialOrder n ordering)
- => [(Int, String)] -> OrderedPolynomial a ordering n -> String
-showPolynomialWithVars dic p0@(Polynomial d)
- | isZero p0 = "0"
- | otherwise = intercalate " + " $ mapMaybe showTerm $ M.toDescList d
- where
- showTerm (getMonomial -> deg, c)
- | isZero c = Nothing
- | otherwise =
- let cstr = if (not (isZero $ c - one) || isConstantMonomial deg)
- then show c ++ " "
- else if isZero (c - one) then ""
- else if isZero (c + one)
- then if any (not . isZero) (F.toList deg) then "-" else "-1"
- else ""
- in Just $ cstr ++ unwords (mapMaybe showDeg (zip [0..] $ F.toList deg))
- showDeg (n, p) | p == 0 = Nothing
- | p == 1 = Just $ showVar n
- | otherwise = Just $ showVar n ++ "^" ++ show p
- showVar n = fromMaybe ("X_" ++ show n) $ lookup n dic
-
-isConstantMonomial :: Monomial n -> Bool
-isConstantMonomial v = all (== 0) $ F.toList v
-
-- | We provide Num instance to use trivial injection R into R[X].
-- Do not use signum or abs.
instance (IsMonomialOrder n order, CoeffRing r, KnownNat n)
=> P.Num (OrderedPolynomial r order n) where
- (+) = (+)
+ (+) = (NA.+)
{-# INLINE (+) #-}
- (*) = (*)
+ (*) = (NA.*)
{-# INLINE (*) #-}
- fromInteger = normalize . injectCoeff . fromInteger'
+ fromInteger = NA.fromInteger
{-# INLINE fromInteger #-}
signum f = if isZero f then zero else injectCoeff one
@@ -506,6 +478,8 @@ instance (KnownNat n, IsMonomialOrder n ord, IsPolynomial poly,
=> RightModule (Scalar r) (PadPolyL n ord poly) where
PadPolyL f *. r = PadPolyL $ mapCoeff' (*. r) f
{-# INLINE (*.) #-}
+deriving instance (KnownNat n, IsMonomialOrder n ord, IsPolynomial poly)
+ => Num (PadPolyL n ord poly)
instance (KnownNat n, IsMonomialOrder n ord, IsPolynomial poly)
=> IsPolynomial (PadPolyL n ord poly) where
@@ -547,3 +521,8 @@ instance (SingI (Replicate n 1), KnownNat n, IsMonomialOrder n ord, IsOrderedPol
padLeftPoly :: (IsMonomialOrder n ord, IsPolynomial poly)
=> Sing n -> ord -> poly -> PadPolyL n ord poly
padLeftPoly n _ = withKnownNat n $ PadPolyL . injectCoeff
+
+instance (r ~ Coefficient poly, IsPolynomial poly,
+ KnownNat n, CoeffRing r, IsMonomialOrder n order, PrettyCoeff r)
+ => Show (PadPolyL n order poly) where
+ showsPrec = showsPolynomialWith $ generate sing (\i -> "X_" ++ show (fromEnum i))
diff --git a/Algebra/Ring/Polynomial/Labeled.hs b/Algebra/Ring/Polynomial/Labeled.hs
index 649e108..29e173e 100644
--- a/Algebra/Ring/Polynomial/Labeled.hs
+++ b/Algebra/Ring/Polynomial/Labeled.hs
@@ -1,5 +1,6 @@
{-# LANGUAGE CPP, ConstraintKinds, DataKinds, EmptyCase, FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances, GADTs, GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE IncoherentInstances, KindSignatures, MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedLabels, PolyKinds, RankNTypes, ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving, TemplateHaskell, TypeFamilies, TypeInType #-}
@@ -29,6 +30,10 @@ import GHC.Exts (Constraint)
import GHC.OverloadedLabels (IsLabel (..))
import qualified Numeric.Algebra as NA
import qualified Prelude as P
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 802
+import qualified Data.Text as T
+#endif
+
type family UniqueList' (x :: Symbol) (xs :: [Symbol]) :: Constraint where
UniqueList' x '[] = ()
@@ -49,10 +54,17 @@ instance (KnownSymbol symb,
IsPolynomial poly,
Wraps vars poly,
Elem symb vars ~ 'True) => IsLabel symb (LabPolynomial poly vars) where
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 802
+ fromLabel =
+ let vs = map T.unpack $ fromSing (sing :: Sing vars)
+ v = symbolVal @symb Proxy
+ in maybe (error "impossible!") (var . toEnum) $ L.elemIndex v vs
+#else
fromLabel k =
let vs = fromSing (sing :: Sing vars)
v = symbolVal' k
in maybe (error "impossible!") (var . toEnum) $ L.elemIndex v vs
+#endif
data LabPolynomial poly (vars :: [Symbol]) where
LabelPolynomial :: (IsUniqueList vars, Length vars ~ Arity poly)
@@ -74,7 +86,12 @@ instance (PrettyCoeff (Coefficient poly), IsOrderedPolynomial poly, SingI vars)
=> Show (LabPolynomial poly vars) where
showsPrec d (LabelPolynomial f) =
let svs = sing :: Sing vars
- vs = fromSing svs
+ vs =
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 802
+ map T.unpack $
+#endif
+
+ fromSing svs
vsVec = generate sing $ \i -> vs !! fromEnum i
in showsPolynomialWith vsVec d f
diff --git a/Algebra/Ring/Polynomial/Monomial.hs b/Algebra/Ring/Polynomial/Monomial.hs
index d9508f8..75b69c8 100644
--- a/Algebra/Ring/Polynomial/Monomial.hs
+++ b/Algebra/Ring/Polynomial/Monomial.hs
@@ -24,29 +24,27 @@ module Algebra.Ring.Polynomial.Monomial
) where
import Algebra.Internal
-import AlgebraicPrelude hiding (lex)
-import Control.DeepSeq (NFData (..))
-import Control.Lens (Ixed (..), alaf, imap,
- makeLenses, makeWrapped, (%~),
- (&), (.~), _Wrapped)
-import Data.Constraint ((:=>) (..), Dict (..))
-import qualified Data.Constraint as C
+import AlgebraicPrelude hiding (lex)
+import Control.DeepSeq (NFData (..))
+import Control.Lens (Ixed (..), imap, makeLenses,
+ makeWrapped, (%~), (&), (.~),
+ _Wrapped)
+import Data.Constraint ((:=>) (..), Dict (..))
+import qualified Data.Constraint as C
import Data.Constraint.Forall
-import qualified Data.Foldable as F
-import Data.Hashable (Hashable (..))
-import Data.Kind (Type)
-import Data.Maybe (catMaybes)
-import Data.Monoid (Dual (..))
-import Data.Monoid ((<>))
-import qualified Data.MonoTraversable.Unprefixed as MT
-import Data.Ord (comparing)
-import Data.Singletons.Prelude (POrd (..), SList, Sing ())
-import Data.Singletons.Prelude (SingKind (..))
-import Data.Singletons.Prelude.List (Length, Replicate, sReplicate)
-import Data.Singletons.TypeLits (withKnownNat)
-import qualified Data.Sized.Builtin as V
-import Data.Type.Natural.Class (IsPeano (..), PeanoOrder (..))
-import Data.Type.Ordinal (Ordinal (..), ordToInt)
+import qualified Data.Foldable as F
+import Data.Hashable (Hashable (..))
+import Data.Kind (Type)
+import Data.Maybe (catMaybes)
+import Data.Monoid ((<>))
+import Data.Ord (comparing)
+import Data.Singletons.Prelude (POrd (..), SList, Sing ())
+import Data.Singletons.Prelude (SingKind (..))
+import Data.Singletons.Prelude.List (Length, Replicate, sReplicate)
+import Data.Singletons.TypeLits (withKnownNat)
+import qualified Data.Sized.Builtin as V
+import Data.Type.Natural.Class (IsPeano (..), PeanoOrder (..))
+import Data.Type.Ordinal (Ordinal (..), ordToInt)
-- import Prelude hiding (Fractional (..),
-- Integral (..), Num (..),
-- Real (..), lex, product, sum)
@@ -134,20 +132,6 @@ instance KnownNat n => Unital (OrderedMonomial ord n) where
class IsOrder (n :: Nat) (ordering :: *) where
cmpMonomial :: Proxy ordering -> MonomialOrder n
-head' :: (0 :< n) ~ 'True => Sized' n a -> a
-head' = V.head
-{-# INLINE head' #-}
-
--- We know that Monomial ordering coincides on lex ordering
--- on univariate monomials.
-{-# RULES
-"cmpMonomial/unary" [~1]
- forall (pxy :: IsMonomialOrder 1 (o :: *) => Proxy o)
- (xs :: Sized' 1 Int)
- (ys :: Sized' 1 Int).
- cmpMonomial pxy xs ys = comparing head' xs ys
- #-}
-
-- * Names for orderings.
-- We didn't choose to define one single type for ordering names for the extensibility.
-- | Lexicographical order
diff --git a/Algebra/Ring/Polynomial/Univariate.hs b/Algebra/Ring/Polynomial/Univariate.hs
index e3e981a..0366a49 100644
--- a/Algebra/Ring/Polynomial/Univariate.hs
+++ b/Algebra/Ring/Polynomial/Univariate.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE BangPatterns, ConstraintKinds, DataKinds, FlexibleContexts #-}
+{-# LANGUAGE BangPatterns, CPP, ConstraintKinds, DataKinds, FlexibleContexts #-}
{-# LANGUAGE GADTs, GeneralizedNewtypeDeriving, MultiParamTypeClasses #-}
{-# LANGUAGE NoImplicitPrelude, ScopedTypeVariables, StandaloneDeriving #-}
{-# LANGUAGE TypeApplications, TypeFamilies, UndecidableSuperClasses #-}
@@ -28,7 +28,7 @@ import qualified Data.Sized.Builtin as SV
import qualified Numeric.Algebra as NA
import Numeric.Decidable.Zero (DecidableZero (..))
import qualified Prelude as P
-import GHC.OverloadedLabels
+
-- | Univariate polynomial.
-- It uses @'IM.IntMap'@ as its internal representation;
-- so if you want to treat the power greater than @maxBound :: Int@,
@@ -42,10 +42,11 @@ instance Hashable r => Hashable (Unipol r) where
-- | By this instance, you can use @#x@ for
-- the unique variable of @'Unipol' r@.
instance Unital r => IsLabel "x" (Unipol r) where
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 802
+ fromLabel = Unipol $ IM.singleton 1 one
+#else
fromLabel _ = Unipol $ IM.singleton 1 one
-
-normaliseUP :: DecidableZero r => Unipol r -> Unipol r
-normaliseUP (Unipol r) = Unipol $ IM.filter (not . isZero) r
+#endif
divModUnipol :: (CoeffRing r, Field r) => Unipol r -> Unipol r -> (Unipol r, Unipol r)
divModUnipol f g =
@@ -143,9 +144,6 @@ instance CoeffRing r => P.Num (Unipol r) where
then zero
else one
-(%!!) :: Sized (n :: Nat) a -> SV.Ordinal (n :: Nat) -> a
-(%!!) = (SV.%!!)
-
{-# RULES
"var x^n" forall (x :: SV.Ordinal 1) n.
pow (varUnipol x) n = Unipol (IM.singleton (fromEnum n) one)
@@ -156,11 +154,6 @@ instance CoeffRing r => P.Num (Unipol r) where
NA.pow1p (varUnipol x) n = Unipol (IM.singleton (fromEnum n + 1) one)
#-}
-{-# RULES
-"x ^ n" forall (x :: SV.Ordinal 1) n.
- (varUnipol x) ^ n = Unipol (IM.singleton (fromEnum n) one)
- #-}
-
varUnipol :: Unital r => SV.Ordinal 1 -> Unipol r
varUnipol _ = Unipol $ IM.singleton 1 one
{-# NOINLINE CONLIKE [1] varUnipol #-}
diff --git a/Algebra/Scalar.hs b/Algebra/Scalar.hs
index 4e81e4a..74175ca 100644
--- a/Algebra/Scalar.hs
+++ b/Algebra/Scalar.hs
@@ -3,9 +3,7 @@
{-# LANGUAGE StandaloneDeriving #-}
module Algebra.Scalar (Scalar(..), (.*.)) where
import AlgebraicPrelude
-import qualified Data.Coerce as C
import Algebra.Normed
-import Control.Lens
import qualified Prelude as P
-- | @'Scalar' r@ provides almost the same type-instances as @r@,
diff --git a/computational-algebra.cabal b/computational-algebra.cabal
index 7f67eef..50a7e48 100644
--- a/computational-algebra.cabal
+++ b/computational-algebra.cabal
@@ -1,881 +1,854 @@
name: computational-algebra
-version: 0.5.0.0
+version: 0.5.1.0
cabal-version: >=1.10
build-type: Simple
license: BSD3
license-file: LICENSE
-copyright: (C) Hiromi ISHII 2017
+copyright: (C) Hiromi ISHII 2013
maintainer: konn.jinro_at_gmail.com
-homepage: https://github.com/konn/computational-algebra
+homepage: https://konn.github.com/computational-algebra
synopsis: Well-kinded computational algebra library, currently supporting Groebner basis.
-description:
- Dependently-typed computational algebra library for Groebner basis.
+description: Dependently-typed computational algebra library for Groebner basis.
category: Math
author: Hiromi ISHII
-tested-with: GHC ==8.0.1
-extra-source-files:
- README.md
- examples/*.hs
- tests/*.hs
- bench/*.hs
- share/*.hs
- data/conway.txt
+data-dir: ""
+tested-with: GHC == 8.0.2, GHC == 8.2.2
+extra-source-files: README.md examples/*.hs tests/*.hs bench/*.hs
+ share/*.hs data/conway.txt
source-repository head
type: git
location: git://github.com/konn/computational-algebra.git
-
+
flag examples
default: False
+ manual: True
+flag profile
+ manual: True
+ default: False
+
library
- exposed-modules:
- Algebra.Algorithms.ChineseRemainder
- Algebra.Algorithms.Groebner
- Algebra.Algorithms.PrimeTest
- Algebra.Algorithms.ZeroDim
- Algebra.Field.AlgebraicReal
- Algebra.Field.Finite
- Algebra.Field.Galois
- Algebra.Instances
- Algebra.Internal
- Algebra.LinkedMatrix
- Algebra.Matrix
- Algebra.Normed
- Algebra.Prelude
- Algebra.Prelude.Core
- Algebra.Ring.Ideal
- Algebra.Ring.Polynomial
- Algebra.Ring.Polynomial.Class
- Algebra.Ring.Polynomial.Factorise
- Algebra.Ring.Polynomial.Labeled
- Algebra.Ring.Polynomial.Monomial
- Algebra.Ring.Polynomial.Quotient
- Algebra.Ring.Polynomial.Univariate
- Algebra.Scalar
- build-depends:
- template-haskell >=2.11.0.0 && <2.12,
- MonadRandom >=0.1 && <0.5,
- algebraic-prelude ==0.1.*,
- algebra >=4.1 && <4.4,
- base >=4 && <4.10,
- semigroups >=0.15 && <0.19,
- containers ==0.5.*,
- convertible ==1.1.*,
- constraints >=0.3 && <0.9,
- deepseq >=1.3 && <1.5,
- equational-reasoning >=0.4.1.1 && <0.5,
- hashable >=1.1 && <1.3,
- heaps ==0.3.*,
- hmatrix >=0.16 && <0.18,
- matrix ==0.3.*,
- entropy >=0.3.7 && <0.4,
- lens >=4.13 && <4.15,
- monad-loops ==0.4.*,
- dlist >=0.8.0.2 && <0.9,
- monomorphic >=0.0.3 && <0.1,
- mtl >=2.1 && <2.3,
- reflection >=2 && <2.2,
- sized ==0.2.*,
- tagged >=0.7 && <0.9,
- hybrid-vectors >=0.1 && <0.3,
- text >=0.11 && <1.3,
- type-natural >=0.7.1 && <0.8,
- unamb ==0.2.*,
- unordered-containers ==0.2.*,
- vector >=0.10 && <0.12,
- parallel ==3.2.*,
- mono-traversable >=0.10 && <1.1,
- control-monad-loop ==0.1.*,
- primes >=0.2.1 && <0.3,
- singletons ==2.2.*,
- arithmoi >=0.4.3.0 && <0.5,
- ghc-typelits-knownnat >=0.2.2 && <0.3
- default-language: Haskell2010
- default-extensions: CPP DataKinds PolyKinds GADTs
- MultiParamTypeClasses TypeFamilies FlexibleContexts
- FlexibleInstances UndecidableInstances NoImplicitPrelude
- other-modules:
- Algebra.Algorithms.FGLM
- Algebra.Field.Galois.Conway
- Algebra.Field.Galois.Internal
- Algebra.Ring.Polynomial.Internal
- ghc-options: -O2 -Wall -Wno-unused-top-binds -fplugin GHC.TypeLits.KnownNat.Solver
-
+ build-depends: ListLike ==4.5.*,
+ MonadRandom >=0.1 && <0.6,
+ algebra >=4.1 && <4.4,
+ algebraic-prelude >=0.1.1.0 && <0.2,
+ arithmoi >=0.5 && <0.7,
+ base >=4 && <4.11,
+ constraints >=0.3 && <0.10,
+ containers ==0.5.*,
+ control-monad-loop ==0.1.*,
+ convertible ==1.1.*,
+ deepseq >=1.3 && <1.5,
+ dlist >=0.8.0.3 && <0.9,
+ entropy >=0.3.8 && <0.4,
+ equational-reasoning >=0.4.1.1 && <0.6,
+ ghc-typelits-knownnat >=0.3.1 && <0.4,
+ ghc-typelits-natnormalise >=0.5.7 && <0.6,
+ ghc-typelits-presburger >=0.1.1.1 && <0.2,
+ hashable >=1.1 && <1.3,
+ heaps ==0.3.*,
+ hmatrix >=0.16 && <0.19,
+ hybrid-vectors >=0.1 && <0.3,
+ hybrid-vectors >=0.1 && <0.3,
+ integer-logarithms ==1.0.*,
+ lens >=4.13 && <4.16,
+ matrix ==0.3.*,
+ monad-loops ==0.4.*,
+ mono-traversable >=0.10 && <1.1,
+ monomorphic >=0.0.3 && <0.1,
+ mtl >=2.1 && <2.3,
+ parallel ==3.2.*,
+ primes >=0.2.1 && <0.3,
+ reflection >=2 && <2.2,
+ semigroups >=0.15 && <0.19,
+ singletons >=2.2 && <2.4,
+ sized ==0.2.*,
+ tagged >=0.7 && <0.9,
+ template-haskell >=2.12.0.0 && <2.13,
+ text >=0.11 && <1.3,
+ type-natural >=0.7.1 && <0.8,
+ unamb ==0.2.*,
+ unordered-containers ==0.2.*,
+ vector >=0.10 && <0.13,
+ vector-algorithms >=0.7.0.1 && <0.8
+ exposed-modules: Algebra.Algorithms.ChineseRemainder
+ Algebra.Algorithms.Groebner
+ Algebra.Algorithms.PrimeTest
+ Algebra.Algorithms.ZeroDim
+ Algebra.Field.AlgebraicReal
+ Algebra.Field.Finite
+ Algebra.Field.Galois
+ Algebra.Instances
+ Algebra.Internal
+ Algebra.LinkedMatrix
+ Algebra.Matrix
+ Algebra.Normed
+ Algebra.Prelude
+ Algebra.Prelude.Core
+ Algebra.Ring.Ideal
+ Algebra.Ring.Polynomial
+ Algebra.Ring.Polynomial.Class
+ Algebra.Ring.Polynomial.Factorise
+ Algebra.Ring.Polynomial.Labeled
+ Algebra.Ring.Polynomial.Monomial
+ Algebra.Ring.Polynomial.Quotient
+ Algebra.Ring.Polynomial.Univariate
+ Algebra.Scalar
+ exposed: True
+ other-modules: Algebra.Algorithms.FGLM
+ Algebra.Field.Galois.Conway
+ Algebra.Field.Galois.Internal
+ Algebra.Ring.Polynomial.Internal
+ ghc-options: -O2 -Wall -Wno-unused-top-binds
+ -fplugin GHC.TypeLits.KnownNat.Solver
+ default-language: Haskell2010
+ default-extensions: CPP
+ , DataKinds
+ , FlexibleContexts
+ , FlexibleInstances
+ , GADTs
+ , MultiParamTypeClasses
+ , NoImplicitPrelude
+ , OverloadedLabels
+ , PolyKinds
+ , TypeFamilies
+ , UndecidableInstances
+
executable groebner-prof
- main-is: groebner-prof.hs
- buildable: False
- build-depends:
- base >=4.9.0.0 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- deepseq >=1.4.2.0 && <1.5
- default-language: Haskell2010
- extensions: NoImplicitPrelude
- hs-source-dirs: share examples
- ghc-options: -Wall -prof -fprof-auto -threaded -O2
+ hs-source-dirs: share examples
+ Main-is: groebner-prof.hs
+ build-depends: base
+ , computational-algebra
+ , deepseq
+ default-language: Haskell2010
+ ghc-options: -Wall -threaded -O2
+ default-extensions: NoImplicitPrelude
+
+ if flag(profile)
+ ghc-options: -prof -fprof-auto-exported
+ else
+ Buildable: False
executable solve
+ build-depends: MonadRandom
+ , algebra
+ , base
+ , type-natural
+ , computational-algebra
+ , constraints
+ , convertible
+ , hmatrix
+ , lens
+ , matrix
+ , random >=1.0 && <1.2
+ , semigroups
+ , sized
+ , vector
+
main-is: solve.hs
- buildable: False
- build-depends:
- semigroups >=0.15.2 && <0.19,
- constraints >=0.3 && <0.9,
- algebra >=4.1 && <4.4,
- base >=4 && <4.10,
- type-natural >=0.7.1.2 && <0.8,
- computational-algebra >=0.5.0.0 && <0.6,
- random >=1.0 && <1.2,
- hmatrix >=0.17.0.2 && <0.18,
- matrix ==0.3.*,
- sized >=0.2.1.0 && <0.3,
- vector >=0.10 && <0.12,
- convertible ==1.1.*,
- lens >=3.9 && <4.15,
- MonadRandom >=0.1 && <0.5
hs-source-dirs: share examples
ghc-options: -caf-all -auto-all -rtsopts -O2 -threaded
+ default-language: Haskell2010
+
+ if !flag(examples)
+ buildable: False
executable algebraic
- main-is: algebraic.hs
- buildable: False
- build-depends:
- base >=4.9.0.0 && <4.10,
- algebraic-prelude >=0.1.0.1 && <0.2,
- computational-algebra >=0.5.0.0 && <0.6
- default-language: Haskell2010
- hs-source-dirs: examples
- ghc-options: -Wall -O2 -threaded
+ Main-is: algebraic.hs
+ hs-source-dirs: examples
+ build-depends: algebraic-prelude
+ , base
+ , computational-algebra
+ default-language: Haskell2010
+ ghc-options: -Wall -O2 -threaded
+
+ if !flag(examples)
+ buildable: False
+
executable ipsolve
+ build-depends: MonadRandom
+ , algebra
+ , base
+ , computational-algebra
+ , constraints
+ , convertible
+ , equational-reasoning
+ , hmatrix
+ , lens
+ , matrix
+ , parallel
+ , random >=1.0 && <1.2
+ , reflection
+ , semigroups
+ , singletons
+ , sized
+ , type-natural
+ , vector
+
main-is: ipsolve.hs
- buildable: False
- build-depends:
- semigroups >=0.15.2 && <0.19,
- parallel ==3.2.*,
- constraints >=0.3 && <0.9,
- algebra >=4.1 && <4.4,
- equational-reasoning >=0.2 && <0.5,
- reflection >=1.4 && <2.2,
- base >=4 && <4.10,
- type-natural >=0.7.1.2 && <0.8,
- computational-algebra >=0.5.0.0 && <0.6,
- random >=1.0 && <1.2,
- hmatrix >=0.17.0.2 && <0.18,
- matrix ==0.3.*,
- sized >=0.2.1.0 && <0.3,
- vector >=0.10 && <0.12,
- convertible ==1.1.*,
- lens >=3.9 && <4.15,
- MonadRandom >=0.1 && <0.5,
- singletons ==2.2.*
- hs-source-dirs: share examples
- ghc-options: -caf-all -auto-all -rtsopts -O2 -threaded
-
-executable faugere-prof
- main-is: faugere-prof.hs
- buildable: False
- build-depends:
- criterion >=0.8.1.0 && <1.2,
- semigroups >=0.15.2 && <0.19,
- constraints >=0.3 && <0.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- type-natural >=0.7.1.2 && <0.8,
- computational-algebra >=0.5.0.0 && <0.6,
- random >=1.0 && <1.2,
- hmatrix >=0.17.0.2 && <0.18,
- matrix ==0.3.*,
- sized >=0.2.1.0 && <0.3,
- vector >=0.10 && <0.12,
- convertible ==1.1.*,
- lens >=3.9 && <4.15,
- deepseq >=1.3 && <1.5,
- MonadRandom >=0.1 && <0.5
hs-source-dirs: share examples
ghc-options: -caf-all -auto-all -rtsopts -O2 -threaded
+ default-language: Haskell2010
+ if !flag(examples)
+ buildable: False
+
executable hensel-prof
+ build-depends: MonadRandom
+ , algebra
+ , base
+ , computational-algebra
+ , constraints
+ , convertible
+ , criterion >=0.8.1.0 && <1.3
+ , deepseq
+ , hmatrix
+ , lens
+ , matrix
+ , random >=1.0 && <1.2
+ , semigroups
+ , sized
+ , type-natural
+ , vector
+ if flag(profile)
+ ghc-options: -caf-all -auto-all -rtsopts -eventlog
+ else
+ buildable: False
main-is: hensel-prof.hs
- buildable: False
- build-depends:
- criterion >=0.8.1.0 && <1.2,
- semigroups >=0.15.2 && <0.19,
- constraints >=0.3 && <0.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- type-natural >=0.7.1.2 && <0.8,
- computational-algebra >=0.5.0.0 && <0.6,
- random >=1.0 && <1.2,
- hmatrix >=0.17.0.2 && <0.18,
- matrix ==0.3.*,
- sized >=0.2.1.0 && <0.3,
- vector >=0.10 && <0.12,
- convertible ==1.1.*,
- lens >=3.9 && <4.15,
- deepseq >=1.3 && <1.5,
- MonadRandom >=0.1 && <0.5
hs-source-dirs: share examples
- ghc-options: -caf-all -auto-all -rtsopts -O2 -threaded -eventlog
+ ghc-options: -O2 -threaded
+ default-language: Haskell2010
executable sandpit-poly
+ build-depends: algebra
+ , base
+ , computational-algebra
+ , constraints
+ , semigroups
+ , sized
+ , type-natural
+
+ if !flag(examples)
+ buildable: False
main-is: sandpit-poly.hs
- buildable: False
- build-depends:
- semigroups >=0.15.2 && <0.19,
- constraints >=0.3 && <0.9,
- computational-algebra >=0.5.0.0 && <0.6,
- base >=4 && <4.10,
- type-natural >=0.7.1.2 && <0.8,
- algebra ==4.3.*,
- sized >=0.2.1.0 && <0.3
hs-source-dirs: share examples
+ default-language: Haskell2010
executable quotient
+ build-depends: algebra
+ , base
+ , computational-algebra
+ , constraints
+ , reflection
+ , semigroups
+ , sized
+ , type-natural
+
+ if !flag(examples)
+ buildable: False
main-is: quotient.hs
- buildable: False
- build-depends:
- semigroups >=0.15.2 && <0.19,
- constraints >=0.3 && <0.9,
- computational-algebra >=0.5.0.0 && <0.6,
- base >=4 && <4.10,
- type-natural >=0.7.1.2 && <0.8,
- algebra ==4.3.*,
- sized >=0.2.1.0 && <0.3,
- reflection >=2.1.2 && <2.2
hs-source-dirs: share examples
-
+ default-language: Haskell2010
+
test-suite test-multi-table
+ build-depends: HUnit >=1.2.5.2 && <1.7
+ , QuickCheck >=2.6 && <2.11
+ , algebra
+ , base
+ , computational-algebra -any
+ , constraints
+ , containers
+ , equational-reasoning
+ , hspec >=1.9.5 && <2.5
+ , lazysmallcheck ==0.6.*
+ , lens
+ , quickcheck-instances >=0.3.8 && <0.4
+ , reflection
+ , sized
+ , smallcheck >=1.1.1 && <1.2
+ , tagged
+ , test-framework >=0.8.0.3 && <0.9
+ , test-framework-hunit >=0.3.0.1 && <0.4
+ , transformers
+ , type-natural
+ , vector
+
type: exitcode-stdio-1.0
main-is: multi-table.hs
buildable: False
- build-depends:
- constraints >=0.3 && <0.9,
- HUnit >=1.2.5.2 && <1.4,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- hspec >=1.9.5 && <2.3,
- lazysmallcheck ==0.6.*,
- lens >=3.9 && <4.15,
- quickcheck-instances >=0.3.8 && <0.4,
- reflection >=1.4 && <2.2,
- sized >=0.2.1.0 && <0.3,
- smallcheck >=1.1.1 && <1.2,
- tagged >=0.7 && <0.9,
- test-framework >=0.8.0.3 && <0.9,
- test-framework-hunit >=0.3.0.1 && <0.4,
- transformers >=0.3 && <0.6,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- equational-reasoning >=0.2 && <0.5
hs-source-dirs: tests share
- other-modules:
- Utils
+ other-modules: Utils
ghc-options: -Wall -threaded
+ default-language: Haskell2010
+
test-suite singular-test
- type: exitcode-stdio-1.0
main-is: SingularTest.hs
+ type: exitcode-stdio-1.0
buildable: False
- build-depends:
- algebra ==4.3.*,
- constraints >=0.3 && <0.9,
- HUnit >=1.3.1.2 && <1.4,
- MonadRandom >=0.1 && <0.5,
- QuickCheck >=2.6 && <2.9,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- deepseq >=1.3 && <1.5,
- hspec >=2.2.4 && <2.3,
- monomorphic >=0.0.3 && <0.1,
- smallcheck >=1.1.1 && <1.2,
- test-framework >=0.8.1.1 && <0.9,
- test-framework-hunit >=0.3.0.2 && <0.4,
- vector >=0.10 && <0.12,
- equational-reasoning >=0.2 && <0.5,
- quickcheck-instances >=0.3.8 && <0.4,
- type-natural >=0.7.1.2 && <0.8,
- sized >=0.2.1.0 && <0.3,
- reflection >=2.1.2 && <2.2,
- tagged >=0.8.5 && <0.9,
- lens ==4.14.*,
- matrix >=0.3.5.0 && <0.4,
- text >=1.2.2.1 && <1.3,
- singletons ==2.2.*
hs-source-dirs: tests share
- other-modules:
- Utils
- SingularBridge
+ other-modules: Utils SingularBridge
ghc-options: -Wall -threaded
+ build-depends: HUnit
+ , MonadRandom
+ , QuickCheck
+ , algebra
+ , base
+ , computational-algebra
+ , constraints
+ , containers
+ , deepseq
+ , equational-reasoning
+ , hspec
+ , lens
+ , matrix
+ , monomorphic
+ , quickcheck-instances
+ , reflection
+ , singletons
+ , sized
+ , smallcheck
+ , tagged
+ , test-framework
+ , test-framework-hunit
+ , text
+ , type-natural
+ , vector
+ default-language: Haskell2010
+
test-suite monomial-order-test
+ build-depends: HUnit -any
+ , MonadRandom
+ , QuickCheck
+ , base
+ , computational-algebra
+ , constraints
+ , containers
+ , deepseq
+ , equational-reasoning
+ , hspec
+ , monomorphic
+ , sized
+ , smallcheck
+ , test-framework
+ , test-framework-hunit
+ , vector
type: exitcode-stdio-1.0
main-is: monomials.hs
buildable: False
- build-depends:
- constraints >=0.3 && <0.9,
- HUnit >=1.3.1.2 && <1.4,
- MonadRandom >=0.1 && <0.5,
- QuickCheck >=2.6 && <2.9,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- deepseq >=1.3 && <1.5,
- hspec >=2.2.4 && <2.3,
- monomorphic >=0.0.3 && <0.1,
- smallcheck >=1.1.1 && <1.2,
- test-framework >=0.8.1.1 && <0.9,
- test-framework-hunit >=0.3.0.2 && <0.4,
- vector >=0.10 && <0.12,
- equational-reasoning >=0.2 && <0.5,
- sized >=0.2.1.0 && <0.3
hs-source-dirs: tests share
- other-modules:
- Utils
+ other-modules: Utils
ghc-options: -Wall -threaded
+ default-language: Haskell2010
+
test-suite linear-test
+ build-depends: HUnit
+ , MonadRandom
+ , QuickCheck
+ , algebra
+ , base >=4
+ , computational-algebra
+ , constraints
+ , containers
+ , deepseq
+ , equational-reasoning
+ , hspec
+ , lens
+ , matrix
+ , monomorphic
+ , quickcheck-instances
+ , reflection
+ , sized
+ , smallcheck
+ , tagged
+ , test-framework
+ , test-framework-hunit
+ , type-natural
+ , vector
type: exitcode-stdio-1.0
main-is: linear.hs
- build-depends:
- constraints >=0.3 && <0.9,
- HUnit >=1.3.1.2 && <1.4,
- MonadRandom >=0.1 && <0.5,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- deepseq >=1.3 && <1.5,
- hspec >=2.2.4 && <2.3,
- lens >=3.9 && <4.15,
- monomorphic >=0.0.3 && <0.1,
- quickcheck-instances >=0.3.12 && <0.4,
- reflection >=1.4 && <2.2,
- sized >=0.2.1.0 && <0.3,
- smallcheck >=1.1.1 && <1.2,
- tagged >=0.7 && <0.9,
- test-framework >=0.8.1.1 && <0.9,
- test-framework-hunit >=0.3.0.2 && <0.4,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- equational-reasoning >=0.2 && <0.5,
- matrix ==0.3.*
+ buildable: True
hs-source-dirs: tests share
- other-modules:
- Utils
+ other-modules: Utils
ghc-options: -Wall -threaded
+ default-language: Haskell2010
+
test-suite matrix-test
+ build-depends: HUnit
+ , MonadRandom
+ , QuickCheck
+ , algebra
+ , base
+ , computational-algebra
+ , constraints
+ , containers
+ , deepseq
+ , equational-reasoning
+ , hspec
+ , lens
+ , matrix
+ , monomorphic
+ , quickcheck-instances
+ , reflection
+ , sized
+ , smallcheck
+ , tagged
+ , test-framework
+ , test-framework-hunit
+ , type-natural
+ , vector
type: exitcode-stdio-1.0
main-is: matrix.hs
buildable: False
- build-depends:
- constraints >=0.3 && <0.9,
- HUnit >=1.3.1.2 && <1.4,
- MonadRandom >=0.1 && <0.5,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- deepseq >=1.3 && <1.5,
- hspec >=2.2.4 && <2.3,
- lens >=3.9 && <4.15,
- monomorphic >=0.0.3 && <0.1,
- quickcheck-instances >=0.3.12 && <0.4,
- reflection >=1.4 && <2.2,
- sized >=0.2.1.0 && <0.3,
- smallcheck >=1.1.1 && <1.2,
- tagged >=0.7 && <0.9,
- test-framework >=0.8.1.1 && <0.9,
- test-framework-hunit >=0.3.0.2 && <0.4,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- matrix ==0.3.*,
- equational-reasoning >=0.2 && <0.5
hs-source-dirs: tests share
- other-modules:
- Utils
+ other-modules: Utils
ghc-options: -Wall -threaded
+ default-language: Haskell2010
+
test-suite specs
+ build-depends: HUnit -any
+ , MonadRandom
+ , QuickCheck
+ , algebra
+ , base
+ , computational-algebra
+ , constraints
+ , containers
+ , convertible
+ , deepseq
+ , equational-reasoning
+ , hspec
+ , lens
+ , matrix
+ , monomorphic
+ , process >=1.1 && <1.7
+ , quickcheck-instances
+ , reflection
+ , singletons
+ , sized
+ , smallcheck
+ , tagged
+ , test-framework
+ , test-framework-hunit
+ , text
+ , type-natural
+ , vector
type: exitcode-stdio-1.0
main-is: Spec.hs
- build-depends:
- constraints >=0.3 && <0.9,
- HUnit >=1.3.1.2 && <1.4,
- MonadRandom >=0.1 && <0.5,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- deepseq >=1.3 && <1.5,
- hspec >=2.2.4 && <2.3,
- lens >=3.9 && <4.15,
- monomorphic >=0.0.3 && <0.1,
- quickcheck-instances >=0.3.12 && <0.4,
- reflection >=1.4 && <2.2,
- sized >=0.2.1.0 && <0.3,
- smallcheck >=1.1.1 && <1.2,
- tagged >=0.7 && <0.9,
- test-framework >=0.8.1.1 && <0.9,
- test-framework-hunit >=0.3.0.2 && <0.4,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- convertible >=1.1.1.0 && <1.2,
- equational-reasoning >=0.2 && <0.5,
- process >=1.1 && <1.5,
- text >=0.11 && <1.3,
- singletons ==2.2.*,
- matrix ==0.3.*
+ buildable: True
hs-source-dirs: tests share
- other-modules:
- Utils
- UnivariateSpec
- GroebnerSpec
- ZeroDimSpec
- QuotientSpec
- PolynomialSpec
- SingularBridge
+ other-modules: QuotientSpec PolynomialSpec SingularBridge
+ Utils UnivariateSpec GroebnerSpec ZeroDimSpec
ghc-options: -Wall -threaded
+ default-language: Haskell2010
+
test-suite new-div-test
+ build-depends: HUnit
+ , MonadRandom
+ , QuickCheck
+ , algebra
+ , base
+ , computational-algebra
+ , constraints
+ , containers
+ , deepseq
+ , equational-reasoning
+ , hspec
+ , lens
+ , matrix
+ , monomorphic
+ , quickcheck-instances
+ , reflection
+ , smallcheck
+ , tagged
+ , test-framework
+ , test-framework-hunit
+ , type-natural
+ , vector
type: exitcode-stdio-1.0
main-is: division.hs
buildable: False
- build-depends:
- constraints >=0.3 && <0.9,
- HUnit >=1.3.1.2 && <1.4,
- MonadRandom >=0.1 && <0.5,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- deepseq >=1.3 && <1.5,
- hspec >=2.2.4 && <2.3,
- lens >=3.9 && <4.15,
- monomorphic >=0.0.3 && <0.1,
- quickcheck-instances >=0.3.12 && <0.4,
- reflection >=1.4 && <2.2,
- smallcheck >=1.1.1 && <1.2,
- tagged >=0.7 && <0.9,
- test-framework >=0.8.1.1 && <0.9,
- test-framework-hunit >=0.3.0.2 && <0.4,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- equational-reasoning >=0.2 && <0.5,
- matrix ==0.3.*
hs-source-dirs: tests share
- other-modules:
- Utils
+ other-modules: Utils
ghc-options: -Wall -threaded
+ default-language: Haskell2010
benchmark unipol-bench
+ build-depends: algebra
+ , base
+ , computational-algebra
+ , constraints
+ , containers
+ , criterion
+ , deepseq
+ , matrix
+ , parallel
+ , process
+ , singletons
+ , sized
+ , type-natural
+ , vector
type: exitcode-stdio-1.0
main-is: unipol-bench.hs
- build-depends:
- constraints >=0.3 && <0.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- criterion >=0.8.1.0 && <1.2,
- deepseq >=1.3 && <1.5,
- parallel ==3.2.*,
- process >=1.1 && <1.5,
- singletons ==2.2.*,
- sized >=0.2.1.0 && <0.3,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- matrix ==0.3.*
hs-source-dirs: bench share
ghc-options: -O2 -threaded -rtsopts
+ default-language: Haskell2010
+
benchmark normal-bench
+ build-depends: algebra
+ , base
+ , computational-algebra
+ , constraints
+ , containers
+ , criterion
+ , deepseq
+ , matrix
+ , parallel
+ , process
+ , singletons
+ , sized
+ , type-natural
+ , vector
type: exitcode-stdio-1.0
main-is: bench.hs
- build-depends:
- constraints >=0.3 && <0.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- criterion >=0.8.1.0 && <1.2,
- deepseq >=1.3 && <1.5,
- parallel ==3.2.*,
- process >=1.1 && <1.5,
- singletons ==2.2.*,
- sized >=0.2.1.0 && <0.3,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- matrix ==0.3.*
+ -- buildable: False
hs-source-dirs: bench share
- other-modules:
- SingularBench
+ other-modules: SingularBench
ghc-options: -O2 -threaded -rtsopts
+ default-language: Haskell2010
+
benchmark elimination-bench
+ build-depends: algebra
+ , base
+ , computational-algebra
+ , constraints
+ , containers
+ , criterion
+ , deepseq
+ , matrix
+ , parallel
+ , process
+ , singletons
+ , sized
+ , type-natural
+ , vector
type: exitcode-stdio-1.0
main-is: elimination-bench.hs
buildable: False
- build-depends:
- constraints >=0.3 && <0.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- criterion >=0.8.1.0 && <1.2,
- deepseq >=1.3 && <1.5,
- parallel ==3.2.*,
- process >=1.1 && <1.5,
- singletons ==2.2.*,
- sized >=0.2.1.0 && <0.3,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- matrix ==0.3.*
hs-source-dirs: bench share
- other-modules:
- SingularBench
+ other-modules: SingularBench
ghc-options: -O2 -threaded -rtsopts
+ default-language: Haskell2010
+
benchmark quotient-bench-randomized
+ build-depends: QuickCheck
+ , algebra
+ , base
+ , computational-algebra
+ , containers
+ , criterion
+ , deepseq
+ , equational-reasoning
+ , lens
+ , matrix
+ , monomorphic
+ , parallel
+ , process
+ , quickcheck-instances
+ , reflection
+ , singletons
+ , sized
+ , smallcheck
+ , tagged
+ , transformers
+ , type-natural
+ , vector
+ , constraints
type: exitcode-stdio-1.0
main-is: quotient-bench-randomized.hs
- build-depends:
- constraints >=0.3 && <0.9,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- criterion >=0.8.1.0 && <1.2,
- deepseq >=1.3 && <1.5,
- lens >=3.9 && <4.15,
- parallel ==3.2.*,
- process >=1.1 && <1.5,
- quickcheck-instances >=0.3.12 && <0.4,
- reflection >=1.4 && <2.2,
- singletons ==2.2.*,
- smallcheck >=1.1.1 && <1.2,
- sized >=0.2.1.0 && <0.3,
- tagged >=0.7 && <0.9,
- transformers >=0.3 && <0.6,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- matrix ==0.3.*,
- equational-reasoning >=0.2 && <0.5,
- monomorphic >=0.0.3 && <0.1
+ buildable: True
hs-source-dirs: bench share
- other-modules:
- SingularBench
- Utils
+ other-modules: SingularBench Utils
ghc-options: -O2 -threaded -rtsopts
+ default-language: Haskell2010
+
benchmark monomial-order-bench
+ build-depends: QuickCheck
+ , algebra
+ , base
+ , computational-algebra
+ , constraint
+ , containers
+ , criterion
+ , deepseq
+ , lens
+ , matrix
+ , monomorphic
+ , parallel
+ , process
+ , quickcheck-instances
+ , random
+ , reflection
+ , singletons
+ , sized
+ , smallcheck
+ , tagged
+ , transformers
+ , type-natural
+ , vector
type: exitcode-stdio-1.0
main-is: monomials.hs
buildable: False
- build-depends:
- constraints >=0.3 && <0.9,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- criterion >=0.8.1.0 && <1.2,
- deepseq >=1.3 && <1.5,
- lens >=3.9 && <4.15,
- monomorphic >=0.0.3 && <0.1,
- parallel ==3.2.*,
- process >=1.1 && <1.5,
- quickcheck-instances >=0.3.12 && <0.4,
- random >=1.0 && <1.2,
- reflection >=1.4 && <2.2,
- singletons ==2.2.*,
- sized >=0.2.1.0 && <0.3,
- smallcheck >=1.1.1 && <1.2,
- tagged >=0.7 && <0.9,
- transformers >=0.3 && <0.6,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- matrix ==0.3.*
hs-source-dirs: bench share
- other-modules:
- SingularBench
- Utils
+ other-modules: SingularBench Utils
ghc-options: -O2 -threaded -rtsopts
+ default-language: Haskell2010
+
benchmark linear-bench
+ build-depends: HUnit -any
+ , MonadRandom
+ , QuickCheck
+ , algebra
+ , base
+ , computational-algebra
+ , constraints
+ , containers
+ , criterion
+ , deepseq
+ , equational-reasoning
+ , hspec
+ , lens
+ , matrix
+ , monomorphic
+ , parallel
+ , process
+ , quickcheck-instances
+ , reflection
+ , sized
+ , smallcheck
+ , tagged
+ , test-framework
+ , test-framework-hunit
+ , type-natural
+ , vector
type: exitcode-stdio-1.0
main-is: linear.hs
buildable: False
- build-depends:
- constraints >=0.3 && <0.9,
- HUnit >=1.3.1.2 && <1.4,
- MonadRandom >=0.1 && <0.5,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- sized >=0.2.1.0 && <0.3,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- criterion >=0.8.1.0 && <1.2,
- deepseq >=1.3 && <1.5,
- hspec >=2.2.4 && <2.3,
- lens >=3.9 && <4.15,
- monomorphic >=0.0.3 && <0.1,
- parallel ==3.2.*,
- process >=1.1 && <1.5,
- quickcheck-instances >=0.3.12 && <0.4,
- reflection >=1.4 && <2.2,
- smallcheck >=1.1.1 && <1.2,
- tagged >=0.7 && <0.9,
- test-framework >=0.8.1.1 && <0.9,
- test-framework-hunit >=0.3.0.2 && <0.4,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- equational-reasoning >=0.2 && <0.5,
- matrix ==0.3.*,
- monomorphic >=0.0.3 && <0.1
hs-source-dirs: bench share
- other-modules:
- Utils
+ other-modules: Utils
ghc-options: -O2 -threaded -rtsopts
+ default-language: Haskell2010
+
benchmark division-bench
+ build-depends: HUnit
+ , MonadRandom
+ , QuickCheck
+ , algebra
+ , base
+ , computational-algebra
+ , constraints
+ , containers
+ , criterion
+ , deepseq
+ , equational-reasoning
+ , hspec
+ , lens
+ , matrix
+ , monomorphic
+ , parallel
+ , process
+ , quickcheck-instances
+ , reflection
+ , sized
+ , smallcheck
+ , tagged
+ , test-framework
+ , test-framework-hunit
+ , type-natural
+ , vector
type: exitcode-stdio-1.0
main-is: division.hs
buildable: False
- build-depends:
- constraints >=0.3 && <0.9,
- HUnit >=1.3.1.2 && <1.4,
- MonadRandom >=0.1 && <0.5,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- sized >=0.2.1.0 && <0.3,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- criterion >=0.8.1.0 && <1.2,
- deepseq >=1.3 && <1.5,
- hspec >=2.2.4 && <2.3,
- lens >=3.9 && <4.15,
- monomorphic >=0.0.3 && <0.1,
- parallel ==3.2.*,
- process >=1.1 && <1.5,
- quickcheck-instances >=0.3.12 && <0.4,
- reflection >=1.4 && <2.2,
- smallcheck >=1.1.1 && <1.2,
- tagged >=0.7 && <0.9,
- test-framework >=0.8.1.1 && <0.9,
- test-framework-hunit >=0.3.0.2 && <0.4,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- equational-reasoning >=0.2 && <0.5,
- matrix ==0.3.*,
- monomorphic >=0.0.3 && <0.1
hs-source-dirs: bench share
- other-modules:
- Utils
+ other-modules: Utils
ghc-options: -O2 -threaded -rtsopts
+ default-language: Haskell2010
+
benchmark sugar-paper-bench
+ build-depends: HUnit
+ , MonadRandom
+ , QuickCheck
+ , algebra
+ , base
+ , computational-algebra
+ , constraints
+ , containers
+ , criterion
+ , deepseq
+ , equational-reasoning
+ , hspec
+ , lens
+ , matrix
+ , monomorphic
+ , monomorphic
+ , parallel
+ , process
+ , quickcheck-instances
+ , reflection
+ , sized
+ , smallcheck
+ , tagged
+ , test-framework
+ , test-framework-hunit
+ , type-natural
+ , vector
type: exitcode-stdio-1.0
main-is: sugar-paper.hs
- build-depends:
- constraints >=0.3 && <0.9,
- HUnit >=1.3.1.2 && <1.4,
- sized >=0.2.1.0 && <0.3,
- MonadRandom >=0.1 && <0.5,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- criterion >=0.8.1.0 && <1.2,
- deepseq >=1.3 && <1.5,
- hspec >=2.2.4 && <2.3,
- lens >=3.9 && <4.15,
- monomorphic >=0.0.3 && <0.1,
- parallel ==3.2.*,
- process >=1.1 && <1.5,
- quickcheck-instances >=0.3.12 && <0.4,
- reflection >=1.4 && <2.2,
- smallcheck >=1.1.1 && <1.2,
- tagged >=0.7 && <0.9,
- test-framework >=0.8.1.1 && <0.9,
- test-framework-hunit >=0.3.0.2 && <0.4,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- equational-reasoning >=0.2 && <0.5,
- matrix ==0.3.*,
- monomorphic >=0.0.3 && <0.1
+ buildable: True
hs-source-dirs: bench share
- other-modules:
- Utils
+ other-modules: Utils
ghc-options: -O2 -threaded -rtsopts
+ default-language: Haskell2010
+
benchmark solve-bench
+ build-depends: HUnit
+ , MonadRandom
+ , QuickCheck
+ , algebra
+ , base
+ , computational-algebra
+ , constraints
+ , containers
+ , criterion
+ , deepseq
+ , equational-reasoning
+ , hspec
+ , lens
+ , matrix
+ , monomorphic
+ , parallel
+ , process
+ , quickcheck-instances
+ , random
+ , reflection
+ , sized
+ , smallcheck
+ , tagged
+ , test-framework
+ , test-framework-hunit
+ , type-natural
+ , vector
type: exitcode-stdio-1.0
main-is: solve.hs
- build-depends:
- constraints >=0.3 && <0.9,
- HUnit >=1.3.1.2 && <1.4,
- sized >=0.2.1.0 && <0.3,
- MonadRandom >=0.1 && <0.5,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- criterion >=0.8.1.0 && <1.2,
- deepseq >=1.3 && <1.5,
- hspec >=2.2.4 && <2.3,
- lens >=3.9 && <4.15,
- monomorphic >=0.0.3 && <0.1,
- parallel ==3.2.*,
- process >=1.1 && <1.5,
- quickcheck-instances >=0.3.12 && <0.4,
- reflection >=1.4 && <2.2,
- smallcheck >=1.1.1 && <1.2,
- tagged >=0.7 && <0.9,
- test-framework >=0.8.1.1 && <0.9,
- test-framework-hunit >=0.3.0.2 && <0.4,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- random >=1.0 && <1.2,
- equational-reasoning >=0.2 && <0.5,
- matrix ==0.3.*
+ buildable: True
hs-source-dirs: bench share
- other-modules:
- Utils
+ other-modules: Utils
ghc-options: -O2 -threaded -rtsopts
+ default-language: Haskell2010
+
benchmark coercion-bench
+ build-depends: HUnit
+ , MonadRandom
+ , QuickCheck
+ , algebra
+ , base
+ , computational-algebra
+ , constraints
+ , containers
+ , criterion
+ , deepseq
+ , equational-reasoning
+ , hspec
+ , lens
+ , matrix
+ , monomorphic
+ , parallel
+ , process
+ , quickcheck-instances
+ , random
+ , reflection
+ , sized
+ , smallcheck
+ , tagged
+ , test-framework
+ , test-framework-hunit
+ , type-natural
+ , vector
type: exitcode-stdio-1.0
main-is: coercion.hs
buildable: False
- build-depends:
- constraints >=0.3 && <0.9,
- HUnit >=1.3.1.2 && <1.4,
- sized >=0.2.1.0 && <0.3,
- MonadRandom >=0.1 && <0.5,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- criterion >=0.8.1.0 && <1.2,
- deepseq >=1.3 && <1.5,
- hspec >=2.2.4 && <2.3,
- lens >=3.9 && <4.15,
- monomorphic >=0.0.3 && <0.1,
- parallel ==3.2.*,
- process >=1.1 && <1.5,
- quickcheck-instances >=0.3.12 && <0.4,
- reflection >=1.4 && <2.2,
- smallcheck >=1.1.1 && <1.2,
- tagged >=0.7 && <0.9,
- test-framework >=0.8.1.1 && <0.9,
- test-framework-hunit >=0.3.0.2 && <0.4,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- random >=1.0 && <1.2,
- equational-reasoning >=0.2 && <0.5,
- matrix ==0.3.*
hs-source-dirs: bench share
- other-modules:
- Utils
- ghc-options: -Wall -O2 -threaded -rtsopts
-benchmark faugere4-bench
- type: exitcode-stdio-1.0
- main-is: faugere4.hs
- build-depends:
- constraints >=0.3 && <0.9,
- HUnit >=1.3.1.2 && <1.4,
- sized >=0.2.1.0 && <0.3,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- criterion >=0.8.1.0 && <1.2,
- deepseq >=1.3 && <1.5,
- hspec >=2.2.4 && <2.3,
- lens >=3.9 && <4.15,
- monomorphic >=0.0.3 && <0.1,
- parallel ==3.2.*,
- process >=1.1 && <1.5,
- quickcheck-instances >=0.3.12 && <0.4,
- reflection >=1.4 && <2.2,
- smallcheck >=1.1.1 && <1.2,
- tagged >=0.7 && <0.9,
- test-framework >=0.8.1.1 && <0.9,
- test-framework-hunit >=0.3.0.2 && <0.4,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- random >=1.0 && <1.2,
- equational-reasoning >=0.2 && <0.5,
- matrix ==0.3.*
- hs-source-dirs: bench share
- other-modules:
- Utils
+ other-modules: Utils
ghc-options: -Wall -O2 -threaded -rtsopts
+ default-language: Haskell2010
+
benchmark unipol-mult-bench
+ build-depends: HUnit
+ , QuickCheck
+ , algebra
+ , base
+ , computational-algebra
+ , constraints
+ , containers
+ , criterion
+ , deepseq
+ , equational-reasoning
+ , hspec
+ , lens
+ , matrix
+ , monomorphic
+ , parallel
+ , process
+ , quickcheck-instances
+ , random
+ , reflection
+ , sized
+ , smallcheck
+ , tagged
+ , test-framework
+ , test-framework-hunit
+ , type-natural
+ , vector
type: exitcode-stdio-1.0
main-is: unipol-mult.hs
- build-depends:
- constraints >=0.3 && <0.9,
- HUnit >=1.3.1.2 && <1.4,
- sized >=0.2.1.0 && <0.3,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- criterion >=0.8.1.0 && <1.2,
- deepseq >=1.3 && <1.5,
- hspec >=2.2.4 && <2.3,
- lens >=3.9 && <4.15,
- monomorphic >=0.0.3 && <0.1,
- parallel ==3.2.*,
- process >=1.1 && <1.5,
- quickcheck-instances >=0.3.12 && <0.4,
- reflection >=1.4 && <2.2,
- smallcheck >=1.1.1 && <1.2,
- tagged >=0.7 && <0.9,
- test-framework >=0.8.1.1 && <0.9,
- test-framework-hunit >=0.3.0.2 && <0.4,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- random >=1.0 && <1.2,
- equational-reasoning >=0.2 && <0.5,
- matrix ==0.3.*
+ buildable: True
hs-source-dirs: bench share
- other-modules:
- Utils
+ other-modules: Utils
ghc-options: -Wall -O2 -threaded -rtsopts
+ default-language: Haskell2010
+
benchmark unipol-div-bench
+ build-depends: HUnit
+ , QuickCheck
+ , algebra
+ , base
+ , computational-algebra
+ , containers
+ , criterion
+ , deepseq
+ , equational-reasoning
+ , hspec
+ , lens
+ , matrix
+ , monomorphic
+ , parallel
+ , process
+ , quickcheck-instances
+ , random
+ , reflection
+ , sized
+ , smallcheck
+ , tagged
+ , test-framework
+ , test-framework-hunit
+ , type-natural
+ , vector
+ , constraints
type: exitcode-stdio-1.0
main-is: unipol-div.hs
- build-depends:
- constraints >=0.3 && <0.9,
- HUnit >=1.3.1.2 && <1.4,
- sized >=0.2.1.0 && <0.3,
- QuickCheck >=2.6 && <2.9,
- algebra ==4.3.*,
- base >=4 && <4.10,
- computational-algebra >=0.5.0.0 && <0.6,
- containers ==0.5.*,
- criterion >=0.8.1.0 && <1.2,
- deepseq >=1.3 && <1.5,
- hspec >=2.2.4 && <2.3,
- lens >=3.9 && <4.15,
- monomorphic >=0.0.3 && <0.1,
- parallel ==3.2.*,
- process >=1.1 && <1.5,
- quickcheck-instances >=0.3.12 && <0.4,
- reflection >=1.4 && <2.2,
- smallcheck >=1.1.1 && <1.2,
- tagged >=0.7 && <0.9,
- test-framework >=0.8.1.1 && <0.9,
- test-framework-hunit >=0.3.0.2 && <0.4,
- type-natural >=0.7.1.2 && <0.8,
- vector >=0.10 && <0.12,
- random >=1.0 && <1.2,
- equational-reasoning >=0.2 && <0.5,
- matrix ==0.3.*
+ buildable: True
hs-source-dirs: bench share
- other-modules:
- Utils
- ghc-options: -Wall -O2 -threaded -rtsopts \ No newline at end of file
+ other-modules: Utils
+ ghc-options: -Wall -O2 -threaded -rtsopts
+ default-language: Haskell2010
diff --git a/examples/hensel-prof.hs b/examples/hensel-prof.hs
index 8e1f3ae..18db1cb 100644
--- a/examples/hensel-prof.hs
+++ b/examples/hensel-prof.hs
@@ -1,21 +1,11 @@
-{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE DataKinds, NoImplicitPrelude, OverloadedLabels #-}
module Main where
-import Algebra.Algorithms.Faugere4
import Algebra.LinkedMatrix
import Algebra.Prelude
-import Control.Exception (evaluate)
+import Algebra.Ring.Polynomial.Factorise
+import Control.DeepSeq
+import Control.Exception (evaluate)
main :: IO ()
main = do
- _ <- evaluate $ faugere4Modular optimalStrategy (cyclic (sing :: SNat 4))
- return ()
-
-testCase :: Matrix (Fraction Integer)
-testCase = fromLists [[0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,0,0]
- ,[0,0,0,0,0,0,1,1,1,0,0,1,0,0,0,1,0,0,0]
- ,[0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0]
- ,[0,0,0,0,0,1,0,0,0,0,1,-1,0,-1,1,0,-1,0,0]
- ,[0,0,0,0,1,1,0,1,0,0,1,0,0,0,1,0,0,0,0]
- ,[1,1,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0]
- ,[1,0,1,0,1,0,0,0,0,1,0,1,0,0,0,0,0,0,0]
- ]
+ print =<< factorHensel (#x ^5)
diff --git a/examples/sandpit-poly.hs b/examples/sandpit-poly.hs
index 6e81522..4ad940e 100644
--- a/examples/sandpit-poly.hs
+++ b/examples/sandpit-poly.hs
@@ -54,9 +54,13 @@ findRoot f
| isZero f -> Just zero
| otherwise -> Nothing
+sPolLex :: OrderedPolynomial Rational Lex 2
+sPolLex =
+ let [x,y] = vars
+ in sPolynomial (x ^3 * y ^2 + x ^2 * y ^3) (3 * x ^4 * y + y ^2)
-
-
-
-
+sPolGrevlex :: OrderedPolynomial Rational Grevlex 2
+sPolGrevlex =
+ let [x,y] = vars
+ in sPolynomial (x ^3 * y ^2 + x ^2 * y ^3) (3 * x ^4 * y + y ^2)