levmar 1.1.0.1 → 1.2
raw patch · 2 files changed
+20/−11 lines, 2 filesdep ~hmatrixdep ~vector
Dependency ranges changed: hmatrix, vector
Files
- Numeric/LevMar.hs +17/−8
- levmar.cabal +3/−3
Numeric/LevMar.hs view
@@ -3,6 +3,9 @@ , UnicodeSyntax , ScopedTypeVariables , DeriveDataTypeable+ , StandaloneDeriving+ , FlexibleContexts+ , UndecidableInstances #-} --------------------------------------------------------------------------------@@ -50,15 +53,17 @@ -- from base: import Control.Monad ( return, mplus ) import Control.Exception ( Exception )+import Data.Data ( Data ) import Data.Typeable ( Typeable ) import Data.Either ( Either(Left, Right) )+import Data.Eq ( Eq ) import Data.Function ( ($) ) import Data.Functor ( (<$>) ) import Data.Int ( Int ) import Data.List ( lookup, (++) ) import Data.Maybe ( Maybe(Nothing, Just), isJust, fromJust, fromMaybe ) import Data.Monoid ( Monoid(mempty, mappend) )-import Data.Ord ( (<) )+import Data.Ord ( Ord, (<) ) import Foreign.Marshal.Array ( allocaArray, withArray, peekArray, copyArray ) import Foreign.Ptr ( Ptr, nullPtr ) import Foreign.ForeignPtr ( ForeignPtr, newForeignPtr_, withForeignPtr )@@ -89,10 +94,12 @@ import Data.Function.Unicode ( (∘) ) -- from hmatrix:-import Data.Packed.Vector ( Vector )-import Data.Packed.Matrix ( Matrix, Element, flatten, rows, reshape )+import Data.Packed.Matrix ( Matrix, Element, flatten, rows, reshape )+import Numeric.Container ( Container )+import Numeric.LinearAlgebra ( {- Instances for Matrix -} ) -- from vector:+import Data.Vector.Storable ( Vector ) import qualified Data.Vector.Storable as VS ( unsafeWith, length , unsafeFromForeignPtr , length@@ -425,7 +432,7 @@ -- with central differences which are more -- accurate (but slower!) compared to the -- forward differences employed by default.- } deriving (Read, Show, Typeable)+ } deriving (Eq, Ord, Read, Show, Data, Typeable) -- | Default minimization options defaultOpts ∷ Fractional r ⇒ Options r@@ -451,8 +458,10 @@ , upperBounds ∷ !(Maybe (Vector r)) -- ^ Optional upper bounds , weights ∷ !(Maybe (Vector r)) -- ^ Optional weights , linearConstraints ∷ !(Maybe (LinearConstraints r)) -- ^ Optional linear constraints- } deriving (Show, Typeable)+ } deriving (Read, Show, Typeable) +deriving instance Container Vector r ⇒ Eq (Constraints r)+ -- | Linear constraints consisting of a constraints matrix, @k><m@ and -- a right hand constraints vector, of length @k@ where @m@ is the number of -- parameters and @k@ is the number of constraints.@@ -488,7 +497,7 @@ , infNumJacobEvals ∷ !Int -- ^ Number of jacobian evaluations. , infNumLinSysSolved ∷ !Int -- ^ Number of linear systems solved, -- i.e. attempts for reducing error.- } deriving (Read, Show, Typeable)+ } deriving (Eq, Ord, Read, Show, Data, Typeable) listToInfo ∷ (RealFrac r) ⇒ [r] → Info r listToInfo [a,b,c,d,e,f,g,h,i,j] =@@ -517,7 +526,7 @@ | SmallNorm2E -- ^ Stopped because of small @||e||_2@. | InvalidValues -- ^ Stopped because model function returned invalid values -- (i.e. NaN or Inf). This is a user error.- deriving (Read, Show, Typeable, Enum)+ deriving (Eq, Ord, Read, Show, Data, Typeable, Enum) --------------------------------------------------------------------------------@@ -543,7 +552,7 @@ -- of measurements is smaller than the -- number of unknowns minus the number of -- equality constraints.- deriving (Read, Show, Typeable)+ deriving (Eq, Ord, Read, Show, Data, Typeable) -- Handy in case you want to thow a LevMarError as an exception: instance Exception LevMarError
levmar.cabal view
@@ -1,5 +1,5 @@ name: levmar-version: 1.1.0.1+version: 1.2 cabal-version: >= 1.6 build-type: Simple stability: experimental@@ -49,8 +49,8 @@ build-depends: base >= 3 && < 4.5 , base-unicode-symbols >= 0.1.1 && < 0.3 , bindings-levmar >= 1.0 && < 1.1- , hmatrix >= 0.11 && < 0.12- , vector >= 0.7 && < 0.8+ , hmatrix >= 0.12 && < 0.13+ , vector >= 0.8 && < 0.10 exposed-modules: Numeric.LevMar other-modules: Bindings.LevMar.CurryFriendly ghc-options: -Wall