diff options
Diffstat (limited to 'packages/base/src/Numeric')
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Static.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/base/src/Numeric/LinearAlgebra/Static.hs b/packages/base/src/Numeric/LinearAlgebra/Static.hs index 3b7282a..bd0e593 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Static.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Static.hs | |||
@@ -50,6 +50,8 @@ module Numeric.LinearAlgebra.Static( | |||
50 | -- * Factorizations | 50 | -- * Factorizations |
51 | svd, withCompactSVD, svdTall, svdFlat, Eigen(..), | 51 | svd, withCompactSVD, svdTall, svdFlat, Eigen(..), |
52 | withNullspace, qr, chol, | 52 | withNullspace, qr, chol, |
53 | -- * Norms | ||
54 | Normed(..), | ||
53 | -- * Misc | 55 | -- * Misc |
54 | mean, | 56 | mean, |
55 | Disp(..), Domain(..), | 57 | Disp(..), Domain(..), |
@@ -418,7 +420,7 @@ class Domain field vec mat | mat -> vec field, vec -> mat field, field -> mat ve | |||
418 | diagR :: forall m n k . (KnownNat m, KnownNat n, KnownNat k) => field -> vec k -> mat m n | 420 | diagR :: forall m n k . (KnownNat m, KnownNat n, KnownNat k) => field -> vec k -> mat m n |
419 | dvmap :: forall n. (field -> field) -> vec n -> vec n | 421 | dvmap :: forall n. (field -> field) -> vec n -> vec n |
420 | dmmap :: forall n m. (field -> field) -> mat n m -> mat n m | 422 | dmmap :: forall n m. (field -> field) -> mat n m -> mat n m |
421 | outer :: forall n m. vec n -> vec m -> mat n m | 423 | outer :: forall n m. (KnownNat m, KnownNat n) => vec n -> vec m -> mat n m |
422 | 424 | ||
423 | 425 | ||
424 | instance Domain ℝ R L | 426 | instance Domain ℝ R L |
@@ -481,8 +483,8 @@ crossR (extract -> x) (extract -> y) = vec3 z1 z2 z3 | |||
481 | z2 = x!2*y!0-x!0*y!2 | 483 | z2 = x!2*y!0-x!0*y!2 |
482 | z3 = x!0*y!1-x!1*y!0 | 484 | z3 = x!0*y!1-x!1*y!0 |
483 | 485 | ||
484 | outerR :: R n -> R m -> L n m | 486 | outerR :: (KnownNat m, KnownNat n) => R n -> R m -> L n m |
485 | outerR (R (Dim x)) (R (Dim y)) = mkL (LA.outer x y) | 487 | outerR (extract -> x) (extract -> y) = mkL (LA.outer x y) |
486 | 488 | ||
487 | mapR :: (ℝ -> ℝ) -> R n -> R n | 489 | mapR :: (ℝ -> ℝ) -> R n -> R n |
488 | mapR f (R (Dim v)) = R (Dim (LA.cmap f v)) | 490 | mapR f (R (Dim v)) = R (Dim (LA.cmap f v)) |
@@ -528,8 +530,8 @@ crossC (extract -> x) (extract -> y) = mkC (LA.fromList [z1, z2, z3]) | |||
528 | z2 = x!2*y!0-x!0*y!2 | 530 | z2 = x!2*y!0-x!0*y!2 |
529 | z3 = x!0*y!1-x!1*y!0 | 531 | z3 = x!0*y!1-x!1*y!0 |
530 | 532 | ||
531 | outerC :: C n -> C m -> M n m | 533 | outerC :: (KnownNat m, KnownNat n) => C n -> C m -> M n m |
532 | outerC (C (Dim x)) (C (Dim y)) = mkM (LA.outer x y) | 534 | outerC (extract -> x) (extract -> y) = mkM (LA.outer x y) |
533 | 535 | ||
534 | mapC :: (ℂ -> ℂ) -> C n -> C n | 536 | mapC :: (ℂ -> ℂ) -> C n -> C n |
535 | mapC f (C (Dim v)) = C (Dim (LA.cmap f v)) | 537 | mapC f (C (Dim v)) = C (Dim (LA.cmap f v)) |