diff options
Diffstat (limited to 'packages/base')
-rw-r--r-- | packages/base/src/Internal/IO.hs (renamed from packages/base/src/Data/Packed/IO.hs) | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/packages/base/src/Data/Packed/IO.hs b/packages/base/src/Internal/IO.hs index b0999a8..e594a1c 100644 --- a/packages/base/src/Data/Packed/IO.hs +++ b/packages/base/src/Internal/IO.hs | |||
@@ -1,6 +1,6 @@ | |||
1 | ----------------------------------------------------------------------------- | 1 | ----------------------------------------------------------------------------- |
2 | -- | | 2 | -- | |
3 | -- Module : Data.Packed.IO | 3 | -- Module : Internal.IO |
4 | -- Copyright : (c) Alberto Ruiz 2010 | 4 | -- Copyright : (c) Alberto Ruiz 2010 |
5 | -- License : BSD3 | 5 | -- License : BSD3 |
6 | -- | 6 | -- |
@@ -10,19 +10,22 @@ | |||
10 | -- Display, formatting and IO functions for numeric 'Vector' and 'Matrix' | 10 | -- Display, formatting and IO functions for numeric 'Vector' and 'Matrix' |
11 | -- | 11 | -- |
12 | ----------------------------------------------------------------------------- | 12 | ----------------------------------------------------------------------------- |
13 | {-# OPTIONS_HADDOCK hide #-} | ||
14 | 13 | ||
15 | module Data.Packed.IO ( | 14 | module Internal.IO ( |
16 | dispf, disps, dispcf, vecdisp, latexFormat, format, | 15 | dispf, disps, dispcf, vecdisp, latexFormat, format, |
17 | readMatrix, fromArray2D, loadMatrix, loadMatrix', saveMatrix | 16 | loadMatrix, loadMatrix', saveMatrix |
18 | ) where | 17 | ) where |
19 | 18 | ||
20 | import Data.Packed | 19 | import Internal.Tools |
20 | import Internal.Devel | ||
21 | import Internal.Vector | ||
22 | import Internal.Matrix | ||
23 | import Internal.Vectorized | ||
21 | import Text.Printf(printf) | 24 | import Text.Printf(printf) |
22 | import Data.List(intersperse) | 25 | import Data.List(intersperse) |
23 | import Data.Complex | 26 | import Data.Complex |
24 | import Numeric.Vectorized(vectorScan,saveMatrix) | 27 | |
25 | import Data.Packed.Internal | 28 | |
26 | 29 | ||
27 | {- | Creates a string from a matrix given a separator and a function to show each entry. Using | 30 | {- | Creates a string from a matrix given a separator and a function to show each entry. Using |
28 | this function the user can easily define any desired display function: | 31 | this function the user can easily define any desired display function: |
@@ -136,12 +139,6 @@ dispcf d m = sdims m ++ "\n" ++ format " " (showComplex d) m | |||
136 | 139 | ||
137 | -------------------------------------------------------------------- | 140 | -------------------------------------------------------------------- |
138 | 141 | ||
139 | -- | reads a matrix from a string containing a table of numbers. | ||
140 | readMatrix :: String -> Matrix Double | ||
141 | readMatrix = fromLists . map (map read). map words . filter (not.null) . lines | ||
142 | |||
143 | -------------------------------------------------------------------------------- | ||
144 | |||
145 | apparentCols :: FilePath -> IO Int | 142 | apparentCols :: FilePath -> IO Int |
146 | apparentCols s = f . dropWhile null . map words . lines <$> readFile s | 143 | apparentCols s = f . dropWhile null . map words . lines <$> readFile s |
147 | where | 144 | where |