-- | l2 norm of vector
norm :: (Eq a, Num a, Floating a, DIM n) => SparseVector n a -> a
norm v = sqrt $ sum $ fmap (^ (2::Int)) v
norm :: (Eq a, Num a, Floating a, DIM n) => SparseVector n a -> a
norm v = sqrt $ sum $ fmap (^ (2::Int)) v
norm v = sqrt $ sum $ fmap (^ (2::Int)) v