diff options
Diffstat (limited to 'packages/base/src/Numeric')
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Static.hs | 15 |
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 | |||
77 | import Data.Proxy(Proxy(..)) | 77 | import Data.Proxy(Proxy(..)) |
78 | import Internal.Static | 78 | import Internal.Static |
79 | import Control.Arrow((***)) | 79 | import Control.Arrow((***)) |
80 | import Text.Printf | ||
80 | 81 | ||
81 | ud1 :: R n -> Vector ℝ | 82 | ud1 :: R n -> Vector ℝ |
82 | ud1 (R (Dim v)) = v | 83 | ud1 (R (Dim v)) = v |
@@ -291,6 +292,20 @@ her :: KnownNat n => M n n -> Her n | |||
291 | her m = Her $ (m + LA.tr m)/2 | 292 | her m = Her $ (m + LA.tr m)/2 |
292 | 293 | ||
293 | 294 | ||
295 | instance (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 | |||
302 | instance (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 | ||
295 | instance KnownNat n => Eigen (Sym n) (R n) (L n n) | 310 | instance KnownNat n => Eigen (Sym n) (R n) (L n n) |
296 | where | 311 | where |