diff options
author | Justin Le <justin@jle.im> | 2016-01-07 03:25:31 -0800 |
---|---|---|
committer | Justin Le <justin@jle.im> | 2016-01-07 03:25:31 -0800 |
commit | 1fb68521db98ca2bfe1748c82e48b8845c3252d2 (patch) | |
tree | 9af49a8266d33a1b34950568c86d9ced645d0a49 /packages | |
parent | a262e233fc1da0aa01148fd6532c85a6b59e5a75 (diff) |
reverted my previous 'bug fixes', because it should be safe to use unwrap instead of extract for mapX functions
Diffstat (limited to 'packages')
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Static.hs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/base/src/Numeric/LinearAlgebra/Static.hs b/packages/base/src/Numeric/LinearAlgebra/Static.hs index 86c13d7..9a2bdc8 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Static.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Static.hs | |||
@@ -595,13 +595,14 @@ outerR :: (KnownNat m, KnownNat n) => R n -> R m -> L n m | |||
595 | outerR (extract -> x) (extract -> y) = mkL (LA.outer x y) | 595 | outerR (extract -> x) (extract -> y) = mkL (LA.outer x y) |
596 | 596 | ||
597 | mapR :: KnownNat n => (ℝ -> ℝ) -> R n -> R n | 597 | mapR :: KnownNat n => (ℝ -> ℝ) -> R n -> R n |
598 | mapR f (extract -> v) = mkR (LA.cmap f v) | 598 | mapR f (unwrap -> v) = mkR (LA.cmap f v) |
599 | 599 | ||
600 | zipWithR :: KnownNat n => (ℝ -> ℝ -> ℝ) -> R n -> R n -> R n | 600 | zipWithR :: KnownNat n => (ℝ -> ℝ -> ℝ) -> R n -> R n -> R n |
601 | zipWithR f (extract -> x) (extract -> y) = mkR (LA.zipVectorWith f x y) | 601 | zipWithR f (extract -> x) (extract -> y) = mkR (LA.zipVectorWith f x y) |
602 | 602 | ||
603 | mapM' :: (KnownNat n, KnownNat m) => (ℂ -> ℂ) -> M n m -> M n m | 603 | mapL :: (KnownNat n, KnownNat m) => (ℝ -> ℝ) -> L n m -> L n m |
604 | mapM' f (extract -> m) = mkM (LA.cmap f m) | 604 | mapL f (unwrap -> m) = mkL (LA.cmap f m) |
605 | |||
605 | 606 | ||
606 | -------------------------------------------------------------------------------- | 607 | -------------------------------------------------------------------------------- |
607 | 608 | ||
@@ -645,13 +646,14 @@ outerC :: (KnownNat m, KnownNat n) => C n -> C m -> M n m | |||
645 | outerC (extract -> x) (extract -> y) = mkM (LA.outer x y) | 646 | outerC (extract -> x) (extract -> y) = mkM (LA.outer x y) |
646 | 647 | ||
647 | mapC :: KnownNat n => (ℂ -> ℂ) -> C n -> C n | 648 | mapC :: KnownNat n => (ℂ -> ℂ) -> C n -> C n |
648 | mapC f (extract -> v) = mkC (LA.cmap f v) | 649 | mapC f (unwrap -> v) = mkC (LA.cmap f v) |
649 | 650 | ||
650 | zipWithC :: KnownNat n => (ℂ -> ℂ -> ℂ) -> C n -> C n -> C n | 651 | zipWithC :: KnownNat n => (ℂ -> ℂ -> ℂ) -> C n -> C n -> C n |
651 | zipWithC f (extract -> x) (extract -> y) = mkC (LA.zipVectorWith f x y) | 652 | zipWithC f (extract -> x) (extract -> y) = mkC (LA.zipVectorWith f x y) |
652 | 653 | ||
653 | mapL :: (KnownNat n, KnownNat m) => (ℝ -> ℝ) -> L n m -> L n m | 654 | mapM' :: (KnownNat n, KnownNat m) => (ℂ -> ℂ) -> M n m -> M n m |
654 | mapL f (extract -> m) = mkL (LA.cmap f m) | 655 | mapM' f (unwrap -> m) = mkM (LA.cmap f m) |
656 | |||
655 | 657 | ||
656 | -------------------------------------------------------------------------------- | 658 | -------------------------------------------------------------------------------- |
657 | 659 | ||