RingAssociativeAlgebra

trait RingAssociativeAlgebra[V, @specialized R] extends CModule[V, R] with Ring[V]

A RingAssociativeAlgebra is a R-module that is also a Ring. An example is the Gaussian numbers, the quaternions, etc...

The scalar multiplication satisfies, for r in R, and x, y in V:

 1. r *: (x * y) = (r *: x) * y = x * (r *: y)

TODO: verify the definition, in particular the requirements for Ring[V] (and not Rng[V])

Companion
object
trait Ring[V]
trait Rng[V]
trait Rig[V]
trait MultiplicativeMonoid[V]
trait Semiring[V]
trait MultiplicativeSemigroup[V]
trait CModule[V, R]
trait RightModule[V, R]
trait LeftModule[V, R]
trait AdditiveCommutativeGroup[V]
trait AdditiveCommutativeMonoid[V]
trait AdditiveCommutativeSemigroup[V]
trait AdditiveGroup[V]
trait AdditiveMonoid[V]
trait AdditiveSemigroup[V]
trait Serializable
class Any

Value members

Inherited methods

override
def additive: CommutativeGroup[V]
Definition Classes
AdditiveCommutativeGroup -> AdditiveCommutativeMonoid -> AdditiveCommutativeSemigroup -> AdditiveGroup -> AdditiveMonoid -> AdditiveSemigroup
Inherited from
AdditiveCommutativeGroup
def fromBigInt(n: BigInt): V

Convert the given BigInt to an instance of A.

Convert the given BigInt to an instance of A.

This is equivalent to n repeated summations of this ring's one, or -n summations of -one if n is negative.

Most type class instances should consider overriding this method for performance reasons.

Inherited from
Ring
def fromInt(n: Int): V

Convert the given integer to an instance of A.

Convert the given integer to an instance of A.

Defined to be equivalent to sumN(one, n).

That is, n repeated summations of this ring's one, or -n summations of -one if n is negative.

Most type class instances should consider overriding this method for performance reasons.

Inherited from
Ring
def isOne(a: V)(implicit ev: Eq[V]): Boolean

Tests if a is one.

Tests if a is one.

Inherited from
MultiplicativeMonoid
def isZero(a: V)(implicit ev: Eq[V]): Boolean

Tests if a is zero.

Tests if a is zero.

Inherited from
AdditiveMonoid
def minus(x: V, y: V): V
Inherited from
AdditiveGroup
override
def multiplicative: Monoid[V]
Definition Classes
MultiplicativeMonoid -> MultiplicativeSemigroup
Inherited from
MultiplicativeMonoid
def negate(x: V): V
Inherited from
AdditiveGroup
def one: V
Inherited from
MultiplicativeMonoid
def plus(x: V, y: V): V
Inherited from
AdditiveSemigroup
override
def pow(a: V, n: Int): V
Definition Classes
MultiplicativeMonoid -> MultiplicativeSemigroup
Inherited from
MultiplicativeMonoid
def product(as: IterableOnce[V]): V

Given a sequence of as, compute the product.

Given a sequence of as, compute the product.

Inherited from
MultiplicativeMonoid
def sum(as: IterableOnce[V]): V

Given a sequence of as, compute the sum.

Given a sequence of as, compute the sum.

Inherited from
AdditiveMonoid
override
def sumN(a: V, n: Int): V
Definition Classes
AdditiveGroup -> AdditiveMonoid -> AdditiveSemigroup
Inherited from
AdditiveGroup
def times(x: V, y: V): V
Inherited from
MultiplicativeSemigroup
def timesl(r: R, v: V): V
Inherited from
LeftModule
override
def timesr(v: V, r: R): V
Definition Classes
Inherited from
CModule
override
def tryProduct(as: IterableOnce[V]): Option[V]
Definition Classes
MultiplicativeMonoid -> MultiplicativeSemigroup
Inherited from
MultiplicativeMonoid
override
def trySum(as: IterableOnce[V]): Option[V]
Definition Classes
AdditiveMonoid -> AdditiveSemigroup
Inherited from
AdditiveMonoid
def zero: V
Inherited from
AdditiveMonoid

Implicits

Inherited implicits

implicit
def scalar: CommutativeRing[R]
Inherited from
CModule