scalation.math

Combinatorics

object Combinatorics extends Error

This trait provides several common combinatorics functions, such as factorial permutations, combinations, gamma and beta functions.

Linear Supertypes
Error, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Combinatorics
  2. Error
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val EPSILON: Double

    Tolerance for real number comparisons

  7. val SQRT_PI: Double

    Square root of Pi

  8. def approx(x: Double, y: Double): Boolean

    Return true if x == y approximately.

    Return true if x == y approximately.

    x

    the first value to compare

    y

    the second value to compare

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def betaF(a: Double, b: Double): Double

    Compute the beta function B(a, b) for the following two cases: (1) when a or b are integers and (2) when a or b are integers + 1/2.

    Compute the beta function B(a, b) for the following two cases: (1) when a or b are integers and (2) when a or b are integers + 1/2.

    a

    the first parameter, a real number satisfying (1) or (2)

    b

    the second parameter, a real number satisfying (1) or (2)

    See also

    http://mathworld.wolfram.com/BetaFunction.html

  11. def choose(n: Int, k: Int, l: Int): Long

    Compute trinomial coefficients: n choose (k, l), combinations of n things, (k, l) at a time, using Pascal's Tetrahedron.

    Compute trinomial coefficients: n choose (k, l), combinations of n things, (k, l) at a time, using Pascal's Tetrahedron. Ex: Given n balls, counts ways in which k are chosen for group 1 and l are chosen for group 2.

    n

    the total number of items

    k

    the of items to choose

    l

    the of items to choose (requires 0 <= k + l <= n)

    See also

    http://people.sju.edu/~pklingsb/bintrin.pdf

  12. def choose(n: Int, k: Int): Long

    Compute binomial coefficients: n choose k, combinations of n things, k at a time, using Pascal's Triangle.

    Compute binomial coefficients: n choose k, combinations of n things, k at a time, using Pascal's Triangle.

    n

    the total number of items

    k

    the of items to choose (requires k <= n)

    See also

    http://www.mathsisfun.com/pascals-triangle.html

  13. def chose(n: Int, k: Int): Long

    Compute n choose k (combinations of n things, k at a time).

    Compute n choose k (combinations of n things, k at a time). A more efficient implementation is given below.

    n

    the total number of items

    k

    the of items to choose (requires k <= n)

  14. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  15. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  17. def fac(k: Int): Long

    Compute k! (k factorial).

    Compute k! (k factorial).

    k

    the argument to the factorial function

  18. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  19. 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
  20. def gammaF(a: Double): Double

    Compute the gamma function gamma(a) for the following two cases: http://mathworld.

    Compute the gamma function gamma(a) for the following two cases: http://mathworld.wolfram.com/GammaFunction.html (1) when a is an integer and (2) when a is an integer + 1/2.

    a

    the parameter, a real number satisfying (1) or (2)

  21. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  22. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  23. def hyp2f1(z: Double, a: Double, b: Double, c: Double): Double

    Compute Gauss's Hypergeometric function 2F1(z; a, b, c) via an approximation.

    Compute Gauss's Hypergeometric function 2F1(z; a, b, c) via an approximation. @see

    z

    the variable, a real/complex number s.t. |z| < 1

    a

    the first paramater, a real/complex number

    b

    the second parameter, a real/complex number

    c

    the third parameter, a real/complex number, may not be a negative integer

  24. def iBetaF(z: Double, a: Double, b: Double): Double

    Compute the incomplete beta function B(z; a, b), a generalization of the beta function (z = 1).

    Compute the incomplete beta function B(z; a, b), a generalization of the beta function (z = 1).

    z

    the variable, a real/complex number s.t. 0 <= |z| <= 1

    a

    the first parameter, a real/complex number > 0

    b

    the second parameter, a real/complex number > 0

    See also

    http://mathworld.wolfram.com/IncompleteBetaFunction.html

  25. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  26. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  29. val pascalTet: Array[Array[Array[Int]]]

    Initial part of Pascal's Tetrahedron, precomputed to speed calculations (Trinomial Coefficients)

    Initial part of Pascal's Tetrahedron, precomputed to speed calculations (Trinomial Coefficients)

    See also

    https://sites.google.com/site/pascalloids/pascal-s-pyramid-3-var

  30. val pascalTri: Array[Array[Int]]

    Initial part of Pascal's Triangle, precomputed to speed calculations (Binomial Coefficients)

  31. def perm(n: Int, k: Int): Long

    Compute permutations of k items selected from n total items.

    Compute permutations of k items selected from n total items.

    n

    the total number of items

    k

    the of items selected

  32. def rBetaF(z: Double, a: Double, b: Double): Double

    Compute the regularized (incomplete) beta function I(z; a, b).

    Compute the regularized (incomplete) beta function I(z; a, b).

    z

    the variable, a real/complex number s.t. 0 <= |z| <= 1

    a

    the first parameter, a real/complex number > 0

    b

    the second parameter, a real/complex number > 0

    See also

    http://mathworld.wolfram.com/RegularizedBetaFunction.html

  33. def rfac(k: Int, x: Double = 1.): Double

    Compute the kth degree rising factorial of x.

    Compute the kth degree rising factorial of x. When x = 1, this is the regular factorial function k!.

    k

    the number of factors in the product

    x

    the base number to start the product

  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  35. def toString(): String

    Definition Classes
    AnyRef → Any
  36. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Error

Inherited from AnyRef

Inherited from Any