computational-algebra 0.1.0.1 → 0.1.1.0
raw patch · 3 files changed
+13/−10 lines, 3 files
Files
- Algebra/Ring/Noetherian.hs +7/−4
- computational-algebra.cabal +1/−1
- examples/bench.hs +5/−5
Algebra/Ring/Noetherian.hs view
@@ -5,13 +5,15 @@ module Algebra.Ring.Noetherian ( NoetherianRing, Ideal(..), addToIdeal, toIdeal, appendIdeal , generators, filterIdeal, mapIdeal, principalIdeal) where import Algebra.Internal-import Data.Complex+import qualified Data.Complex as C import Data.Function import Data.Ord import Data.Ratio import Numeric.Algebra-import Prelude hiding (negate, subtract, (*), (+), (-))-import qualified Prelude as P+import qualified Numeric.Algebra.Complex as NA+import Prelude hiding (negate, subtract, (*), (+),+ (-))+import qualified Prelude as P class (Commutative r, Ring r) => NoetherianRing r where @@ -19,7 +21,8 @@ instance NoetherianRing Integer where -instance (Commutative (Complex r), Ring (Complex r)) => NoetherianRing (Complex r) where+instance (Commutative (NA.Complex r), Ring (NA.Complex r)) => NoetherianRing (NA.Complex r) where+instance (Commutative (C.Complex r), Ring (C.Complex r)) => NoetherianRing (C.Complex r) where instance Integral n => NoetherianRing (Ratio n) instance Division (Ratio Integer) where
computational-algebra.cabal view
@@ -2,7 +2,7 @@ -- further documentation, see http://haskell.org/cabal/users-guide/ name: computational-algebra-version: 0.1.0.1+version: 0.1.1.0 synopsis: Well-kinded computational algebra library, currently supporting Groebner basis. description: Dependently-typed computational algebra libray for Groebner basis. homepage: https://github.com/konn/computational-algebra
examples/bench.hs view
@@ -9,8 +9,8 @@ import qualified Numeric.Algebra as NA import Progression.Main -x, y, z, w, s, a, b, c :: Polynomial Rational (S (S (S Three)))-[x, y, z, w, s, a, b, c] = genVars (sS (sS (sS Three)))+x, y, z, w, s, a, b, c :: Polynomial Rational+[x, y, z, w, s, a, b, c] = map (injectVar . flip Variable Nothing) "xyzwSabc" instance NFData Variable where rnf (Variable x y) = rnf x `seq` rnf y `seq` ()@@ -28,7 +28,7 @@ main :: IO () main = defaultMain $ bgroup "groebner"- [ bench "simple" $ nf (simpleBuchberger Lex) ideal3- , bench "relprime" $ nf (primeTestBuchberger Lex) ideal3- , bench "relprime" $ nf (syzygyBuchberger Lex) ideal3+ [ bench "simple" $ nf (simpleBuchbergerWith Lex) ideal3+ , bench "relprime" $ nf (primeTestBuchbergerWith Lex) ideal3+ , bench "syzygy" $ nf (syzygyBuchbergerWith Lex) ideal3 ]