summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Matrix.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Data/Packed/Matrix.hs')
-rw-r--r--lib/Data/Packed/Matrix.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Data/Packed/Matrix.hs b/lib/Data/Packed/Matrix.hs
index 2efb08d..de2300a 100644
--- a/lib/Data/Packed/Matrix.hs
+++ b/lib/Data/Packed/Matrix.hs
@@ -269,7 +269,7 @@ Hilbert matrix of order N:
269-} 269-}
270buildMatrix :: Element a => Int -> Int -> ((Int, Int) -> a) -> Matrix a 270buildMatrix :: Element a => Int -> Int -> ((Int, Int) -> a) -> Matrix a
271buildMatrix rc cc f = 271buildMatrix rc cc f =
272 fromLists $ map (\x -> map f x) 272 fromLists $ map (map f)
273 $ map (\ ri -> map (\ ci -> (ri, ci)) [0 .. (cc - 1)]) [0 .. (rc - 1)] 273 $ map (\ ri -> map (\ ci -> (ri, ci)) [0 .. (cc - 1)]) [0 .. (rc - 1)]
274 274
275----------------------------------------------------- 275-----------------------------------------------------
@@ -283,7 +283,7 @@ fromArray2D m = (r><c) (elems m)
283 283
284-- | rearranges the rows of a matrix according to the order given in a list of integers. 284-- | rearranges the rows of a matrix according to the order given in a list of integers.
285extractRows :: Element t => [Int] -> Matrix t -> Matrix t 285extractRows :: Element t => [Int] -> Matrix t -> Matrix t
286extractRows l m = fromRows $ extract (toRows $ m) l 286extractRows l m = fromRows $ extract (toRows m) l
287 where extract l' is = [l'!!i |i<-is] 287 where extract l' is = [l'!!i |i<-is]
288 288
289{- | creates matrix by repetition of a matrix a given number of rows and columns 289{- | creates matrix by repetition of a matrix a given number of rows and columns