p

spire

algebra

package algebra

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. trait AbGroup [A] extends Group[A] with CMonoid[A]

    An abelian group is a group whose operation is commutative.

  2. trait Action [P, G] extends LeftAction[P, G] with RightAction[P, G]

    A semigroup/monoid/group action of G on P is the combination of compatible left and right actions, providing:

    A semigroup/monoid/group action of G on P is the combination of compatible left and right actions, providing:

    • the implementation of a method actl(g, p), or g |+|> p, such that:

    1. (g |+| h) |+|> p === g |+|> (h |+|> p) for all g, h in G and p in P.

    2. id |+|> p === p for all p in P (if id is defined)

    • the implementation of a method actr(p, g), or p <|+| g, such that:

    3. p <|+| (g |+| h) === (p <|+| g) <|+| h for all g, h in G and p in P.

    4. p <|+| id === p for all p in P (if id is defined)

    In addition, if G is a group, left and right actions are compatible:

    5. g |+|> p === p <|+| g.inverse.

  3. trait AdditiveAbGroup [A] extends AdditiveGroup[A] with AdditiveCMonoid[A]
  4. trait AdditiveAction [P, G] extends Any
  5. trait AdditiveCMonoid [A] extends AdditiveMonoid[A] with AdditiveCSemigroup[A]
  6. trait AdditiveCSemigroup [A] extends AdditiveSemigroup[A]
  7. trait AdditiveGroup [A] extends AdditiveMonoid[A]
  8. trait AdditiveMonoid [A] extends AdditiveSemigroup[A]
  9. trait AdditiveSemigroup [A] extends Any
  10. trait AdditiveTorsor [V, R] extends AdditiveAction[V, R]
  11. trait Bool [A] extends Heyting[A]

    A boolean algebra is a structure that defines a few basic operations, namely as conjunction (&), disjunction (|), and negation (~).

    A boolean algebra is a structure that defines a few basic operations, namely as conjunction (&), disjunction (|), and negation (~). Both conjunction and disjunction must be associative, commutative and should distribute over each other. Also, both have an identity and they obey the absorption law; that is x & (y | x) == x and x | (x & y) == x.

  12. trait CMonoid [A] extends Monoid[A] with CSemigroup[A]

    CMonoid represents a commutative monoid.

    CMonoid represents a commutative monoid.

    A monoid is commutative if for all x and y, x |+| y === y |+| x.

  13. trait CRig [A] extends Rig[A] with MultiplicativeCMonoid[A]

    CRig is a Rig that is commutative under multiplication.

  14. trait CRing [A] extends Ring[A] with MultiplicativeCMonoid[A]

    CRing is a Ring that is commutative under multiplication.

  15. trait CSemigroup [A] extends Semigroup[A]

    CSemigroup represents a commutative semigroup.

    CSemigroup represents a commutative semigroup.

    A semigroup is commutative if for all x and y, x |+| y === y |+| x.

  16. trait CoordinateSpace [V, F] extends InnerProductSpace[V, F]
  17. class DualBool [A] extends Bool[A]
  18. trait Eq [A] extends Any

    A type class used to determine equality between 2 instances of the same type.

    A type class used to determine equality between 2 instances of the same type. Any 2 instances x and y are equal if eqv(x, y) is true. Moreover, eqv should form an equivalence relation.

  19. trait EuclideanRing [A] extends CRing[A]
  20. trait Field [A] extends EuclideanRing[A] with MultiplicativeAbGroup[A]
  21. trait FieldAlgebra [V, F] extends RingAlgebra[V, F] with VectorSpace[V, F]

    A FieldAlgebra is a vector space that is also a Ring.

    A FieldAlgebra is a vector space that is also a Ring. An example is the complex numbers.

  22. trait Group [A] extends Monoid[A]

    A group is a monoid where each element has an inverse.

  23. trait InnerProductSpace [V, F] extends VectorSpace[V, F]
  24. trait IsAlgebraic [A] extends IsReal[A]
  25. trait IsIntegral [A] extends IsRational[A]
  26. trait IsRational [A] extends IsAlgebraic[A]
  27. trait IsReal [A] extends Order[A] with Signed[A]

    A simple type class for numeric types that are a subset of the reals.

  28. trait LeftAction [P, G] extends Any

    A (left) semigroup/monoid/group action of G on P is simply the implementation of a method actl(g, p), or g |+|> p, such that:

    A (left) semigroup/monoid/group action of G on P is simply the implementation of a method actl(g, p), or g |+|> p, such that:

    1. (g |+| h) |+|> p === g |+|> (h |+|> p) for all g, h in G and p in P.

    2. id |+|> p === p for all p in P (if id is defined)

  29. trait MetricSpace [V, R] extends Any

    This type class models a metric space V.

    This type class models a metric space V. The distance between 2 points in V is measured in R, which should be real (ie. IsReal[R] exists).

  30. trait Module [V, R] extends AdditiveAbGroup[V]

    A module generalizes a vector space by requiring its scalar need only form a ring, rather than a field.

  31. trait Monoid [A] extends Semigroup[A]

    A monoid is a semigroup with an identity.

    A monoid is a semigroup with an identity. A monoid is a specialization of a semigroup, so its operation must be associative. Additionally, op(x, id) == op(id, x) == x. For example, if we have Monoid[String], with op as string concatenation, then id = "".

  32. trait MultiplicativeAbGroup [A] extends MultiplicativeGroup[A] with MultiplicativeCMonoid[A]
  33. trait MultiplicativeAction [P, G] extends Any
  34. trait MultiplicativeCMonoid [A] extends MultiplicativeMonoid[A] with MultiplicativeCSemigroup[A]
  35. trait MultiplicativeCSemigroup [A] extends MultiplicativeSemigroup[A]
  36. trait MultiplicativeGroup [A] extends MultiplicativeMonoid[A]
  37. trait MultiplicativeMonoid [A] extends MultiplicativeSemigroup[A]
  38. trait MultiplicativeSemigroup [A] extends Any
  39. trait MultiplicativeTorsor [V, R] extends MultiplicativeAction[V, R]
  40. trait NRoot [A] extends Any

    This is a type class for types with n-roots.

    This is a type class for types with n-roots. The value returned by nroot and sqrt are only guaranteed to be approximate answers (except in the case of Real).

    Also, generally nroots where n is even are not defined for negative numbers. The behaviour is undefined if this is attempted. It would be nice to ensure an exception is raised, but some types may defer computation and testing if a value is negative may not be ideal. So, do not count on ArithmeticExceptions to save you from bad arithmetic!

  41. trait NormedVectorSpace [V, F] extends VectorSpace[V, F] with MetricSpace[V, F]

    A normed vector space is a vector space equipped with a function norm: V => F.

    A normed vector space is a vector space equipped with a function norm: V => F. The main constraint is that the norm of a vector must be scaled linearly when the vector is scaled; that is norm(k *: v) == k.abs * norm(v). Additionally, a normed vector space is also a MetricSpace, where distance(v, w) = norm(v - w), and so must obey the triangle inequality.

    An example of a normed vector space is R^n equipped with the euclidean vector length as the norm.

  42. trait Order [A] extends PartialOrder[A]

    The Order type class is used to define a total ordering on some type A.

    The Order type class is used to define a total ordering on some type A. An order is defined by a relation <=, which obeys the following laws:

    - either x <= y or y <= x (totality) - if x <= y and y <= x, then x == y (antisymmetry) - if x <= y and y <= z, then x <= z (transitivity)

    The truth table for compare is defined as follows:

    x <= y x >= y Int true true = 0 (corresponds to x == y) true false < 0 (corresponds to x < y) false true > 0 (corresponds to x > y)

    By the totality law, x <= y and y <= x cannot be both false.

  43. trait PartialOrder [A] extends Eq[A]

    The PartialOrder type class is used to define a partial ordering on some type A.

    The PartialOrder type class is used to define a partial ordering on some type A.

    A partial order is defined by a relation <=, which obeys the following laws:

    - x <= x (reflexivity) - if x <= y and y <= x, then x === y (anti-symmetry) - if x <= y and y <= z, then x <= z (transitivity)

    To compute both <= and >= at the same time, we use a Double number to encode the result of the comparisons x <= y and x >= y. The truth table is defined as follows:

    x <= y x >= y Double true true = 0.0 (corresponds to x === y) false false = NaN (x and y cannot be compared) true false = -1.0 (corresponds to x < y) false true = 1.0 (corresponds to x > y)

  44. trait Rig [A] extends Semiring[A] with AdditiveMonoid[A] with MultiplicativeMonoid[A]

    Rig is a ring whose additive structure doesn't have an inverse (ie.

    Rig is a ring whose additive structure doesn't have an inverse (ie. it is monoid, not a group). Put another way, a Rig is a Ring without a negative.

  45. trait RightAction [P, G] extends Any

    A (right) semigroup/monoid/group action of G on P is simply the implementation of a method actr(p, g), or p <|+| g, such that:

    A (right) semigroup/monoid/group action of G on P is simply the implementation of a method actr(p, g), or p <|+| g, such that:

    1. p <|+| (g |+| h) === (p <|+| g) <|+| h for all g, h in G and p in P.

    2. p <|+| id === p for all p in P (if id is defined)

  46. trait Ring [A] extends Rig[A] with Rng[A]

    Ring represents a set (A) that is a group over addition (+) and a monoid over multiplication (*).

    Ring represents a set (A) that is a group over addition (+) and a monoid over multiplication (*). Aside from this, the multiplication must distribute over addition.

    Ring implements some methods (for example fromInt) in terms of other more fundamental methods (zero, one and plus). Where possible, these methods should be overridden by more efficient implementations.

  47. trait RingAlgebra [V, R] extends Module[V, R] with Rng[V]

    A RingAlgebra is a module that is also a Rng.

    A RingAlgebra is a module that is also a Rng. An example is the Gaussian numbers.

  48. trait Rng [A] extends Semiring[A] with AdditiveAbGroup[A]

    Rng is a ring whose multiplicative structure doesn't have an identity (i.e.

    Rng is a ring whose multiplicative structure doesn't have an identity (i.e. it is semigroup, not a monoid). Put another way, a Rng is a Ring without an identity.

  49. trait Semigroup [A] extends Any

    A semigroup is any set A with an associative operation (op).

  50. trait Semiring [A] extends AdditiveMonoid[A] with MultiplicativeSemigroup[A]

    Semiring is a ring without identities or an inverse.

    Semiring is a ring without identities or an inverse. Thus, it has no negation, zero, or one.

    A Semiring with an additive inverse (-) is a Rng. A Semiring with additive and multiplicative identities (0 and 1) is a Rig. A Semiring with all of the above is a Ring.

  51. sealed abstract class Sign extends AnyRef

    A simple ADT representing the Sign of an object.

  52. trait Signed [A] extends Any

    A trait for things that have some notion of sign and the ability to ensure something has a positive sign.

  53. trait Torsor [V, R] extends Action[V, R]

    A Torsor[V, R] requires an AbGroup[R] and provides Action[V, R], plus a diff operator, <-> in additive notation, such that:

    A Torsor[V, R] requires an AbGroup[R] and provides Action[V, R], plus a diff operator, <-> in additive notation, such that:

    1. (g <-> g) === scalar.id for all g in G.

    2. (g <-> h) +> h === g for all g, h in G.

    3. (g <-> h) +> i === (i <-> h) +> g for all g, h in G.

    4. (g <-> h) === -(h <-> g) for all g, h in G.

  54. trait Trig [A] extends Any
  55. trait VectorSpace [V, F] extends Module[V, F]

    A vector space is a group V that can be multiplied by scalars in F that lie in a field.

    A vector space is a group V that can be multiplied by scalars in F that lie in a field. Scalar multiplication must distribute over vector addition (x *: (v + w) === x *: v + x *: w) and scalar addition ((x + y) *: v === x *: v + y *: v). Scalar multiplication by 1 in F is an identity function (1 *: v === v). Scalar multiplication is "associative" (x *: y *: v === (x * y) *: v).

  56. trait ZAlgebra [V] extends RingAlgebra[V, Int] with Ring[V]

    Given any Ring[A] we can construct a RingAlgebra[A, Int].

    Given any Ring[A] we can construct a RingAlgebra[A, Int]. This is possible since we can define fromInt on Ring generally.

  57. final case class ZModule [V](vector: Group[V]) extends Module[V, Int] with Product with Serializable

Ungrouped