diff options
Diffstat (limited to 'packages/base/src/Internal/Util.hs')
-rw-r--r-- | packages/base/src/Internal/Util.hs | 4 |
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 |
256 | norm = pnorm PNorm2 | 256 | norm = pnorm PNorm2 |
257 | 257 | ||
258 | -- | p-norm for vectors, operator norm for matrices | ||
258 | class Normed a | 259 | class 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) | |
323 | norm_Frob :: (Normed (Vector t), Element t) => Matrix t -> R | 324 | norm_Frob :: (Normed (Vector t), Element t) => Matrix t -> R |
324 | norm_Frob = norm_2 . flatten | 325 | norm_Frob = norm_2 . flatten |
325 | 326 | ||
327 | -- | Sum of singular values (Schatten p-norm with p=1) | ||
326 | norm_nuclear :: Field t => Matrix t -> R | 328 | norm_nuclear :: Field t => Matrix t -> R |
327 | norm_nuclear = sumElements . singularValues | 329 | norm_nuclear = sumElements . singularValues |
328 | 330 | ||