diff options
Diffstat (limited to 'examples/root.hs')
-rw-r--r-- | examples/root.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/root.hs b/examples/root.hs index 8546ff5..fa6e77a 100644 --- a/examples/root.hs +++ b/examples/root.hs | |||
@@ -9,7 +9,7 @@ test method = do | |||
9 | print method | 9 | print method |
10 | let (s,p) = root method 1E-7 30 (rosenbrock 1 10) [-10,-5] | 10 | let (s,p) = root method 1E-7 30 (rosenbrock 1 10) [-10,-5] |
11 | print s -- solution | 11 | print s -- solution |
12 | disp p -- evolution of the algorithm | 12 | disp' p -- evolution of the algorithm |
13 | 13 | ||
14 | jacobian a b [x,y] = [ [-a , 0] | 14 | jacobian a b [x,y] = [ [-a , 0] |
15 | , [-2*b*x, b] ] | 15 | , [-2*b*x, b] ] |
@@ -18,9 +18,9 @@ testJ method = do | |||
18 | print method | 18 | print method |
19 | let (s,p) = rootJ method 1E-7 30 (rosenbrock 1 10) (jacobian 1 10) [-10,-5] | 19 | let (s,p) = rootJ method 1E-7 30 (rosenbrock 1 10) (jacobian 1 10) [-10,-5] |
20 | print s | 20 | print s |
21 | disp p | 21 | disp' p |
22 | 22 | ||
23 | disp = putStrLn . format " " (printf "%.3f") | 23 | disp' = putStrLn . format " " (printf "%.3f") |
24 | 24 | ||
25 | main = do | 25 | main = do |
26 | test Hybrids | 26 | test Hybrids |