From 778e63dcc2b348914a4f6975f5328ff7fd25638a Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Thu, 23 Sep 2010 08:04:33 +0000 Subject: experimental build, build', konst' --- lib/Data/Packed/Matrix.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/Data') diff --git a/lib/Data/Packed/Matrix.hs b/lib/Data/Packed/Matrix.hs index e046ead..1fa8903 100644 --- a/lib/Data/Packed/Matrix.hs +++ b/lib/Data/Packed/Matrix.hs @@ -252,13 +252,18 @@ asColumn v = reshape 1 v {- | creates a Matrix of the specified size using the supplied function to - to map the row/column position to the value at that row/column position. + to map the row\/column position to the value at that row\/column position. @> buildMatrix 3 4 (\ (r,c) -> fromIntegral r * fromIntegral c) (3><4) [ 0.0, 0.0, 0.0, 0.0, 0.0 , 0.0, 1.0, 2.0, 3.0, 4.0 , 0.0, 2.0, 4.0, 6.0, 8.0]@ + +Hilbert matrix of order N: + +@hilb n = buildMatrix n n (\(i,j)->1/(fromIntegral i + fromIntegral j +1))@ + -} buildMatrix :: Element a => Int -> Int -> ((Int, Int) -> a) -> Matrix a buildMatrix rc cc f = -- cgit v1.2.3