1||| Implementations of algebraic interfaces (group, ring, etc) for numeric data types,
2||| and Complex number types.
3module Control.Algebra.NumericImplementations
6import Control.Algebra.VectorSpace
14Semigroup Integer where
23AbelianGroup Integer where
28RingWithUnity Integer where
47RingWithUnity Int where
61AbelianGroup Double where
66RingWithUnity Double where
74[PlusNatSemi] Semigroup Nat where
77[PlusNatMonoid] Monoid Nat using PlusNatSemi where
80[MultNatSemi] Semigroup Nat where
83[MultNatMonoid] Monoid Nat using MultNatSemi where
88[PlusZZSemi] Semigroup ZZ where
91[PlusZZMonoid] Monoid ZZ using PlusZZSemi where
94Group ZZ using PlusZZMonoid where
99[MultZZSemi] Semigroup ZZ where
102[MultZZMonoid] Monoid ZZ using MultZZSemi where
108RingWithUnity ZZ where
113Semigroup a => Semigroup (Complex a) where
114 (<+>) (a :+ b) (c :+ d) = (a <+> c) :+ (b <+> d)
116Monoid a => Monoid (Complex a) where
117 neutral = (neutral :+ neutral)
119Group a => Group (Complex a) where
120 inverse (r :+ i) = (inverse r :+ inverse i)
122Ring a => AbelianGroup (Complex a) where {}
124Ring a => Ring (Complex a) where
125 (<.>) (a :+ b) (c :+ d) = (a <.> c <-> b <.> d) :+ (a <.> d <+> b <.> c)
127RingWithUnity a => RingWithUnity (Complex a) where
128 unity = (unity :+ neutral)
130RingWithUnity a => Module a (Complex a) where
131 (<#>) x = map (x <.>)
133RingWithUnity a => InnerProductSpace a (Complex a) where
134 (x :+ y) <||> z = realPart $ (x :+ inverse y) <.> z
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list