summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/LinearAlgebra')
-rw-r--r--lib/Numeric/LinearAlgebra/Util.hs12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/Numeric/LinearAlgebra/Util.hs b/lib/Numeric/LinearAlgebra/Util.hs
index 92b66e3..24317e3 100644
--- a/lib/Numeric/LinearAlgebra/Util.hs
+++ b/lib/Numeric/LinearAlgebra/Util.hs
@@ -25,15 +25,13 @@ module Numeric.LinearAlgebra.Util(
25 (#),(&), (//), blocks, 25 (#),(&), (//), blocks,
26 rand, 26 rand,
27 splitEvery, 27 splitEvery,
28 table, 28 table
29 latexFormat
30) where 29) where
31 30
32import Numeric.LinearAlgebra hiding ((<>), (<|>), (<->), (<\>), (.*), (*/)) 31import Numeric.LinearAlgebra hiding ((<>), (<|>), (<->), (<\>), (.*), (*/))
33import Data.Packed.Internal.Common(table,splitEvery) 32import Data.Packed.Internal.Common(table,splitEvery)
34import System.Random(randomIO) 33import System.Random(randomIO)
35 34
36
37infixl 7 <> 35infixl 7 <>
38-- | Matrix product ('multiply') 36-- | Matrix product ('multiply')
39(<>) :: Field t => Matrix t -> Matrix t -> Matrix t 37(<>) :: Field t => Matrix t -> Matrix t -> Matrix t
@@ -121,12 +119,4 @@ row = asRow . vector
121col :: [Double] -> Matrix Double 119col :: [Double] -> Matrix Double
122col = asColumn . vector 120col = asColumn . vector
123 121
124-- | Tool to display matrices with latex syntax.
125latexFormat :: Element t
126 => String -- ^ type of braces: \"matrix\", \"bmatrix\", \"pmatrix\", etc.
127 -> (t->String) -- ^ formatting function for the elements: (printf \"%.2f\"), etc.
128 -> Matrix t -- ^ input matrix
129 -> String
130latexFormat t shf m = "\\begin{"++t++"}\n" ++ dispg " & " " \\\\" shf m ++ "\\end{"++t++"}"
131 where dispg w l shfun x = unlines $ map (++l) $ lines $ format w shfun x
132 122