2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -2,21 +2,17 @@ import Data.Array.IArray
|
|||
import Data.List
|
||||
import Cholesky
|
||||
|
||||
takeDrop 0 xs = ([],xs)
|
||||
takeDrop _ [] = ([],[])
|
||||
takeDrop n (x:xs) = (x:a,b) where (a,b) = takeDrop (n-1) xs
|
||||
|
||||
fm _ [] = ""
|
||||
fm _ [x] = fst x
|
||||
fm width ((a,b):xs) = a ++ (take (width - b) $ cycle " ") ++ (fm width xs)
|
||||
|
||||
fmt width row (xs,[]) = fm width xs
|
||||
fmt width row (xs,ys) = fm width xs ++ "\n" ++ fmt width row (takeDrop row ys)
|
||||
fmt width row (xs,ys) = fm width xs ++ "\n" ++ fmt width row (splitAt row ys)
|
||||
|
||||
showMatrice row xs = ys where
|
||||
vs = map (\s -> let sh = show s in (sh,length sh)) xs
|
||||
width = (maximum $ snd $ unzip vs) + 2
|
||||
ys = fmt width row (takeDrop row vs)
|
||||
width = (maximum $ snd $ unzip vs) + 1
|
||||
ys = fmt width row (splitAt row vs)
|
||||
|
||||
ex1, ex2 :: Arr
|
||||
ex1 = listArray ((0,0),(2,2)) [25, 15, -5,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue