ZAlgebra

trait ZAlgebra[V] extends RingAssociativeAlgebra[V, Int] with Ring[V]

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

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

Value members

Concrete methods

override
def fromInt(n: Int): V
Definition Classes
Ring
override
def minus(v: V, w: V): V
Definition Classes
AdditiveGroup
def negate(v: V): V
def one: V
def plus(v: V, w: V): V
def times(v: V, w: V): V
def timesl(r: Int, v: V): V
def zero: V

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 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
override
def multiplicative: Monoid[V]
Definition Classes
MultiplicativeMonoid -> MultiplicativeSemigroup
Inherited from
MultiplicativeMonoid
override
def pow(a: V, n: Int): V
Definition Classes
MultiplicativeMonoid -> MultiplicativeSemigroup
Inherited from
MultiplicativeMonoid
@nowarn("msg=deprecated")
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
@nowarn("msg=deprecated")
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
override
def timesr(v: V, r: Int): V
Definition Classes
Inherited from
CModule
@nowarn("msg=deprecated")
override
def tryProduct(as: IterableOnce[V]): Option[V]
Definition Classes
MultiplicativeMonoid -> MultiplicativeSemigroup
Inherited from
MultiplicativeMonoid
@nowarn("msg=deprecated")
override
def trySum(as: IterableOnce[V]): Option[V]
Definition Classes
AdditiveMonoid -> AdditiveSemigroup
Inherited from
AdditiveMonoid

Implicits

Implicits

implicit
def scalar: CommutativeRing[Int]
implicit
def vector: Ring[V]