From c2b3835a9a43d822d6134ef51a9ec9627a9e95c3 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Thu, 24 Apr 2014 14:12:26 +0200 Subject: fix documentation --- lib/Data/Packed/Internal/Vector.hs | 2 -- lib/Data/Packed/Matrix.hs | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'lib/Data/Packed') 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) {- | An alternative to 'fromList' with explicit dimension. The input list is explicitly truncated if it is too long, so it may safely be used, for instance, with infinite lists. - - This is the format used in the instances for Show (Vector a). -} (|>) :: (Storable a) => Int -> [a] -> Vector a infixl 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 joinHoriz :: Element t => [Matrix t] -> Matrix t joinHoriz ms = trans. joinVert . map trans $ ms -{- | Creates a matrix from blocks given as a list of lists of matrices. +{- | Create a matrix from blocks given as a list of lists of matrices. -Single row/column components are automatically expanded to match the +Single row-column components are automatically expanded to match the corresponding common row and column: -@\> let disp = putStr . dispf 2 -\> let vector xs = fromList xs :: Vector Double -\> let diagl = diag . vector -\> let rowm = asRow . vector +@ +> let disp = putStr . dispf 2 +> let vector xs = fromList xs :: Vector Double +> let diagl = diag . vector +> let rowm = asRow . vector -\> disp $ fromBlocks [[ident 5, 7, rowm[10,20]], [3, diagl[1,2,3], 0]] +> disp $ fromBlocks [[ident 5, 7, rowm[10,20]], [3, diagl[1,2,3], 0]] 8x10 1 0 0 0 0 7 7 7 10 20 @@ -129,7 +130,9 @@ corresponding common row and column: 0 0 0 0 1 7 7 7 10 20 3 3 3 3 3 1 0 0 0 0 3 3 3 3 3 0 2 0 0 0 -3 3 3 3 3 0 0 3 0 0@ +3 3 3 3 3 0 0 3 0 0 +@ + -} fromBlocks :: Element t => [[Matrix t]] -> Matrix t fromBlocks = fromBlocksRaw . adaptBlocks -- cgit v1.2.3