trait EuclideanRing[A] extends GCDRing[A]
EuclideanRing implements a Euclidean domain.
The formal definition says that every euclidean domain A has (at least one) euclidean function f: A -> N (the natural numbers) where:
(for every x and non-zero y) x = yq + r, and r = 0 or f(r) < f(y).
This generalizes the Euclidean division of integers, where f represents a measure of length (or absolute value), and the previous equation represents finding the quotient and remainder of x and y. So:
quot(x, y) = q mod(x, y) = r
- Self Type
- EuclideanRing[A]
- Source
- EuclideanRing.scala
- Alphabetic
- By Inheritance
- EuclideanRing
- GCDRing
- CommutativeRing
- CommutativeRng
- CommutativeRig
- MultiplicativeCommutativeMonoid
- CommutativeSemiring
- MultiplicativeCommutativeSemigroup
- Ring
- Rng
- AdditiveCommutativeGroup
- AdditiveGroup
- Rig
- MultiplicativeMonoid
- Semiring
- MultiplicativeSemigroup
- AdditiveCommutativeMonoid
- AdditiveCommutativeSemigroup
- AdditiveMonoid
- AdditiveSemigroup
- Serializable
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def emod(a: A, b: A): A
- abstract def equot(a: A, b: A): A
- abstract def euclideanFunction(a: A): BigInt
- abstract def getClass(): Class[_ <: AnyRef]
- Definition Classes
- Any
- abstract def negate(x: A): A
- Definition Classes
- AdditiveGroup
- abstract def one: A
- Definition Classes
- MultiplicativeMonoid
- abstract def plus(x: A, y: A): A
- Definition Classes
- AdditiveSemigroup
- abstract def times(x: A, y: A): A
- Definition Classes
- MultiplicativeSemigroup
- abstract def zero: A
- Definition Classes
- AdditiveMonoid
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- def additive: CommutativeGroup[A]
- Definition Classes
- AdditiveCommutativeGroup → AdditiveCommutativeMonoid → AdditiveCommutativeSemigroup → AdditiveGroup → AdditiveMonoid → AdditiveSemigroup
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def equals(arg0: Any): Boolean
- Definition Classes
- Any
- def equotmod(a: A, b: A): (A, A)
- def fromBigInt(n: BigInt): A
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'sone
, or-n
summations of-one
ifn
is negative.Most type class instances should consider overriding this method for performance reasons.
- Definition Classes
- Ring
- def fromInt(n: Int): A
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'sone
, or-n
summations of-one
ifn
is negative.Most type class instances should consider overriding this method for performance reasons.
- Definition Classes
- Ring
- def gcd(a: A, b: A)(implicit ev: Eq[A]): A
- Definition Classes
- EuclideanRing → GCDRing
- def hashCode(): Int
- Definition Classes
- Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isOne(a: A)(implicit ev: Eq[A]): Boolean
Tests if
a
is one.Tests if
a
is one.- Definition Classes
- MultiplicativeMonoid
- def isZero(a: A)(implicit ev: Eq[A]): Boolean
Tests if
a
is zero.Tests if
a
is zero.- Definition Classes
- AdditiveMonoid
- def lcm(a: A, b: A)(implicit ev: Eq[A]): A
- Definition Classes
- EuclideanRing → GCDRing
- def minus(x: A, y: A): A
- Definition Classes
- AdditiveGroup
- def multiplicative: CommutativeMonoid[A]
- Definition Classes
- MultiplicativeCommutativeMonoid → MultiplicativeCommutativeSemigroup → MultiplicativeMonoid → MultiplicativeSemigroup
- def positivePow(a: A, n: Int): A
- Attributes
- protected[this]
- Definition Classes
- MultiplicativeSemigroup
- def positiveSumN(a: A, n: Int): A
- Attributes
- protected[this]
- Definition Classes
- AdditiveSemigroup
- def pow(a: A, n: Int): A
- Definition Classes
- MultiplicativeMonoid → MultiplicativeSemigroup
- def product(as: TraversableOnce[A]): A
Given a sequence of
as
, compute the product.Given a sequence of
as
, compute the product.- Definition Classes
- MultiplicativeMonoid
- Annotations
- @nowarn()
- def sum(as: TraversableOnce[A]): A
Given a sequence of
as
, compute the sum.Given a sequence of
as
, compute the sum.- Definition Classes
- AdditiveMonoid
- Annotations
- @nowarn()
- def sumN(a: A, n: Int): A
- Definition Classes
- AdditiveGroup → AdditiveMonoid → AdditiveSemigroup
- def toString(): String
- Definition Classes
- Any
- def tryProduct(as: TraversableOnce[A]): Option[A]
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).
- Definition Classes
- MultiplicativeMonoid → MultiplicativeSemigroup
- Annotations
- @nowarn()
- def trySum(as: TraversableOnce[A]): Option[A]
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).
- Definition Classes
- AdditiveMonoid → AdditiveSemigroup
- Annotations
- @nowarn()