summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/Matrix.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2015-06-28 14:18:25 +0200
committerAlberto Ruiz <aruiz@um.es>2015-06-28 14:18:25 +0200
commit2749f4ef144cbc8541d70434f46abf312a1bb42e (patch)
tree7e93d163e0a07e3fc6c1001433be953bcdd197f6 /packages/base/src/Internal/Matrix.hs
parent4d96b90c4cfd38cdb51f3dc66a8a644bd87cdbff (diff)
copy slice
Diffstat (limited to 'packages/base/src/Internal/Matrix.hs')
-rw-r--r--packages/base/src/Internal/Matrix.hs17
1 files changed, 3 insertions, 14 deletions
diff --git a/packages/base/src/Internal/Matrix.hs b/packages/base/src/Internal/Matrix.hs
index bdf2785..8597dcb 100644
--- a/packages/base/src/Internal/Matrix.hs
+++ b/packages/base/src/Internal/Matrix.hs
@@ -142,10 +142,9 @@ a # b = apply a b
142 142
143-------------------------------------------------------------------------------- 143--------------------------------------------------------------------------------
144 144
145extractAll ord m = unsafePerformIO $ 145copy ord m = extractR ord m 0 (idxs[0,rows m-1]) 0 (idxs[0,cols m-1])
146 extractR ord m 146
147 0 (idxs[0,rows m-1]) 147extractAll ord m = unsafePerformIO (copy ord m)
148 0 (idxs[0,cols m-1])
149 148
150{- | Creates a vector by concatenation of rows. If the matrix is ColumnMajor, this operation requires a transpose. 149{- | Creates a vector by concatenation of rows. If the matrix is ColumnMajor, this operation requires a transpose.
151 150
@@ -204,16 +203,6 @@ toRows m
204 sub k = subVector (k*xRow m) (cols m) (xdat m) 203 sub k = subVector (k*xRow m) (cols m) (xdat m)
205 ext k = xdat $ unsafePerformIO $ extractR RowMajor m 1 (idxs[k]) 0 (idxs[0,cols m-1]) 204 ext k = xdat $ unsafePerformIO $ extractR RowMajor m 1 (idxs[k]) 0 (idxs[0,cols m-1])
206 205
207{-
208 | c == 0 = replicate r (fromList[])
209 | otherwise = toRows' 0
210 where
211 v = flatten m
212 r = rows m
213 c = cols m
214 toRows' k | k == r*c = []
215 | otherwise = subVector k c v : toRows' (k+c)
216-}
217 206
218-- | Creates a matrix from a list of vectors, as columns 207-- | Creates a matrix from a list of vectors, as columns
219fromColumns :: Element t => [Vector t] -> Matrix t 208fromColumns :: Element t => [Vector t] -> Matrix t