-- >>> 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).
--
-- 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)))