| Copyright | (c) Erich Gut |
|---|---|
| License | BSD3 |
| Maintainer | zerich.gut@gmail.com |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
OAlg.Entity.Sum.Definition
Contents
Synopsis
- data Sum r a
- smlc :: Semiring r => Sum r a -> LinearCombination r a
- smJoin :: (Semiring r, Commutative r, Fibred a, Ord a) => Sum r (Sum r a) -> Sum r a
- nSum :: (Hom Fbr h, Additive x) => h a x -> Sum N a -> x
- zSum :: (Hom Fbr h, Abelian x) => h a x -> Sum Z a -> x
- smMap :: (Singleton (Root y), Fibred y, Ord y, Semiring r, Commutative r) => (x -> y) -> Sum r x -> Sum r y
- data SumForm r a
- smfLength :: Number r => SumForm r a -> N
- smflc :: Semiring r => SumForm r a -> LinearCombination r a
- lcsmf :: Semiring r => Root a -> LinearCombination r a -> SumForm r a
- smfMap :: Singleton (Root y) => (x -> y) -> SumForm r x -> SumForm r y
- smfJoin :: SumForm r (SumForm r a) -> SumForm r a
- smfReduce :: (Fibred a, Ord a, Semiring r, Commutative r) => SumForm r a -> SumForm r a
- newtype LinearCombination r a = LinearCombination [(r, a)]
- lcs :: LinearCombination r a -> [(r, a)]
- lcAggr :: (Eq a, Semiring r) => LinearCombination r a -> LinearCombination r a
- lcSort :: Ord a => LinearCombination r a -> LinearCombination r a
- lcSclFilter :: (r -> Bool) -> LinearCombination r a -> LinearCombination r a
Sum
free sum over Fibred symbols in a with scalars in r.
Definition A Sum s is valid if and only if its underlying SumForm s' is valid and
s' is reduced, i.e. s' .== reduce s'
Instances
| (Fibred a, Entity r) => Show (Sum r a) Source # | |
| (Fibred a, Entity r) => Eq (Sum r a) Source # | |
| (Fibred a, OrdRoot a, Ord r, Ord a, Entity r) => Ord (Sum r a) Source # | |
Defined in OAlg.Entity.Sum.Definition | |
| (Fibred a, Ord a, Semiring r, Commutative r) => Constructable (Sum r a) Source # | |
| Exposable (Sum r a) Source # | |
| (Distributive r, Total r, Commutative r, Fibred a) => Validable (Sum r a) Source # | |
| (Fibred a, Semiring r, Commutative r) => Entity (Sum r a) Source # | |
Defined in OAlg.Entity.Sum.Definition | |
| (Fibred a, Ord a, Ring r, Commutative r) => Abelian (Sum r a) Source # | |
| (Fibred a, Ord a, Semiring r, Commutative r) => Additive (Sum r a) Source # | |
| (Fibred a, Semiring r, Commutative r) => Fibred (Sum r a) Source # | |
| (Fibred a, Ord a, Semiring r, Commutative r) => Vectorial (Sum r a) Source # | |
| type Form (Sum r a) Source # | |
Defined in OAlg.Entity.Sum.Definition | |
| type Root (Sum r a) Source # | |
Defined in OAlg.Entity.Sum.Definition | |
| type Scalar (Sum r a) Source # | |
Defined in OAlg.Entity.Sum.Definition | |
smlc :: Semiring r => Sum r a -> LinearCombination r a Source #
the associated linear combination.
Note The associated linear combination of a sum is sorted according to the second component!
smJoin :: (Semiring r, Commutative r, Fibred a, Ord a) => Sum r (Sum r a) -> Sum r a Source #
joining a sum of sums.
nSum :: (Hom Fbr h, Additive x) => h a x -> Sum N a -> x Source #
additive homomorphism for sums over N.
zSum :: (Hom Fbr h, Abelian x) => h a x -> Sum Z a -> x Source #
additive homomorphism for sums over Z.
smMap :: (Singleton (Root y), Fibred y, Ord y, Semiring r, Commutative r) => (x -> y) -> Sum r x -> Sum r y Source #
additive homomorphism to a totally defined sum.
Form
form for a free sum over Fibred symbols in a with scalars in r.
Definition Let r be a Commutative Semiring and a a Fibred structure.
A SumForm a is valid if and only if all scalars in a are valid and all symbols in a
are valid and have the same .root
Instances
smflc :: Semiring r => SumForm r a -> LinearCombination r a Source #
transforming a sum form to its corresponding linear combination..
lcsmf :: Semiring r => Root a -> LinearCombination r a -> SumForm r a Source #
transforming a word to its corresponding sum form.
smfMap :: Singleton (Root y) => (x -> y) -> SumForm r x -> SumForm r y Source #
mapping of sum forms.
smfReduce :: (Fibred a, Ord a, Semiring r, Commutative r) => SumForm r a -> SumForm r a Source #
reducing a sum form to its canonical form,
Linear Combination
newtype LinearCombination r a Source #
list of symbols in a together with a scalar in r.
Note valid linear combinations must not be sorted according to the second component!
Constructors
| LinearCombination [(r, a)] |
Instances
| (Show r, Show a) => Show (LinearCombination r a) Source # | |
Defined in OAlg.Entity.Sum.Definition Methods showsPrec :: Int -> LinearCombination r a -> ShowS # show :: LinearCombination r a -> String # showList :: [LinearCombination r a] -> ShowS # | |
| (Eq r, Eq a) => Eq (LinearCombination r a) Source # | |
Defined in OAlg.Entity.Sum.Definition Methods (==) :: LinearCombination r a -> LinearCombination r a -> Bool # (/=) :: LinearCombination r a -> LinearCombination r a -> Bool # | |
| (Validable r, Validable a) => Validable (LinearCombination r a) Source # | |
Defined in OAlg.Entity.Sum.Definition Methods valid :: LinearCombination r a -> Statement Source # | |
| (Entity a, Entity r) => Entity (LinearCombination r a) Source # | |
Defined in OAlg.Entity.Sum.Definition | |
lcs :: LinearCombination r a -> [(r, a)] Source #
the underlying list of symbols with their scalar.
lcAggr :: (Eq a, Semiring r) => LinearCombination r a -> LinearCombination r a Source #
aggregating linear combinations with same symbols.
lcSort :: Ord a => LinearCombination r a -> LinearCombination r a Source #
sorting a linear combination according to its symbols.
lcSclFilter :: (r -> Bool) -> LinearCombination r a -> LinearCombination r a Source #
filtering a word according to the scalars.