diff options
author | Alberto Ruiz <aruiz@um.es> | 2013-05-21 13:30:45 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2013-05-21 13:30:45 +0200 |
commit | c5606c622cebf265ae0bb3ea32a9f2ebf2f3a79f (patch) | |
tree | 7b3b202eb267e84f7815bf8b3cc1dbae51228476 /lib/Numeric/Vector.hs | |
parent | 6b2f191ea8d6665996070bf6b3e5b4109584dcab (diff) |
merge develop, fix conflicts
Diffstat (limited to 'lib/Numeric/Vector.hs')
-rw-r--r-- | lib/Numeric/Vector.hs | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/Numeric/Vector.hs b/lib/Numeric/Vector.hs index 1717e7b..3f480a0 100644 --- a/lib/Numeric/Vector.hs +++ b/lib/Numeric/Vector.hs | |||
@@ -25,33 +25,6 @@ import Numeric.Container | |||
25 | 25 | ||
26 | ------------------------------------------------------------------- | 26 | ------------------------------------------------------------------- |
27 | 27 | ||
28 | #ifndef VECTOR | ||
29 | import Foreign(Storable) | ||
30 | #endif | ||
31 | |||
32 | ------------------------------------------------------------------ | ||
33 | |||
34 | #ifndef VECTOR | ||
35 | |||
36 | instance (Show a, Storable a) => (Show (Vector a)) where | ||
37 | show v = (show (dim v))++" |> " ++ show (toList v) | ||
38 | |||
39 | instance Container Vector a => Eq (Vector a) where | ||
40 | (==) = equal | ||
41 | |||
42 | instance (Element a, Read a) => Read (Vector a) where | ||
43 | readsPrec _ s = [((d |>) . read $ listnums, rest)] | ||
44 | where (thing,rest) = breakAt ']' s | ||
45 | (dims,listnums) = breakAt '>' thing | ||
46 | d = read . init . fst . breakAt '|' $ dims | ||
47 | breakAt c l = (a++[c],tail b) where | ||
48 | (a,b) = break (==c) l | ||
49 | |||
50 | #endif | ||
51 | |||
52 | |||
53 | ------------------------------------------------------------------ | ||
54 | |||
55 | adaptScalar f1 f2 f3 x y | 28 | adaptScalar f1 f2 f3 x y |
56 | | dim x == 1 = f1 (x@>0) y | 29 | | dim x == 1 = f1 (x@>0) y |
57 | | dim y == 1 = f3 x (y@>0) | 30 | | dim y == 1 = f3 x (y@>0) |