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

Value members

Concrete methods

override def fromInt(n: Int): V
Definition Classes
override def minus(v: V, w: V): V
Definition Classes
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

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 pow(a: V, n: Int): V
@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
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]
@nowarn("msg=deprecated")
override def trySum(as: IterableOnce[V]): Option[V]
Definition Classes
Inherited from:
AdditiveMonoid

Implicits

Implicits

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