diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-10-31 13:36:37 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-10-31 13:36:37 +0000 |
commit | db223fb5f9cd4adef54736812f796b48ecc289e6 (patch) | |
tree | f787f8d7c929f2b978bb8fd6aa83aa1b5db05339 /lib/Numeric/LinearAlgebra/Linear.hs | |
parent | bf838323545fe0878382f8f4d41b0f36714afa43 (diff) |
Field->Element, GenMat->Field
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Linear.hs')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Linear.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Numeric/LinearAlgebra/Linear.hs b/lib/Numeric/LinearAlgebra/Linear.hs index 94f6958..13d69ab 100644 --- a/lib/Numeric/LinearAlgebra/Linear.hs +++ b/lib/Numeric/LinearAlgebra/Linear.hs | |||
@@ -84,7 +84,7 @@ instance Linear Matrix (Complex Double) where | |||
84 | -------------------------------------------------- | 84 | -------------------------------------------------- |
85 | 85 | ||
86 | -- | euclidean inner product | 86 | -- | euclidean inner product |
87 | dot :: (Field t) => Vector t -> Vector t -> t | 87 | dot :: (Element t) => Vector t -> Vector t -> t |
88 | dot u v = dat (multiply r c) `at` 0 | 88 | dot u v = dat (multiply r c) `at` 0 |
89 | where r = asRow u | 89 | where r = asRow u |
90 | c = asColumn v | 90 | c = asColumn v |
@@ -98,7 +98,7 @@ dot u v = dat (multiply r c) `at` 0 | |||
98 | , 10.0, 4.0, 6.0 | 98 | , 10.0, 4.0, 6.0 |
99 | , 15.0, 6.0, 9.0 ]@ | 99 | , 15.0, 6.0, 9.0 ]@ |
100 | -} | 100 | -} |
101 | outer :: (Field t) => Vector t -> Vector t -> Matrix t | 101 | outer :: (Element t) => Vector t -> Vector t -> Matrix t |
102 | outer u v = asColumn u `multiply` asRow v | 102 | outer u v = asColumn u `multiply` asRow v |
103 | 103 | ||
104 | {- | Kronecker product of two matrices. | 104 | {- | Kronecker product of two matrices. |
@@ -123,7 +123,7 @@ m2=(4><3) | |||
123 | , 0.0, 0.0, 0.0, -7.0, -8.0, -9.0, 21.0, 24.0, 27.0 | 123 | , 0.0, 0.0, 0.0, -7.0, -8.0, -9.0, 21.0, 24.0, 27.0 |
124 | , 0.0, 0.0, 0.0, -10.0, -11.0, -12.0, 30.0, 33.0, 36.0 ]@ | 124 | , 0.0, 0.0, 0.0, -10.0, -11.0, -12.0, 30.0, 33.0, 36.0 ]@ |
125 | -} | 125 | -} |
126 | kronecker :: (Field t) => Matrix t -> Matrix t -> Matrix t | 126 | kronecker :: (Element t) => Matrix t -> Matrix t -> Matrix t |
127 | kronecker a b = fromBlocks | 127 | kronecker a b = fromBlocks |
128 | . partit (cols a) | 128 | . partit (cols a) |
129 | . map (reshape (cols b)) | 129 | . map (reshape (cols b)) |