X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FVector.hs;h=a4d3c13585bfba3b0b06a14506c0b025eb3cc3c4;hb=c3905924154d9a8d56bdc57e2f36fe48b8524eef;hp=f55808b33f534283cf7ba432d667c72a6e565353;hpb=e09978f7c891cf2d752f841ad6b90a0b51c9da9d;p=numerical-analysis.git diff --git a/src/Vector.hs b/src/Vector.hs index f55808b..a4d3c13 100644 --- a/src/Vector.hs +++ b/src/Vector.hs @@ -143,7 +143,7 @@ instance (RealFloat a, Ord a, Vector v a) => Normed (Vn v a) where -- >>> norm_infty v1 -- 5 -- - norm_infty (Vn v1) = fromRational $ toRational $ V.foldl max 0 v1 + norm_infty (Vn v1) = realToFrac $ V.foldl max 0 v1 -- | Generic p-norms. The usual norm in R^n is (norm_p 2). -- @@ -156,7 +156,7 @@ instance (RealFloat a, Ord a, Vector v a) => Normed (Vn v a) where -- 5.0 -- norm_p p (Vn v1) = - fromRational $ toRational $ root $ V.sum $ V.map (exponentiate . abs) v1 + realToFrac $ root $ V.sum $ V.map (exponentiate . abs) v1 where exponentiate = (** (fromIntegral p)) root = (** (recip (fromIntegral p)))