lapack 0.2.3.1 → 0.2.4
raw patch · 3 files changed
+27/−3 lines, 3 filesdep ~semigroups
Dependency ranges changed: semigroups
Files
lapack.cabal view
@@ -1,5 +1,5 @@ Name: lapack-Version: 0.2.3.1+Version: 0.2.4 License: BSD3 License-File: LICENSE Author: Henning Thielemann <haskell@henning-thielemann.de>@@ -45,7 +45,7 @@ default: False Source-Repository this- Tag: 0.2.3.1+ Tag: 0.2.4 Type: darcs Location: http://hub.darcs.net/thielema/lapack/ @@ -66,6 +66,7 @@ transformers >=0.3 && <0.6, tfp >=1.0.1 && <1.1, fixed-length >=0.2 && <0.3,+ semigroups >=0.18.3 && <0.19, non-empty >=0.3 && <0.4, utility-ht >=0.0.10 && <0.1, base >=4.5 && <5@@ -142,7 +143,7 @@ ChasingBottoms >=1.2.2 && <1.4, transformers, monoid-transformer >=0.0.3 && <0.1,- semigroups >=0.18.3 && <0.19,+ semigroups, non-empty >=0.3.1, utility-ht, base
src/Numeric/LAPACK/Permutation/Private.hs view
@@ -34,6 +34,8 @@ import Control.Applicative ((<$>)) import Data.Bool.HT (if')+import Data.Monoid (Monoid, mempty, mappend)+import Data.Semigroup (Semigroup, (<>)) newtype Permutation sh = Permutation (Vector sh CInt)@@ -101,6 +103,13 @@ data Sign = Negative | Positive deriving (Eq, Show)++instance Semigroup Sign where+ x<>y = if x==y then Positive else Negative++instance Monoid Sign where+ mempty = Positive+ mappend = (<>) {- We could also count the cycles of even number. This might be a little faster.
test/Test/Permutation.hs view
@@ -25,6 +25,8 @@ import Control.Monad (forM) import Control.Applicative (liftA2, (<$>)) +import Data.Monoid ((<>))+ import qualified Test.QuickCheck as QC @@ -45,6 +47,12 @@ == Array.toList xs +determinantMultiply :: (Permutation ZeroInt, Permutation ZeroInt) -> Bool+determinantMultiply (p0,p1) =+ Perm.determinant (Perm.multiply p0 p1)+ ==+ Perm.determinant p0 <> Perm.determinant p1+ transposeMultiply :: (Permutation ZeroInt, Permutation ZeroInt) -> Bool transposeMultiply (p0,p1) = (Array.toList $ Perm.toPivots NonInverted $@@ -128,6 +136,12 @@ QC.forAll QC.arbitraryBoundedEnum $ \inv -> QC.forAll (QC.arbitrary >>= genPivots) $ \pivot -> permutationPivots inv pivot) :+ ("determinantMultiply",+ QC.property $+ QC.forAll+ (do nat <- QC.arbitrary+ liftA2 (,) (genPerm nat) (genPerm nat))+ determinantMultiply) : ("transposeMultiply", QC.property $ QC.forAll