diff options
author | Alberto Ruiz <aruiz@um.es> | 2016-05-28 13:51:05 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2016-05-28 13:51:05 +0200 |
commit | 9aade51bd0bb6339cfa8aca014bd96f801d9b19e (patch) | |
tree | 1c96ece927e8252501eadce0a228d4221984faa7 /packages/base/src/Internal/Static.hs | |
parent | 42a88fbcb6bd1d2c4dc18fae5e962bd34fb316a1 (diff) | |
parent | cd6caa8f08e686fd4a90dae5f3414264aa2700a0 (diff) |
Merge pull request #191 from mstksg/static
[In Progress] Ongoing porting of functionality to Static module
Diffstat (limited to 'packages/base/src/Internal/Static.hs')
-rw-r--r-- | packages/base/src/Internal/Static.hs | 23 |
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 | ||
521 | instance Additive (R n) where | ||
522 | add = (+) | ||
523 | |||
524 | instance Additive (C n) where | ||
525 | add = (+) | ||
526 | |||
527 | instance (KnownNat m, KnownNat n) => Additive (L m n) where | ||
528 | add = (+) | ||
529 | |||
530 | instance (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 | ||
570 | overMatL' :: (KnownNat m, KnownNat n) | ||
571 | => (LA.Matrix ℝ -> LA.Matrix ℝ) -> L m n -> L m n | ||
572 | overMatL' f = mkL . f . unwrap | ||
573 | {-# INLINE overMatL' #-} | ||
574 | |||
575 | overMatM' :: (KnownNat m, KnownNat n) | ||
576 | => (LA.Matrix ℂ -> LA.Matrix ℂ) -> M m n -> M m n | ||
577 | overMatM' f = mkM . f . unwrap | ||
578 | {-# INLINE overMatM' #-} | ||
579 | |||
580 | |||
558 | #else | 581 | #else |
559 | 582 | ||
560 | module Numeric.LinearAlgebra.Static.Internal where | 583 | module Numeric.LinearAlgebra.Static.Internal where |