]> gitweb.michael.orlitzky.com - numerical-analysis.git/blobdiff - src/Roots/Fast.hs
Replace the custom 'Vector' typeclass with 'Normed' everywhere.
[numerical-analysis.git] / src / Roots / Fast.hs
index cda999ceab62a2fcc3b1f77e07560fb22403d6d3..5efdf3be99eec871931d18c6095333b8bd31ce83 100644 (file)
@@ -8,7 +8,7 @@ where
 
 import Data.List (find)
 
-import Vector
+import Normed
 
 
 has_root :: (Fractional a, Ord a, Ord b, Num b)
@@ -104,7 +104,7 @@ fixed_point_iterations f x0 =
 --
 --   We also return the number of iterations required.
 --
-fixed_point_with_iterations :: (Vector a, RealFrac b)
+fixed_point_with_iterations :: (Normed a, RealFrac b)
                             => (a -> a)  -- ^ The function @f@ to iterate.
                             -> b        -- ^ The tolerance, @epsilon@.
                             -> a        -- ^ The initial value @x0@.
@@ -115,7 +115,7 @@ fixed_point_with_iterations f epsilon x0 =
     xn = fixed_point_iterations f x0
     xn_plus_one = tail xn
 
-    abs_diff v w = norm_2 (v - w)
+    abs_diff v w = norm (v - w)
 
     -- The nth entry in this list is the absolute value of x_{n} -
     -- x_{n+1}.