diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-09-21 18:10:59 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-09-21 18:10:59 +0000 |
commit | edfaf9e0d1dcfccc9015476510a23e8cf64288be (patch) | |
tree | 2b11f0a933a7cce2362aed26ac160312e6b9431a /lib/LinearAlgebra/Linear.hs | |
parent | 6cafd2f26a89008cc0db02e70e39f92a50ec4b4d (diff) |
algorithms refactoring
Diffstat (limited to 'lib/LinearAlgebra/Linear.hs')
-rw-r--r-- | lib/LinearAlgebra/Linear.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/LinearAlgebra/Linear.hs b/lib/LinearAlgebra/Linear.hs index c12e30b..2f1bc6f 100644 --- a/lib/LinearAlgebra/Linear.hs +++ b/lib/LinearAlgebra/Linear.hs | |||
@@ -37,6 +37,8 @@ class (Field e) => Linear c e where | |||
37 | fromComplex :: RealFloat e => c (Complex e) -> (c e, c e) | 37 | fromComplex :: RealFloat e => c (Complex e) -> (c e, c e) |
38 | comp :: RealFloat e => c e -> c (Complex e) | 38 | comp :: RealFloat e => c e -> c (Complex e) |
39 | conj :: RealFloat e => c (Complex e) -> c (Complex e) | 39 | conj :: RealFloat e => c (Complex e) -> c (Complex e) |
40 | real :: c Double -> c e | ||
41 | complex :: c e -> c (Complex Double) | ||
40 | 42 | ||
41 | instance Linear Vector Double where | 43 | instance Linear Vector Double where |
42 | scale = vectorMapValR Scale | 44 | scale = vectorMapValR Scale |
@@ -50,6 +52,8 @@ instance Linear Vector Double where | |||
50 | fromComplex = Data.Packed.Internal.fromComplex | 52 | fromComplex = Data.Packed.Internal.fromComplex |
51 | comp = Data.Packed.Internal.comp | 53 | comp = Data.Packed.Internal.comp |
52 | conj = Data.Packed.Internal.conj | 54 | conj = Data.Packed.Internal.conj |
55 | real = id | ||
56 | complex = LinearAlgebra.Linear.comp | ||
53 | 57 | ||
54 | instance Linear Vector (Complex Double) where | 58 | instance Linear Vector (Complex Double) where |
55 | scale = vectorMapValC Scale | 59 | scale = vectorMapValC Scale |
@@ -63,6 +67,8 @@ instance Linear Vector (Complex Double) where | |||
63 | fromComplex = undefined | 67 | fromComplex = undefined |
64 | comp = undefined | 68 | comp = undefined |
65 | conj = undefined | 69 | conj = undefined |
70 | real = LinearAlgebra.Linear.comp | ||
71 | complex = id | ||
66 | 72 | ||
67 | instance Linear Matrix Double where | 73 | instance Linear Matrix Double where |
68 | scale x = liftMatrix (scale x) | 74 | scale x = liftMatrix (scale x) |
@@ -78,6 +84,8 @@ instance Linear Matrix Double where | |||
78 | c = cols z | 84 | c = cols z |
79 | comp = liftMatrix Data.Packed.Internal.comp | 85 | comp = liftMatrix Data.Packed.Internal.comp |
80 | conj = liftMatrix Data.Packed.Internal.conj | 86 | conj = liftMatrix Data.Packed.Internal.conj |
87 | real = id | ||
88 | complex = LinearAlgebra.Linear.comp | ||
81 | 89 | ||
82 | instance Linear Matrix (Complex Double) where | 90 | instance Linear Matrix (Complex Double) where |
83 | scale x = liftMatrix (scale x) | 91 | scale x = liftMatrix (scale x) |
@@ -91,6 +99,8 @@ instance Linear Matrix (Complex Double) where | |||
91 | fromComplex = undefined | 99 | fromComplex = undefined |
92 | comp = undefined | 100 | comp = undefined |
93 | conj = undefined | 101 | conj = undefined |
102 | real = LinearAlgebra.Linear.comp | ||
103 | complex = id | ||
94 | 104 | ||
95 | -------------------------------------------------- | 105 | -------------------------------------------------- |
96 | 106 | ||