summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/Util.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Internal/Util.hs')
-rw-r--r--packages/base/src/Internal/Util.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/base/src/Internal/Util.hs b/packages/base/src/Internal/Util.hs
index cf42961..7f52a9c 100644
--- a/packages/base/src/Internal/Util.hs
+++ b/packages/base/src/Internal/Util.hs
@@ -255,6 +255,7 @@ norm :: Vector Double -> Double
255-- ^ 2-norm of real vector 255-- ^ 2-norm of real vector
256norm = pnorm PNorm2 256norm = pnorm PNorm2
257 257
258-- | p-norm for vectors, operator norm for matrices
258class Normed a 259class Normed a
259 where 260 where
260 norm_0 :: a -> R 261 norm_0 :: a -> R
@@ -319,10 +320,11 @@ instance Normed (Vector (Complex Float))
319 norm_2 = norm_2 . double 320 norm_2 = norm_2 . double
320 norm_Inf = norm_Inf . double 321 norm_Inf = norm_Inf . double
321 322
322 323-- | Frobenius norm (Schatten p-norm with p=2)
323norm_Frob :: (Normed (Vector t), Element t) => Matrix t -> R 324norm_Frob :: (Normed (Vector t), Element t) => Matrix t -> R
324norm_Frob = norm_2 . flatten 325norm_Frob = norm_2 . flatten
325 326
327-- | Sum of singular values (Schatten p-norm with p=1)
326norm_nuclear :: Field t => Matrix t -> R 328norm_nuclear :: Field t => Matrix t -> R
327norm_nuclear = sumElements . singularValues 329norm_nuclear = sumElements . singularValues
328 330