Module scirust::algebra::structure::magma
[−]
[src]
Defines the magma algebraic structure.
A magma is a basic kind of algebraic structure. A magma is a set with a single binary operation. The binary operation must be closed. No other properties are imposed.
We define four kinds of magmas.
- Magma with an addition operation with partial equivalence
- Magma with an addition operation with full equivalence
- Magma with a multiplication operation with partial equivalence
- Magma with a multiplication operation with full equivalence
Types like float don't support full equivalence. That's why separate magma types are needed for them.
We define separate magma types for addition and multiplication operations. This gives us freedom in combining them to form algebraic structures with two operations.
In a sense, the traits defined in this module are marker traits. It is not really possible to verify the closure property for a type at the compile time. It is assumed that the implementation will ensure that (to a reasonable degree).
We also define a base trait MagmaBase
. This trait imposes
some basic requirements for all types taking advantage
of the algebraic traits defined in SciRust
`SciRust
`SciRust. They all are required to support
Debug,
`,
`, Clone
`Clone
`Cloneand
`and
` and Sized
`Sized
`Sized`` traits.
References:
Traits
MagmaAdd |
Magma with an addition operation with full equivalence |
MagmaAddPartial |
Magma with an addition operation with partial equivalence |
MagmaBase |
Defines basic requirements for all types implementing the algebraic traits defined in SciRust |
MagmaMul |
Magma with a multiplication operation with full equivalence |
MagmaMulPartial |
Magma with a multiplication operation with partial equivalence |