summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2016-05-28 13:51:05 +0200
committerAlberto Ruiz <aruiz@um.es>2016-05-28 13:51:05 +0200
commit9aade51bd0bb6339cfa8aca014bd96f801d9b19e (patch)
tree1c96ece927e8252501eadce0a228d4221984faa7 /packages/base/src/Internal
parent42a88fbcb6bd1d2c4dc18fae5e962bd34fb316a1 (diff)
parentcd6caa8f08e686fd4a90dae5f3414264aa2700a0 (diff)
Merge pull request #191 from mstksg/static
[In Progress] Ongoing porting of functionality to Static module
Diffstat (limited to 'packages/base/src/Internal')
-rw-r--r--packages/base/src/Internal/Static.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/base/src/Internal/Static.hs b/packages/base/src/Internal/Static.hs
index 381f3bc..f9dfff0 100644
--- a/packages/base/src/Internal/Static.hs
+++ b/packages/base/src/Internal/Static.hs
@@ -518,6 +518,18 @@ instance (KnownNat n, KnownNat m) => Floating (M n m) where
518 (**) = lift2MD (**) 518 (**) = lift2MD (**)
519 pi = M pi 519 pi = M pi
520 520
521instance Additive (R n) where
522 add = (+)
523
524instance Additive (C n) where
525 add = (+)
526
527instance (KnownNat m, KnownNat n) => Additive (L m n) where
528 add = (+)
529
530instance (KnownNat m, KnownNat n) => Additive (M m n) where
531 add = (+)
532
521-------------------------------------------------------------------------------- 533--------------------------------------------------------------------------------
522 534
523 535
@@ -555,6 +567,17 @@ instance KnownNat n => Disp (C n)
555 567
556-------------------------------------------------------------------------------- 568--------------------------------------------------------------------------------
557 569
570overMatL' :: (KnownNat m, KnownNat n)
571 => (LA.Matrix ℝ -> LA.Matrix ℝ) -> L m n -> L m n
572overMatL' f = mkL . f . unwrap
573{-# INLINE overMatL' #-}
574
575overMatM' :: (KnownNat m, KnownNat n)
576 => (LA.Matrix ℂ -> LA.Matrix ℂ) -> M m n -> M m n
577overMatM' f = mkM . f . unwrap
578{-# INLINE overMatM' #-}
579
580
558#else 581#else
559 582
560module Numeric.LinearAlgebra.Static.Internal where 583module Numeric.LinearAlgebra.Static.Internal where