diff options
Diffstat (limited to 'packages/base/src/Numeric/Vector.hs')
-rw-r--r-- | packages/base/src/Numeric/Vector.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/base/src/Numeric/Vector.hs b/packages/base/src/Numeric/Vector.hs index 1c16871..6cac5dc 100644 --- a/packages/base/src/Numeric/Vector.hs +++ b/packages/base/src/Numeric/Vector.hs | |||
@@ -32,6 +32,14 @@ adaptScalar f1 f2 f3 x y | |||
32 | 32 | ||
33 | ------------------------------------------------------------------ | 33 | ------------------------------------------------------------------ |
34 | 34 | ||
35 | instance Num (Vector CInt) where | ||
36 | (+) = adaptScalar addConstant add (flip addConstant) | ||
37 | negate = scale (-1) | ||
38 | (*) = adaptScalar scale mul (flip scale) | ||
39 | signum = vectorMapI Sign | ||
40 | abs = vectorMapI Abs | ||
41 | fromInteger = fromList . return . fromInteger | ||
42 | |||
35 | instance Num (Vector Float) where | 43 | instance Num (Vector Float) where |
36 | (+) = adaptScalar addConstant add (flip addConstant) | 44 | (+) = adaptScalar addConstant add (flip addConstant) |
37 | negate = scale (-1) | 45 | negate = scale (-1) |