Package

spire

algebra

Permalink

package algebra

Visibility
  1. Public
  2. All

Type Members

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

    Permalink

    An abelian group is a group whose operation is commutative.

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

    Permalink

    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]

    Permalink
  4. trait AdditiveAction[P, G] extends Any

    Permalink
  5. trait AdditiveCMonoid[A] extends AdditiveMonoid[A] with AdditiveCSemigroup[A]

    Permalink
  6. trait AdditiveCSemigroup[A] extends AdditiveSemigroup[A]

    Permalink
  7. trait AdditiveGroup[A] extends AdditiveMonoid[A]

    Permalink
  8. trait AdditiveMonoid[A] extends AdditiveSemigroup[A]

    Permalink
  9. trait AdditiveSemigroup[A] extends Any

    Permalink
  10. trait AdditiveTorsor[V, R] extends AdditiveAction[V, R]

    Permalink
  11. trait Bool[A] extends Heyting[A]

    Permalink

    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]

    Permalink

    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]

    Permalink

    CRig is a Rig that is commutative under multiplication.

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

    Permalink

    CRing is a Ring that is commutative under multiplication.

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

    Permalink

    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]

    Permalink
  17. class DualBool[A] extends Bool[A]

    Permalink
  18. trait Eq[A] extends Any

    Permalink

    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]

    Permalink
  20. trait Field[A] extends EuclideanRing[A] with MultiplicativeAbGroup[A]

    Permalink
  21. trait FieldAlgebra[V, F] extends RingAlgebra[V, F] with VectorSpace[V, F]

    Permalink

    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]

    Permalink

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

  23. trait InnerProductSpace[V, F] extends VectorSpace[V, F]

    Permalink
  24. trait IsAlgebraic[A] extends IsReal[A]

    Permalink
  25. trait IsIntegral[A] extends IsRational[A]

    Permalink
  26. trait IsRational[A] extends IsAlgebraic[A]

    Permalink
  27. trait IsReal[A] extends Order[A] with Signed[A]

    Permalink

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

  28. trait LeftAction[P, G] extends Any

    Permalink

    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

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink
  33. trait MultiplicativeAction[P, G] extends Any

    Permalink
  34. trait MultiplicativeCMonoid[A] extends MultiplicativeMonoid[A] with MultiplicativeCSemigroup[A]

    Permalink
  35. trait MultiplicativeCSemigroup[A] extends MultiplicativeSemigroup[A]

    Permalink
  36. trait MultiplicativeGroup[A] extends MultiplicativeMonoid[A]

    Permalink
  37. trait MultiplicativeMonoid[A] extends MultiplicativeSemigroup[A]

    Permalink
  38. trait MultiplicativeSemigroup[A] extends Any

    Permalink
  39. trait MultiplicativeTorsor[V, R] extends MultiplicativeAction[V, R]

    Permalink
  40. trait NRoot[A] extends Any

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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

    Permalink

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

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

    Permalink

    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

    Permalink

    A simple ADT representing the Sign of an object.

  52. trait Signed[A] extends Any

    Permalink

    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]

    Permalink

    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

    Permalink
  55. trait VectorSpace[V, F] extends Module[V, F]

    Permalink

    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]

    Permalink

    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

    Permalink

Value Members

  1. object AbGroup

    Permalink
  2. object Action

    Permalink
  3. object Additive

    Permalink
  4. object AdditiveTorsor

    Permalink
  5. object Bool

    Permalink
  6. object CMonoid

    Permalink
  7. object CRig

    Permalink
  8. object CRing

    Permalink
  9. object CSemigroup

    Permalink
  10. object CoordinateSpace

    Permalink
  11. object Eq

    Permalink
  12. object EuclideanRing

    Permalink
  13. object Field

    Permalink
  14. object Group

    Permalink
  15. object InnerProductSpace

    Permalink
  16. object IsAlgebraic

    Permalink
  17. object IsIntegral

    Permalink
  18. object IsRational

    Permalink
  19. object IsReal

    Permalink
  20. object LeftAction

    Permalink
  21. object MetricSpace extends MetricSpace0

    Permalink
  22. object Module

    Permalink
  23. object Monoid

    Permalink
  24. object Multiplicative

    Permalink
  25. object MultiplicativeTorsor

    Permalink
  26. object NRoot

    Permalink
  27. object NormedVectorSpace extends NormedVectorSpace0 with NormedVectorSpaceFunctions

    Permalink
  28. object Order

    Permalink
  29. object PartialOrder

    Permalink
  30. object Rig

    Permalink
  31. object RightAction

    Permalink
  32. object Ring

    Permalink
  33. object RingAlgebra

    Permalink
  34. object Rng

    Permalink
  35. object Semigroup

    Permalink
  36. object Semiring

    Permalink
  37. object Sign

    Permalink
  38. object Signed

    Permalink
  39. object Torsor

    Permalink
  40. object Trig

    Permalink
  41. object VectorSpace

    Permalink
  42. package free

    Permalink
  43. package lattice

    Permalink
  44. package partial

    Permalink

Ungrouped