]> gitweb.michael.orlitzky.com - numerical-analysis.git/blobdiff - src/Vector.hs
Rename "norm" to "norm_2" in the Vector class.
[numerical-analysis.git] / src / Vector.hs
index 97bb5d8aea2c94a8100ed981bff988d6a9df60ab..6953031d10658a36a6f7da796d88a384458a18b9 100644 (file)
@@ -8,17 +8,22 @@ where
 import Data.Number.BigFloat
 
 class (Num a) => Vector a where
-  norm :: RealFrac b => a -> b
+  norm_2 :: RealFrac b => a -> b
+  norm_infty :: RealFrac b => a -> b
 
 -- Define instances for common numeric types.
 instance Vector Integer where
-  norm = fromInteger
+  norm_2 = fromInteger
+  norm_infty = fromInteger
 
 instance Vector Rational where
-  norm = fromRational
+  norm_2 = fromRational
+  norm_infty = fromRational
 
 instance Epsilon e => Vector (BigFloat e) where
-  norm = fromRational . toRational
+  norm_2 = fromRational . toRational
+  norm_infty = fromRational . toRational
 
 instance Vector Double where
-  norm = fromRational . toRational
+  norm_2 = fromRational . toRational
+  norm_infty = fromRational . toRational