summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2014-04-24 14:12:26 +0200
committerAlberto Ruiz <aruiz@um.es>2014-04-24 14:12:26 +0200
commitc2b3835a9a43d822d6134ef51a9ec9627a9e95c3 (patch)
tree286ee4adf6c37b27edc68e2285ea005fec917dbd
parente97817e947520c40c9520618c5d5d56747e4c0f1 (diff)
fix documentation
-rw-r--r--CHANGELOG2
-rw-r--r--lib/Data/Packed/Internal/Vector.hs2
-rw-r--r--lib/Data/Packed/Matrix.hs19
3 files changed, 13 insertions, 10 deletions
diff --git a/CHANGELOG b/CHANGELOG
index d288f37..393c52a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -11,6 +11,8 @@
11 11
12 * added a general multiplication operator (×) 12 * added a general multiplication operator (×)
13 13
14 * improved build and konst
15
14 * Plot functions moved to Numeric.LinearAlgebra.Util 16 * Plot functions moved to Numeric.LinearAlgebra.Util
15 * removed (!) (use (¦) instead) 17 * removed (!) (use (¦) instead)
16 18
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs
index e5c3196..f0bd9aa 100644
--- a/lib/Data/Packed/Internal/Vector.hs
+++ b/lib/Data/Packed/Internal/Vector.hs
@@ -123,8 +123,6 @@ toList v = safeRead v $ peekArray (dim v)
123{- | An alternative to 'fromList' with explicit dimension. The input 123{- | An alternative to 'fromList' with explicit dimension. The input
124 list is explicitly truncated if it is too long, so it may safely 124 list is explicitly truncated if it is too long, so it may safely
125 be used, for instance, with infinite lists. 125 be used, for instance, with infinite lists.
126
127 This is the format used in the instances for Show (Vector a).
128-} 126-}
129(|>) :: (Storable a) => Int -> [a] -> Vector a 127(|>) :: (Storable a) => Int -> [a] -> Vector a
130infixl 9 |> 128infixl 9 |>
diff --git a/lib/Data/Packed/Matrix.hs b/lib/Data/Packed/Matrix.hs
index ab02670..2ab1541 100644
--- a/lib/Data/Packed/Matrix.hs
+++ b/lib/Data/Packed/Matrix.hs
@@ -109,17 +109,18 @@ joinVert ms = case common cols ms of
109joinHoriz :: Element t => [Matrix t] -> Matrix t 109joinHoriz :: Element t => [Matrix t] -> Matrix t
110joinHoriz ms = trans. joinVert . map trans $ ms 110joinHoriz ms = trans. joinVert . map trans $ ms
111 111
112{- | Creates a matrix from blocks given as a list of lists of matrices. 112{- | Create a matrix from blocks given as a list of lists of matrices.
113 113
114Single row/column components are automatically expanded to match the 114Single row-column components are automatically expanded to match the
115corresponding common row and column: 115corresponding common row and column:
116 116
117@\> let disp = putStr . dispf 2 117@
118\> let vector xs = fromList xs :: Vector Double 118> let disp = putStr . dispf 2
119\> let diagl = diag . vector 119> let vector xs = fromList xs :: Vector Double
120\> let rowm = asRow . vector 120> let diagl = diag . vector
121> let rowm = asRow . vector
121 122
122\> disp $ fromBlocks [[ident 5, 7, rowm[10,20]], [3, diagl[1,2,3], 0]] 123> disp $ fromBlocks [[ident 5, 7, rowm[10,20]], [3, diagl[1,2,3], 0]]
123 124
1248x10 1258x10
1251 0 0 0 0 7 7 7 10 20 1261 0 0 0 0 7 7 7 10 20
@@ -129,7 +130,9 @@ corresponding common row and column:
1290 0 0 0 1 7 7 7 10 20 1300 0 0 0 1 7 7 7 10 20
1303 3 3 3 3 1 0 0 0 0 1313 3 3 3 3 1 0 0 0 0
1313 3 3 3 3 0 2 0 0 0 1323 3 3 3 3 0 2 0 0 0
1323 3 3 3 3 0 0 3 0 0@ 1333 3 3 3 3 0 0 3 0 0
134@
135
133-} 136-}
134fromBlocks :: Element t => [[Matrix t]] -> Matrix t 137fromBlocks :: Element t => [[Matrix t]] -> Matrix t
135fromBlocks = fromBlocksRaw . adaptBlocks 138fromBlocks = fromBlocksRaw . adaptBlocks