summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/base/src/Numeric/LinearAlgebra/Static.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/base/src/Numeric/LinearAlgebra/Static.hs b/packages/base/src/Numeric/LinearAlgebra/Static.hs
index 1ab7e57..e18ba0c 100644
--- a/packages/base/src/Numeric/LinearAlgebra/Static.hs
+++ b/packages/base/src/Numeric/LinearAlgebra/Static.hs
@@ -77,6 +77,7 @@ import qualified Numeric.LinearAlgebra.Devel as LA
77import Data.Proxy(Proxy(..)) 77import Data.Proxy(Proxy(..))
78import Internal.Static 78import Internal.Static
79import Control.Arrow((***)) 79import Control.Arrow((***))
80import Text.Printf
80 81
81ud1 :: R n -> Vector ℝ 82ud1 :: R n -> Vector ℝ
82ud1 (R (Dim v)) = v 83ud1 (R (Dim v)) = v
@@ -291,6 +292,20 @@ her :: KnownNat n => M n n -> Her n
291her m = Her $ (m + LA.tr m)/2 292her m = Her $ (m + LA.tr m)/2
292 293
293 294
295instance (KnownNat n) => Disp (Sym n)
296 where
297 disp n (Sym x) = do
298 let a = extract x
299 let su = LA.dispf n a
300 printf "Sym %d" (cols a) >> putStr (dropWhile (/='\n') $ su)
301
302instance (KnownNat n) => Disp (Her n)
303 where
304 disp n (Her x) = do
305 let a = extract x
306 let su = LA.dispcf n a
307 printf "Her %d" (cols a) >> putStr (dropWhile (/='\n') $ su)
308
294 309
295instance KnownNat n => Eigen (Sym n) (R n) (L n n) 310instance KnownNat n => Eigen (Sym n) (R n) (L n n)
296 where 311 where