summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Tests.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests.hs')
-rw-r--r--lib/Numeric/LinearAlgebra/Tests.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests.hs b/lib/Numeric/LinearAlgebra/Tests.hs
index 174e418..83f581f 100644
--- a/lib/Numeric/LinearAlgebra/Tests.hs
+++ b/lib/Numeric/LinearAlgebra/Tests.hs
@@ -119,9 +119,14 @@ minimizationTest = TestList [ utest "minimization conj grad" (minim1 f df [5,7]
119 119
120--------------------------------------------------------------------- 120---------------------------------------------------------------------
121 121
122rootFindingTest = utest "root Hybrids" (sol ~~ [1,1]) 122rootFindingTest = TestList [ utest "root Hybrids" (fst sol1 ~~ [1,1])
123 where sol = fst $ root Hybrids 1E-7 30 (rosenbrock 1 10) [-10,-5] 123 , utest "root Newton" (rows (snd sol2) == 2)
124 ]
125 where sol1 = root Hybrids 1E-7 30 (rosenbrock 1 10) [-10,-5]
126 sol2 = rootJ Newton 1E-7 30 (rosenbrock 1 10) (jacobian 1 10) [-10,-5]
124 rosenbrock a b [x,y] = [ a*(1-x), b*(y-x^2) ] 127 rosenbrock a b [x,y] = [ a*(1-x), b*(y-x^2) ]
128 jacobian a b [x,_y] = [ [-a , 0]
129 , [-2*b*x, b] ]
125 130
126--------------------------------------------------------------------- 131---------------------------------------------------------------------
127 132