case class ProbNum(x: Double, p: Double = 1.0) extends Numeric[ProbNum] with Ordered[ProbNum] with Error with Product with Serializable
The ProbNum
class is used to represent probabilistic numbers '(x, p)'
where 'x' is a real number and 'p' is its probability of occurrence.
FIX: Currently this class is half-baked!!!
- x
the real number (double precision)
- p
the probability of its occurrence [0, 1]
- See also
http://okmij.org/ftp/Computation/monads.html#random-var-monad
- Alphabetic
- By Inheritance
- ProbNum
- Product
- Equals
- Error
- Ordered
- Comparable
- Numeric
- Ordering
- PartialOrdering
- Equiv
- Serializable
- Comparator
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ProbNum(x: Double, p: Double = 1.0)
- x
the real number (double precision)
- p
the probability of its occurrence [0, 1]
Type Members
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def *(xp: ProbNum): ProbNum
Multiply two probabilistic numbers.
Multiply two probabilistic numbers.
- xp
multiply this times 'xp'
- def +(xp: ProbNum): ProbNum
Add two probabilistic numbers.
Add two probabilistic numbers.
- xp
add 'xp' to this
- def -(xp: ProbNum): ProbNum
Subtract two probabilistic numbers.
Subtract two probabilistic numbers.
- xp
subtract 'xp' from this
- def <(that: ProbNum): Boolean
- Definition Classes
- Ordered
- def <=(that: ProbNum): Boolean
- Definition Classes
- Ordered
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def >(that: ProbNum): Boolean
- Definition Classes
- Ordered
- def >=(that: ProbNum): Boolean
- Definition Classes
- Ordered
- def abs(x: ProbNum): ProbNum
- Definition Classes
- Numeric
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def compare(yq: ProbNum): Int
Compare this probabilistic number with that probabilistic number 'yq'.
Compare this probabilistic number with that probabilistic number 'yq'.
- yq
that probabilistic number
- Definition Classes
- ProbNum → Ordered
- def compare(xp: ProbNum, yq: ProbNum): Int
Compare two probabilistic numbers (negative for <, zero for ==, positive for >).
Compare two probabilistic numbers (negative for <, zero for ==, positive for >).
- xp
the first probabilistic number to compare
- yq
the second probabilistic number to compare
- Definition Classes
- ProbNum → Ordering → Comparator
- def compareTo(that: ProbNum): Int
- Definition Classes
- Ordered → Comparable
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equiv(x: ProbNum, y: ProbNum): Boolean
- Definition Classes
- Ordering → PartialOrdering → Equiv
- final def flaw(method: String, message: String): Unit
Show the flaw by printing the error message.
Show the flaw by printing the error message.
- method
the method where the error occurred
- message
the error message
- Definition Classes
- Error
- def fromInt(n: Int): ProbNum
Create a probabilistic number from an
Int
.Create a probabilistic number from an
Int
.- n
the integer used to create the probabilistic number.
- Definition Classes
- ProbNum → Numeric
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def gt(x: ProbNum, y: ProbNum): Boolean
- Definition Classes
- Ordering → PartialOrdering
- def gteq(x: ProbNum, y: ProbNum): Boolean
- Definition Classes
- Ordering → PartialOrdering
- def isCertain: Boolean
Determine whether the probabilistic number is certain (probability = 1).
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isReverseOf(other: Ordering[_]): Boolean
- Definition Classes
- Ordering
- def lt(x: ProbNum, y: ProbNum): Boolean
- Definition Classes
- Ordering → PartialOrdering
- def lteq(x: ProbNum, y: ProbNum): Boolean
- Definition Classes
- Ordering → PartialOrdering
- def max[U <: ProbNum](x: U, y: U): U
- Definition Classes
- Ordering
- def min[U <: ProbNum](x: U, y: U): U
- Definition Classes
- Ordering
- def minus(xp: ProbNum, yq: ProbNum): ProbNum
- Definition Classes
- ProbNum → Numeric
- implicit def mkNumericOps(lhs: ProbNum): NumericOps
- Definition Classes
- Numeric
- implicit def mkOrderingOps(lhs: ProbNum): OrderingOps
- Definition Classes
- Ordering
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def negate(xp: ProbNum): ProbNum
- Definition Classes
- ProbNum → Numeric
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def on[U](f: (U) => ProbNum): Ordering[U]
- Definition Classes
- Ordering
- def one: ProbNum
- Definition Classes
- Numeric
- def orElse(other: Ordering[ProbNum]): Ordering[ProbNum]
- Definition Classes
- Ordering
- def orElseBy[S](f: (ProbNum) => S)(implicit ord: Ordering[S]): Ordering[ProbNum]
- Definition Classes
- Ordering
- val p: Double
- def parseString(str: String): Option[ProbNum]
Parse the string to create a complex number.
Parse the string to create a complex number.
- Definition Classes
- ProbNum → Numeric
- def plus(xp: ProbNum, yq: ProbNum): ProbNum
- Definition Classes
- ProbNum → Numeric
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def reverse: Ordering[ProbNum]
- Definition Classes
- Ordering → PartialOrdering
- def reversed(): Comparator[ProbNum]
- Definition Classes
- Comparator
- def sign(x: ProbNum): ProbNum
- Definition Classes
- Numeric
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def thenComparing[U <: Comparable[_ >: U <: AnyRef]](arg0: Function[_ >: ProbNum <: AnyRef, _ <: U]): Comparator[ProbNum]
- Definition Classes
- Comparator
- def thenComparing[U <: AnyRef](arg0: Function[_ >: ProbNum <: AnyRef, _ <: U], arg1: Comparator[_ >: U <: AnyRef]): Comparator[ProbNum]
- Definition Classes
- Comparator
- def thenComparing(arg0: Comparator[_ >: ProbNum <: AnyRef]): Comparator[ProbNum]
- Definition Classes
- Comparator
- def thenComparingDouble(arg0: ToDoubleFunction[_ >: ProbNum <: AnyRef]): Comparator[ProbNum]
- Definition Classes
- Comparator
- def thenComparingInt(arg0: ToIntFunction[_ >: ProbNum <: AnyRef]): Comparator[ProbNum]
- Definition Classes
- Comparator
- def thenComparingLong(arg0: ToLongFunction[_ >: ProbNum <: AnyRef]): Comparator[ProbNum]
- Definition Classes
- Comparator
- def times(xp: ProbNum, yq: ProbNum): ProbNum
- Definition Classes
- ProbNum → Numeric
- def toDouble(xp: ProbNum): Double
Convert the probabilistic number to a
Double
.Convert the probabilistic number to a
Double
.- xp
the probabilistic number to convert
- Definition Classes
- ProbNum → Numeric
- def toFloat(xp: ProbNum): Float
Convert the probabilistic number to a
Float
.Convert the probabilistic number to a
Float
.- xp
the probabilistic number to convert
- Definition Classes
- ProbNum → Numeric
- def toInt(xp: ProbNum): Int
Convert the probabilistic number to an
Int
.Convert the probabilistic number to an
Int
.- xp
the probabilistic number to convert
- Definition Classes
- ProbNum → Numeric
- def toLong(xp: ProbNum): Long
Convert the probabilistic number to a
Long
.Convert the probabilistic number to a
Long
.- Definition Classes
- ProbNum → Numeric
- def toString(): String
Convert this probabilistic number to a
String
.Convert this probabilistic number to a
String
.- Definition Classes
- ProbNum → AnyRef → Any
- def tryCompare(x: ProbNum, y: ProbNum): Some[Int]
- Definition Classes
- Ordering → PartialOrdering
- def unary_-: ProbNum
Compute the unary minus (-).
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- val x: Double
- def zero: ProbNum
- Definition Classes
- Numeric