diff options
Diffstat (limited to 'packages/base')
-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 720b011..6d828d7 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 |
@@ -296,6 +297,20 @@ her :: KnownNat n => M n n -> Her n | |||
296 | her m = Her $ (m + LA.tr m)/2 | 297 | her m = Her $ (m + LA.tr m)/2 |
297 | 298 | ||
298 | 299 | ||
300 | instance (KnownNat n) => Disp (Sym n) | ||
301 | where | ||
302 | disp n (Sym x) = do | ||
303 | let a = extract x | ||
304 | let su = LA.dispf n a | ||
305 | printf "Sym %d" (cols a) >> putStr (dropWhile (/='\n') $ su) | ||
306 | |||
307 | instance (KnownNat n) => Disp (Her n) | ||
308 | where | ||
309 | disp n (Her x) = do | ||
310 | let a = extract x | ||
311 | let su = LA.dispcf n a | ||
312 | printf "Her %d" (cols a) >> putStr (dropWhile (/='\n') $ su) | ||
313 | |||
299 | 314 | ||
300 | instance KnownNat n => Eigen (Sym n) (R n) (L n n) | 315 | instance KnownNat n => Eigen (Sym n) (R n) (L n n) |
301 | where | 316 | where |