diff options
author | Alberto Ruiz <aruiz@um.es> | 2014-05-22 11:49:23 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2014-05-22 11:49:23 +0200 |
commit | 5158a1717f1d4caee25669a0781602fe64787302 (patch) | |
tree | 2846767b931e3a3429e0f2c5aed709c6800c94cc /packages/base/src/Data/Packed/Internal/Numeric.hs | |
parent | 3916d70b9d170633c6122cb3c46000f0b3f32018 (diff) |
initial support for sparse matrix
Diffstat (limited to 'packages/base/src/Data/Packed/Internal/Numeric.hs')
-rw-r--r-- | packages/base/src/Data/Packed/Internal/Numeric.hs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/base/src/Data/Packed/Internal/Numeric.hs b/packages/base/src/Data/Packed/Internal/Numeric.hs index 81a8083..3528e96 100644 --- a/packages/base/src/Data/Packed/Internal/Numeric.hs +++ b/packages/base/src/Data/Packed/Internal/Numeric.hs | |||
@@ -20,6 +20,7 @@ module Data.Packed.Internal.Numeric ( | |||
20 | ident, diag, ctrans, | 20 | ident, diag, ctrans, |
21 | -- * Generic operations | 21 | -- * Generic operations |
22 | Container(..), | 22 | Container(..), |
23 | Transposable(..), Linear(..), Testable(..), | ||
23 | -- * Matrix product and related functions | 24 | -- * Matrix product and related functions |
24 | Product(..), udot, | 25 | Product(..), udot, |
25 | mXm,mXv,vXm, | 26 | mXm,mXv,vXm, |
@@ -605,3 +606,25 @@ condV f a b l e t = f a' b' l' e' t' | |||
605 | where | 606 | where |
606 | [a', b', l', e', t'] = conformVs [a,b,l,e,t] | 607 | [a', b', l', e', t'] = conformVs [a,b,l,e,t] |
607 | 608 | ||
609 | -------------------------------------------------------------------------------- | ||
610 | |||
611 | class Transposable t | ||
612 | where | ||
613 | tr :: t -> t | ||
614 | |||
615 | |||
616 | class Linear t v | ||
617 | where | ||
618 | scalarL :: t -> v | ||
619 | addL :: v -> v -> v | ||
620 | scaleL :: t -> v -> v | ||
621 | |||
622 | |||
623 | class Testable t | ||
624 | where | ||
625 | checkT :: t -> (Bool, IO()) | ||
626 | ioCheckT :: t -> IO (Bool, IO()) | ||
627 | ioCheckT = return . checkT | ||
628 | |||
629 | -------------------------------------------------------------------------------- | ||
630 | |||