summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorJustin Le <justin@jle.im>2016-01-07 03:25:31 -0800
committerJustin Le <justin@jle.im>2016-01-07 03:25:31 -0800
commit1fb68521db98ca2bfe1748c82e48b8845c3252d2 (patch)
tree9af49a8266d33a1b34950568c86d9ced645d0a49 /packages
parenta262e233fc1da0aa01148fd6532c85a6b59e5a75 (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.hs14
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
595outerR (extract -> x) (extract -> y) = mkL (LA.outer x y) 595outerR (extract -> x) (extract -> y) = mkL (LA.outer x y)
596 596
597mapR :: KnownNat n => (ℝ -> ℝ) -> R n -> R n 597mapR :: KnownNat n => (ℝ -> ℝ) -> R n -> R n
598mapR f (extract -> v) = mkR (LA.cmap f v) 598mapR f (unwrap -> v) = mkR (LA.cmap f v)
599 599
600zipWithR :: KnownNat n => (ℝ -> ℝ -> ℝ) -> R n -> R n -> R n 600zipWithR :: KnownNat n => (ℝ -> ℝ -> ℝ) -> R n -> R n -> R n
601zipWithR f (extract -> x) (extract -> y) = mkR (LA.zipVectorWith f x y) 601zipWithR f (extract -> x) (extract -> y) = mkR (LA.zipVectorWith f x y)
602 602
603mapM' :: (KnownNat n, KnownNat m) => (ℂ -> ℂ) -> M n m -> M n m 603mapL :: (KnownNat n, KnownNat m) => (ℝ -> ℝ) -> L n m -> L n m
604mapM' f (extract -> m) = mkM (LA.cmap f m) 604mapL 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
645outerC (extract -> x) (extract -> y) = mkM (LA.outer x y) 646outerC (extract -> x) (extract -> y) = mkM (LA.outer x y)
646 647
647mapC :: KnownNat n => (ℂ -> ℂ) -> C n -> C n 648mapC :: KnownNat n => (ℂ -> ℂ) -> C n -> C n
648mapC f (extract -> v) = mkC (LA.cmap f v) 649mapC f (unwrap -> v) = mkC (LA.cmap f v)
649 650
650zipWithC :: KnownNat n => (ℂ -> ℂ -> ℂ) -> C n -> C n -> C n 651zipWithC :: KnownNat n => (ℂ -> ℂ -> ℂ) -> C n -> C n -> C n
651zipWithC f (extract -> x) (extract -> y) = mkC (LA.zipVectorWith f x y) 652zipWithC f (extract -> x) (extract -> y) = mkC (LA.zipVectorWith f x y)
652 653
653mapL :: (KnownNat n, KnownNat m) => (ℝ -> ℝ) -> L n m -> L n m 654mapM' :: (KnownNat n, KnownNat m) => (ℂ -> ℂ) -> M n m -> M n m
654mapL f (extract -> m) = mkL (LA.cmap f m) 655mapM' f (unwrap -> m) = mkM (LA.cmap f m)
656
655 657
656-------------------------------------------------------------------------------- 658--------------------------------------------------------------------------------
657 659