RationalProbability

com.phasmidsoftware.lascala.values.RationalProbability
See theRationalProbability companion object
case class RationalProbability[N](p: Rational[N])(using evidence$1: FiniteIntegral[N]) extends Probability

Probability which is based on a Rational[N]

NOTE that for the | and & methods, we need to convert q into Rational[N]. This is because the unapply method for RationalProbability returns a Rational[Any]

Type parameters

N

the underlying type of Rational[N], with implicit evidence FiniteIntegral[N]

Value parameters

p

the probability as a Rational[N]

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Probability
trait () => Double
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Method to form the complement of this probability

Method to form the complement of this probability

Attributes

Returns

the probability whose numerical value is 1 - this

Method to form the conjunction (product) of this and another probability.

Method to form the conjunction (product) of this and another probability.

Value parameters

p

the other Probability

Attributes

Returns

the conjunction of this and p

def *(r: Rational[N]): Probability
def *[M : Fractional](x: M): Probability

Method to factor this probability by a scalar value

Method to factor this probability by a scalar value

Attributes

Returns

this probability factored by x

override def apply(): Double

Applies the body of this function to the arguments.

Applies the body of this function to the arguments.

Attributes

Returns

the result of function application.

Definition Classes
Function0
override def equals(obj: Any): Boolean

Checks whether this instance is equal to that. This universal equality method is defined in AnyRef.

Checks whether this instance is equal to that. This universal equality method is defined in AnyRef.

Attributes

Definition Classes
Equals -> Any
override def hashCode(): Int

Calculates a hash code value for the object.

Calculates a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns

the hash code value for this object.

Definition Classes
Any

Method to form the disjunction (sum) of this and another probability. Note that the two probability must of independent events for this to yield the correct answer

Method to form the disjunction (sum) of this and another probability. Note that the two probability must of independent events for this to yield the correct answer

Value parameters

p

the other Probability

Attributes

Returns

the disjunction of this and p

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function0 -> Any
Inherited from:
Function0