OrderedSemiringOps

com.alecdorrington.scalgebra.ordered.ops.OrderedSemiringOps

Extension methods for OrderedSemiring.

Attributes

Experimental
true
Graph
Supertypes
Known subtypes

Members list

Value members

Inherited methods

final inline def one[X](using X: MultiplicativeIdentity[X]): X

The unique representation of the multiplicative identity (1) in this algebra system. Typically corresponds to values such as 1 or 1.0F.

The unique representation of the multiplicative identity (1) in this algebra system. Typically corresponds to values such as 1 or 1.0F.

Attributes

Inherited from:
MultiplicativeIdentityOps
def two[X](using X: Semiring[X]): X

The unique representation of 2 in this algebra system.

The unique representation of 2 in this algebra system.

Attributes

Inherited from:
SemiringOps
final inline def zero[X](using X: AdditiveIdentity[X]): X

The unique representation of the additive identity (0) in this algebra system. Typically corresponds to values such as 0, 0.0F, or Seq.empty.

The unique representation of the additive identity (0) in this algebra system. Typically corresponds to values such as 0, 0.0F, or Seq.empty.

Attributes

Inherited from:
AdditiveIdentityOps

Extensions

Inherited extensions

extension [X](x: X)(using X: Ordering[X])
infix inline def <(y: X): Boolean

Attributes

Returns

true if the left operand is smaller than the right.

Inherited from:
OrderingOps
infix inline def <=(y: X): Boolean

Attributes

Returns

true if the left operand is not larger than the right.

Inherited from:
OrderingOps
infix inline def >(y: X): Boolean

Attributes

Returns

true if the right operand is larger than the left.

Inherited from:
OrderingOps
infix inline def >=(y: X): Boolean

Attributes

Returns

true if the right operand is not larger than the left.

Inherited from:
OrderingOps
inline def clamp(lb: X, ub: X): X

Clamps this value to the inclusive range [lb, ub].

Clamps this value to the inclusive range [lb, ub].

Attributes

Returns

lb if this value is less than lb, ub if greater than ub, or this value otherwise.

Inherited from:
OrderingOps
def compare(y: X): Int

Determines the relative order of both operands

Determines the relative order of both operands

Attributes

Returns

-1 if in-order (this < x), 1 if out-of-order (this > x), and 0 if equal (this == x).

Inherited from:
OrderingOps
infix inline def max(y: X): X

Attributes

Returns

the larger of both operands.

Inherited from:
OrderingOps
infix inline def min(y: X): X

Attributes

Returns

the smaller of both operands.

Inherited from:
OrderingOps
extension [X](x: X)(using X: AdditiveIdentity[X])
inline def isZero: Boolean

Attributes

Returns

true if this value equals zero.

Inherited from:
AdditiveIdentityOps
extension [X](x: X)(using X: AdditiveSemigroup[X])
infix inline def *:(n: Int): X

Multiplies this value on the left by a strictly positive integer.

Multiplies this value on the left by a strictly positive integer.

Attributes

Throws
IllegalArgumentException

if n ≤ 0.

Inherited from:
AdditiveSemigroupOps
infix inline def +(y: X): X

Computes the sum of both operands.

Computes the sum of both operands.

Attributes

Inherited from:
AdditiveSemigroupOps
infix inline def :*(n: Int): X

Multiplies this value on the right by a strictly positive integer.

Multiplies this value on the right by a strictly positive integer.

Attributes

Throws
IllegalArgumentException

if n ≤ 0.

Inherited from:
AdditiveSemigroupOps
extension [X](x: X)(using X: MultiplicativeIdentity[X])
inline def isOne: Boolean

Attributes

Returns

true if this value equals one.

Inherited from:
MultiplicativeIdentityOps
extension [X](x: X)(using X: MultiplicativeSemigroup[X])
infix inline def *(y: X): X

Computes the product of both operands.

Computes the product of both operands.

Attributes

Inherited from:
MultiplicativeSemigroupOps
infix inline def pow(n: Int): X

Computes this value raised to the power n, for any strictly positive n.

Computes this value raised to the power n, for any strictly positive n.

Attributes

Inherited from:
MultiplicativeSemigroupOps
extension [X](x: X)(using X: AdditiveMonoid[X])
infix inline def *:(n: Int): X

Multiplies this value on the left by a non-negative integer.

Multiplies this value on the left by a non-negative integer.

Attributes

Throws
IllegalArgumentException

if n < 0.

Inherited from:
AdditiveMonoidOps
infix inline def :*(n: Int): X

Multiplies this value on the right by a non-negative integer.

Multiplies this value on the right by a non-negative integer.

Attributes

Throws
IllegalArgumentException

if n < 0.

Inherited from:
AdditiveMonoidOps
extension [X](x: X)(using X: MultiplicativeMonoid[X])
infix inline def pow(n: Int): X

Computes this value raised to the power n, for any non-negative n.

Computes this value raised to the power n, for any non-negative n.

Attributes

Inherited from:
MultiplicativeMonoidOps