WholeNumberIsCommutativeRing

com.phasmidsoftware.number.algebra.eager.WholeNumber.WholeNumberIsCommutativeRing
See theWholeNumberIsCommutativeRing companion trait

Provides an implicit implementation of a commutative group for the WholeNumber type, supporting group operations such as identity, combination, and inversion.

This allows WholeNumber objects to adhere to the algebraic structure of a commutative group, where the combine operation is associative and commutative, an identity element exists, and each element has an additive inverse.

Attributes

Companion
trait
Graph
Supertypes
trait CommutativeRing[WholeNumber]
trait CommutativeRng[WholeNumber]
trait CommutativeRig[WholeNumber]
trait MultiplicativeCommutativeMonoid[WholeNumber]
trait CommutativeSemiring[WholeNumber]
trait MultiplicativeCommutativeSemigroup[WholeNumber]
trait Ring[WholeNumber]
trait Rng[WholeNumber]
trait AdditiveCommutativeGroup[WholeNumber]
trait AdditiveGroup[WholeNumber]
trait Rig[WholeNumber]
trait MultiplicativeMonoid[WholeNumber]
trait Semiring[WholeNumber]
trait MultiplicativeSemigroup[WholeNumber]
trait AdditiveCommutativeMonoid[WholeNumber]
trait AdditiveCommutativeSemigroup[WholeNumber]
trait AdditiveMonoid[WholeNumber]
trait AdditiveSemigroup[WholeNumber]
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type

Members list

Value members

Inherited methods

override def additive: CommutativeGroup[WholeNumber]

Attributes

Definition Classes
AdditiveCommutativeGroup -> AdditiveCommutativeMonoid -> AdditiveCommutativeSemigroup -> AdditiveGroup -> AdditiveMonoid -> AdditiveSemigroup
Inherited from:
AdditiveCommutativeGroup

Provides the identity element for the WholeNumber group, representing a WholeNumber of zero.

Provides the identity element for the WholeNumber group, representing a WholeNumber of zero.

Attributes

Returns

the WholeNumber instance zero.

Inherited from:
WholeNumberIsCommutativeRing
def fromBigInt(n: BigInt): WholeNumber

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.

Attributes

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

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.

Attributes

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

Tests if a is one.

Tests if a is one.

Attributes

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

Tests if a is zero.

Tests if a is zero.

Attributes

Inherited from:
AdditiveMonoid

Attributes

Inherited from:
AdditiveGroup
override def multiplicative: CommutativeMonoid[WholeNumber]

Attributes

Definition Classes
MultiplicativeCommutativeMonoid -> MultiplicativeCommutativeSemigroup -> MultiplicativeMonoid -> MultiplicativeSemigroup
Inherited from:
MultiplicativeCommutativeMonoid

Computes the additive inverse of the given WholeNumber.

Computes the additive inverse of the given WholeNumber.

This method negates the input WholeNumber, returning a WholeNumber instance that represents its additive inverse, relative to WholeNumber.zero.

Value parameters

x

the WholeNumber instance to be inverted

Attributes

Returns

a new WholeNumber instance representing the additive inverse of the input

Inherited from:
WholeNumberIsCommutativeRing

Returns the constant representing the number one as a WholeNumber.

Returns the constant representing the number one as a WholeNumber.

Attributes

Returns

a WholeNumber instance representing the numeric value of one.

Inherited from:
WholeNumberIsCommutativeRing

Adds two WholeNumber instances together.

Adds two WholeNumber instances together.

This method computes the sum of the two provided WholeNumber objects and returns a new WholeNumber representing the result.

Value parameters

x

the first WholeNumber operand

y

the second WholeNumber operand

Attributes

Returns

a new WholeNumber instance representing the sum of x and y

Inherited from:
WholeNumberIsCommutativeRing
override def pow(a: WholeNumber, n: Int): WholeNumber

Attributes

Definition Classes
MultiplicativeMonoid -> MultiplicativeSemigroup
Inherited from:
MultiplicativeMonoid
def product(as: IterableOnce[WholeNumber]): WholeNumber

Given a sequence of as, compute the product.

Given a sequence of as, compute the product.

Attributes

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

Given a sequence of as, compute the sum.

Given a sequence of as, compute the sum.

Attributes

Inherited from:
AdditiveMonoid
override def sumN(a: WholeNumber, n: Int): WholeNumber

Attributes

Definition Classes
AdditiveGroup -> AdditiveMonoid -> AdditiveSemigroup
Inherited from:
AdditiveGroup

Multiplies two WholeNumber instances.

Multiplies two WholeNumber instances.

This method computes the product of the two provided WholeNumber objects and returns a new WholeNumber representing the result.

Value parameters

x

the first WholeNumber operand

y

the second WholeNumber operand

Attributes

Returns

a new WholeNumber instance representing the product of x and y

Inherited from:
WholeNumberIsCommutativeRing
override def tryProduct(as: IterableOnce[WholeNumber]): Option[WholeNumber]

Given a sequence of as, combine them and return the total.

Given a sequence of as, combine them and return the total.

If the sequence is empty, returns None. Otherwise, returns Some(total).

Attributes

Definition Classes
MultiplicativeMonoid -> MultiplicativeSemigroup
Inherited from:
MultiplicativeMonoid
override def trySum(as: IterableOnce[WholeNumber]): Option[WholeNumber]

Given a sequence of as, combine them and return the total.

Given a sequence of as, combine them and return the total.

If the sequence is empty, returns None. Otherwise, returns Some(total).

Attributes

Definition Classes
AdditiveMonoid -> AdditiveSemigroup
Inherited from:
AdditiveMonoid

Returns the zero value of the WholeNumber type.

Returns the zero value of the WholeNumber type.

Attributes

Returns

The zero value representing a WholeNumber with the value of 0.

Inherited from:
WholeNumberIsCommutativeRing