hmatrix 0.12.0.1 → 0.12.0.2
raw patch · 4 files changed
+33/−7 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- THANKS +2/−0
- examples/fitting.hs +24/−0
- hmatrix.cabal +4/−4
- lib/Data/Packed/Matrix.hs +3/−3
THANKS view
@@ -103,3 +103,5 @@ - Tom Nielsen discovered a problem in Config.hs, exposed by link problems in Ubuntu 11.10 beta. +- Daniel Fischer reported some Haddock markup errors.+
+ examples/fitting.hs view
@@ -0,0 +1,24 @@+-- nonlinear least-squares fitting++import Numeric.GSL.Fitting+import Numeric.LinearAlgebra++xs = map return [0 .. 39]+sigma = 0.1+ys = map return $ toList $ fromList (map (head . expModel [5,0.1,1]) xs)+ + scalar sigma * (randomVector 0 Gaussian 40)++dat :: [([Double],([Double],Double))]++dat = zip xs (zip ys (repeat sigma))++expModel [a,lambda,b] [t] = [a * exp (-lambda * t) + b]++expModelDer [a,lambda,b] [t] = [[exp (-lambda * t), -t * a * exp(-lambda*t) , 1]]++(sol,path) = fitModelScaled 1E-4 1E-4 20 (expModel, expModelDer) dat [1,0,0]++main = do+ print dat+ print path+ print sol
hmatrix.cabal view
@@ -1,5 +1,5 @@ Name: hmatrix-Version: 0.12.0.1+Version: 0.12.0.2 License: GPL License-file: LICENSE Author: Alberto Ruiz@@ -46,6 +46,7 @@ examples/plot.hs examples/inplace.hs examples/error.hs+ examples/fitting.hs examples/devel/ej1/wrappers.hs examples/devel/ej1/functions.c examples/devel/ej2/wrappers.hs@@ -216,9 +217,8 @@ extra-lib-dirs: source-repository head- type: darcs- location: http://patch-tag.com/r/aruiz/hmatrix--- location: http://code.haskell.org/hmatrix+ type: git+ location: https://github.com/AlbertoRuiz/hmatrix -- Test-Suite tests -- type: exitcode-stdio-1.0
lib/Data/Packed/Matrix.hs view
@@ -205,7 +205,7 @@ Example: -@\> (2>|<3)[1..]+@\> (2><3)[1..] (2><3) [ 1.0, 2.0, 3.0 , 4.0, 5.0, 6.0 ]@@@ -259,7 +259,7 @@ {- | creates a Matrix of the specified size using the supplied function to to map the row\/column position to the value at that row\/column position. -@> buildMatrix 3 4 (\ (r,c) -> fromIntegral r * fromIntegral c)+@> buildMatrix 3 4 (\\(r,c) -> fromIntegral r * fromIntegral c) (3><4) [ 0.0, 0.0, 0.0, 0.0, 0.0 , 0.0, 1.0, 2.0, 3.0, 4.0@@ -267,7 +267,7 @@ Hilbert matrix of order N: -@hilb n = buildMatrix n n (\(i,j)->1/(fromIntegral i + fromIntegral j +1))@+@hilb n = buildMatrix n n (\\(i,j)->1/(fromIntegral i + fromIntegral j +1))@ -} buildMatrix :: Element a => Int -> Int -> ((Int, Int) -> a) -> Matrix a