diff options
author | Alberto Ruiz <aruiz@um.es> | 2014-05-24 20:33:05 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2014-05-24 20:33:05 +0200 |
commit | 365e2435e71de10ebe849acac5a107b6f43817c4 (patch) | |
tree | 08e0e8573c86f28bda920709ae84a1f2fd4911ee /packages/base/src/Numeric/LinearAlgebra/Util.hs | |
parent | 5b6de561f131d75049fdb999e98a07939ec2e8e7 (diff) |
initial support for static dimension checking
Diffstat (limited to 'packages/base/src/Numeric/LinearAlgebra/Util.hs')
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Util.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/base/src/Numeric/LinearAlgebra/Util.hs b/packages/base/src/Numeric/LinearAlgebra/Util.hs index a7d6946..a319785 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Util.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Util.hs | |||
@@ -28,6 +28,7 @@ module Numeric.LinearAlgebra.Util( | |||
28 | (&), (¦), (——), (#), | 28 | (&), (¦), (——), (#), |
29 | (?), (¿), | 29 | (?), (¿), |
30 | Indexable(..), size, | 30 | Indexable(..), size, |
31 | Numeric, | ||
31 | rand, randn, | 32 | rand, randn, |
32 | cross, | 33 | cross, |
33 | norm, | 34 | norm, |
@@ -101,6 +102,19 @@ mat | |||
101 | -> Matrix ℝ | 102 | -> Matrix ℝ |
102 | mat c = reshape c . fromList | 103 | mat c = reshape c . fromList |
103 | 104 | ||
105 | |||
106 | |||
107 | class ( Container Vector t | ||
108 | , Container Matrix t | ||
109 | , Konst t Int Vector | ||
110 | , Konst t (Int,Int) Matrix | ||
111 | ) => Numeric t | ||
112 | |||
113 | instance Numeric Double | ||
114 | instance Numeric (Complex Double) | ||
115 | |||
116 | |||
117 | |||
104 | {- | print a real matrix with given number of digits after the decimal point | 118 | {- | print a real matrix with given number of digits after the decimal point |
105 | 119 | ||
106 | >>> disp 5 $ ident 2 / 3 | 120 | >>> disp 5 $ ident 2 / 3 |