summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/Static.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Internal/Static.hs')
-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