Class

spire.math

RationalAlgebra

Related Doc: package math

Permalink

class RationalAlgebra extends RationalIsField with RationalIsReal with Serializable

Annotations
@SerialVersionUID()
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RationalAlgebra
  2. Serializable
  3. Serializable
  4. RationalIsReal
  5. IsRational
  6. IsAlgebraic
  7. IsReal
  8. Signed
  9. Order
  10. PartialOrder
  11. Eq
  12. RationalIsField
  13. Field
  14. MultiplicativeAbGroup
  15. MultiplicativeGroup
  16. EuclideanRing
  17. CRing
  18. MultiplicativeCMonoid
  19. MultiplicativeCSemigroup
  20. Ring
  21. Rng
  22. AdditiveAbGroup
  23. AdditiveCMonoid
  24. AdditiveCSemigroup
  25. AdditiveGroup
  26. Rig
  27. MultiplicativeMonoid
  28. Semiring
  29. MultiplicativeSemigroup
  30. AdditiveMonoid
  31. AdditiveSemigroup
  32. AnyRef
  33. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RationalAlgebra()

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def abs(a: Rational): Rational

    Permalink

    An idempotent function that ensures an object has a non-negative sign.

    An idempotent function that ensures an object has a non-negative sign.

    Definition Classes
    RationalIsReal → Signed
  5. def additive: AbGroup[Rational]

    Permalink
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def ceil(a: Rational): Rational

    Permalink

    Rounds a the nearest integer that is greater than or equal to a.

    Rounds a the nearest integer that is greater than or equal to a.

    Definition Classes
    RationalIsReal → IsReal
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def compare(x: Rational, y: Rational): Int

    Permalink
    Definition Classes
    RationalIsReal → Order
  10. def div(a: Rational, b: Rational): Rational

    Permalink
    Definition Classes
    RationalIsField → MultiplicativeGroup
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def eqv(x: Rational, y: Rational): Boolean

    Permalink

    Returns true if x and y are equivalent, false otherwise.

    Returns true if x and y are equivalent, false otherwise.

    Definition Classes
    RationalIsReal → OrderPartialOrderEq
  14. final def euclid(a: Rational, b: Rational)(implicit eq: Eq[Rational]): Rational

    Permalink
    Attributes
    protected[this]
    Definition Classes
    EuclideanRing
    Annotations
    @tailrec()
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def floor(a: Rational): Rational

    Permalink

    Rounds a the nearest integer that is less than or equal to a.

    Rounds a the nearest integer that is less than or equal to a.

    Definition Classes
    RationalIsReal → IsReal
  17. def fromDouble(n: Double): Rational

    Permalink

    This is implemented in terms of basic Field ops.

    This is implemented in terms of basic Field ops. However, this is probably significantly less efficient than can be done with a specific type. So, it is recommended that this method is overriden.

    This is possible because a Double is a rational number.

    Definition Classes
    RationalIsField → Field
  18. def fromInt(n: Int): Rational

    Permalink

    Defined to be equivalent to additive.sumn(one, n).

    Defined to be equivalent to additive.sumn(one, n). That is, n repeated summations of this ring's one, or -one if n is negative.

    Definition Classes
    RationalIsField → Ring
  19. def gcd(a: Rational, b: Rational): Rational

    Permalink
    Definition Classes
    RationalIsField → EuclideanRing
  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. def gt(x: Rational, y: Rational): Boolean

    Permalink
    Definition Classes
    RationalIsReal → OrderPartialOrder
  22. def gteqv(x: Rational, y: Rational): Boolean

    Permalink
    Definition Classes
    RationalIsReal → OrderPartialOrder
  23. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. def isOne(a: Rational)(implicit ev: Eq[Rational]): Boolean

    Permalink
    Definition Classes
    MultiplicativeMonoid
  26. def isSignNegative(a: Rational): Boolean

    Permalink
    Definition Classes
    Signed
  27. def isSignNonNegative(a: Rational): Boolean

    Permalink
    Definition Classes
    Signed
  28. def isSignNonPositive(a: Rational): Boolean

    Permalink
    Definition Classes
    Signed
  29. def isSignNonZero(a: Rational): Boolean

    Permalink
    Definition Classes
    Signed
  30. def isSignPositive(a: Rational): Boolean

    Permalink
    Definition Classes
    Signed
  31. def isSignZero(a: Rational): Boolean

    Permalink
    Definition Classes
    Signed
  32. def isWhole(a: Rational): Boolean

    Permalink

    Returns true iff a is a an integer.

    Returns true iff a is a an integer.

    Definition Classes
    RationalIsReal → IsReal
  33. def isZero(a: Rational)(implicit ev: Eq[Rational]): Boolean

    Permalink

    Tests if a is zero.

    Tests if a is zero.

    Definition Classes
    AdditiveMonoid
  34. def lcm(a: Rational, b: Rational): Rational

    Permalink
    Definition Classes
    EuclideanRing
  35. def lt(x: Rational, y: Rational): Boolean

    Permalink
    Definition Classes
    RationalIsReal → OrderPartialOrder
  36. def lteqv(x: Rational, y: Rational): Boolean

    Permalink
    Definition Classes
    RationalIsReal → OrderPartialOrder
  37. def max(x: Rational, y: Rational): Rational

    Permalink
    Definition Classes
    Order
  38. def min(x: Rational, y: Rational): Rational

    Permalink
    Definition Classes
    Order
  39. def minus(a: Rational, b: Rational): Rational

    Permalink
    Definition Classes
    RationalIsField → AdditiveGroup
  40. def mod(a: Rational, b: Rational): Rational

    Permalink
    Definition Classes
    RationalIsField → EuclideanRing
  41. def multiplicative: AbGroup[Rational]

    Permalink
  42. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  43. def negate(a: Rational): Rational

    Permalink
    Definition Classes
    RationalIsField → AdditiveGroup
  44. def neqv(x: Rational, y: Rational): Boolean

    Permalink

    Returns false if x and y are equivalent, true otherwise.

    Returns false if x and y are equivalent, true otherwise.

    Definition Classes
    RationalIsReal → Eq
  45. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  46. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  47. def on[B](f: (B) ⇒ Rational): Order[B]

    Permalink

    Defines an order on B by mapping B to A using f and using As order to order B.

    Defines an order on B by mapping B to A using f and using As order to order B.

    Definition Classes
    OrderPartialOrderEq
  48. def one: Rational

    Permalink
    Definition Classes
    RationalIsField → MultiplicativeMonoid
  49. def partialCompare(x: Rational, y: Rational): Double

    Permalink

    Result of comparing x with y.

    Result of comparing x with y. Returns NaN if operands are not comparable. If operands are comparable, returns a Double whose sign is: - negative iff x < y - zero iff x === y - positive iff x > y

    Definition Classes
    OrderPartialOrder
  50. def plus(a: Rational, b: Rational): Rational

    Permalink
    Definition Classes
    RationalIsField → AdditiveSemigroup
  51. def pmax(x: Rational, y: Rational): Option[Rational]

    Permalink

    Returns Some(x) if x >= y, Some(y) if x < y, otherwise None.

    Returns Some(x) if x >= y, Some(y) if x < y, otherwise None.

    Definition Classes
    PartialOrder
  52. def pmin(x: Rational, y: Rational): Option[Rational]

    Permalink

    Returns Some(x) if x <= y, Some(y) if x > y, otherwise None.

    Returns Some(x) if x <= y, Some(y) if x > y, otherwise None.

    Definition Classes
    PartialOrder
  53. def pow(a: Rational, b: Int): Rational

    Permalink

    This is similar to Semigroup#pow, except that a pow 0 is defined to be the multiplicative identity.

    This is similar to Semigroup#pow, except that a pow 0 is defined to be the multiplicative identity.

    Definition Classes
    RationalIsField → RigSemiring
  54. def prod(as: TraversableOnce[Rational]): Rational

    Permalink

    Given a sequence of as, sum them using the monoid and return the total.

    Given a sequence of as, sum them using the monoid and return the total.

    Definition Classes
    MultiplicativeMonoid
  55. def prodOption(as: TraversableOnce[Rational]): Option[Rational]

    Permalink

    Given a sequence of as, sum them using the semigroup and return the total.

    Given a sequence of as, sum them using the semigroup and return the total.

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

    Definition Classes
    MultiplicativeSemigroup
  56. def prodn(a: Rational, n: Int): Rational

    Permalink

    Return a multiplicated with itself n times.

    Return a multiplicated with itself n times.

    Definition Classes
    MultiplicativeGroupMultiplicativeMonoidMultiplicativeSemigroup
  57. def prodnAboveOne(a: Rational, n: Int): Rational

    Permalink
    Attributes
    protected
    Definition Classes
    MultiplicativeSemigroup
  58. def quot(a: Rational, b: Rational): Rational

    Permalink
    Definition Classes
    RationalIsField → EuclideanRing
  59. def quotmod(a: Rational, b: Rational): (Rational, Rational)

    Permalink
    Definition Classes
    RationalIsField → EuclideanRing
  60. def reciprocal(x: Rational): Rational

    Permalink
    Definition Classes
    MultiplicativeGroup
  61. def reverse: Order[Rational]

    Permalink

    Defines an ordering on A where all arrows switch direction.

    Defines an ordering on A where all arrows switch direction.

    Definition Classes
    OrderPartialOrder
  62. def round(a: Rational): Rational

    Permalink

    Rounds a to the nearest integer.

    Rounds a to the nearest integer.

    Definition Classes
    RationalIsReal → IsReal
  63. def sign(a: Rational): Sign

    Permalink

    Returns Zero if a is 0, Positive if a is positive, and Negative is a is negative.

    Returns Zero if a is 0, Positive if a is positive, and Negative is a is negative.

    Definition Classes
    RationalIsReal → Signed
  64. def signum(a: Rational): Int

    Permalink

    Returns 0 if a is 0, > 0 if a is positive, and < 0 is a is negative.

    Returns 0 if a is 0, > 0 if a is positive, and < 0 is a is negative.

    Definition Classes
    RationalIsReal → Signed
  65. def sum(as: TraversableOnce[Rational]): Rational

    Permalink

    Given a sequence of as, sum them using the monoid and return the total.

    Given a sequence of as, sum them using the monoid and return the total.

    Definition Classes
    AdditiveMonoid
  66. def sumOption(as: TraversableOnce[Rational]): Option[Rational]

    Permalink

    Given a sequence of as, sum them using the semigroup and return the total.

    Given a sequence of as, sum them using the semigroup and return the total.

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

    Definition Classes
    AdditiveSemigroup
  67. def sumn(a: Rational, n: Int): Rational

    Permalink

    Return a added with itself n times.

    Return a added with itself n times.

    Definition Classes
    AdditiveGroupAdditiveMonoidAdditiveSemigroup
  68. def sumnAboveOne(a: Rational, n: Int): Rational

    Permalink
    Attributes
    protected
    Definition Classes
    AdditiveSemigroup
  69. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  70. def times(a: Rational, b: Rational): Rational

    Permalink
    Definition Classes
    RationalIsField → MultiplicativeSemigroup
  71. def toAlgebraic(a: Rational): Algebraic

    Permalink
    Definition Classes
    IsRationalIsAlgebraic
  72. def toDouble(r: Rational): Double

    Permalink

    Approximates a as a Double.

    Approximates a as a Double.

    Definition Classes
    RationalIsReal → IsReal
  73. def toRational(a: Rational): Rational

    Permalink
    Definition Classes
    RationalIsReal → IsRational
  74. def toReal(a: Rational): Real

    Permalink
    Definition Classes
    IsAlgebraicIsReal
  75. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  76. def tryCompare(x: Rational, y: Rational): Option[Int]

    Permalink

    Result of comparing x with y.

    Result of comparing x with y. Returns None if operands are not comparable. If operands are comparable, returns Some[Int] where the Int sign is: - negative iff x < y - zero iff x == y - positive iff x > y

    Definition Classes
    PartialOrder
  77. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  78. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  79. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  80. def zero: Rational

    Permalink
    Definition Classes
    RationalIsField → AdditiveMonoid

Inherited from Serializable

Inherited from Serializable

Inherited from RationalIsReal

Inherited from IsRational[Rational]

Inherited from IsAlgebraic[Rational]

Inherited from IsReal[Rational]

Inherited from Signed[Rational]

Inherited from Order[Rational]

Inherited from PartialOrder[Rational]

Inherited from Eq[Rational]

Inherited from RationalIsField

Inherited from Field[Rational]

Inherited from MultiplicativeGroup[Rational]

Inherited from EuclideanRing[Rational]

Inherited from CRing[Rational]

Inherited from Ring[Rational]

Inherited from Rng[Rational]

Inherited from AdditiveAbGroup[Rational]

Inherited from AdditiveCMonoid[Rational]

Inherited from AdditiveCSemigroup[Rational]

Inherited from AdditiveGroup[Rational]

Inherited from Rig[Rational]

Inherited from MultiplicativeMonoid[Rational]

Inherited from Semiring[Rational]

Inherited from AdditiveMonoid[Rational]

Inherited from AdditiveSemigroup[Rational]

Inherited from AnyRef

Inherited from Any

Ungrouped