scalation

math

package math

The math package contains classes, traits and objects for common mathematical operations.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. math
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. case class Complex(re: Double, im: Double = 0.0) extends Fractional[Complex] with Ordered[Complex] with Product with Serializable

    The Complex class is used to represent and operate on complex numbers.

    The Complex class is used to represent and operate on complex numbers. Internally, a complex number is represented as two double precision floating point numbers (Double). Externally, two forms are supported:

    a+bi = 2.1+3.2i via: Complex ("2.1+3.2i"), toString (a, b) = (2.1, 3.2) via: create ("(2.1,=, 3.2)"), toString2

    Note: 'i * i = -1'.

    re

    the real part (e.g., 2.1)

    im

    the imaginary part (e.g., 3.2)

  2. case class DoubleWithExp(x: Double) extends Product with Serializable

    The DoubleWithExp class defines an expontiation operator '~^' for Doubles.

    The DoubleWithExp class defines an expontiation operator '~^' for Doubles.

    x

    the base

  3. case class IntWithExp(x: Int) extends Product with Serializable

    The IntWithExp class defines an expontiation operator '~^' for Ints.

    The IntWithExp class defines an expontiation operator '~^' for Ints.

    x

    the base

  4. case class LongWithExp(m: Long) extends Product with Serializable

    The LongWithExp class defines an expontiation operator '~^' for Longs. To maintain 64 bit precision, no floating point operations are used.

    The LongWithExp class defines an expontiation operator '~^' for Longs. To maintain 64 bit precision, no floating point operations are used.

    m

    the long base

  5. case class ProbNumber(x: Double, p: Double = 1.0) extends Numeric[ProbNumber] with Ordered[ProbNumber] with Error with Product with Serializable

    The ProbNumber class is used to represent probabilistic numbers '(x, p)' where 'x' is a real number and 'p' is its probability of occurrence.

    The ProbNumber 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

  6. case class Rational(num: Long, den: Long = 1l) extends Fractional[Rational] with Ordered[Rational] with Product with Serializable

    The Rational class is used to represent and operate on rational numbers.

    The Rational class is used to represent and operate on rational numbers. Internally, a rational number is represented as two long integers. Externally, two forms are supported:

    a/b = 2/3 via: Rational ("2/3"), toString (a, b) = (2, 3) via: create ("(2, 3)") toString2

    Rational number can be created without loss of precision using the constructor, apply, create or fromBigDecimal methods. Other methods may lose precision.

    num

    the numerator (e.g., 2)

    den

    the denominator (e.g., 3)

Value Members

  1. object Basic

    The Basic object provides additional methods for computing logarithms and a method for transforming Booleans into Ints.

  2. object BasicTest extends App

    The BasicTest object is used to test the Basic object.

  3. object Combinatorics extends Error

    The Combinatorics object provides several common combinatorics functions, such as factorial permutations, combinations, gamma and beta functions.

  4. object CombinatoricsTest extends App

    The CombinatoricsTest object tests the methods in the Combinatorics object.

  5. object CombinatoricsTest2 extends App

    The CombinatoricsTest2 object tests the Gamma and factorial methods in the Combinatorics object.

  6. object Complex extends Serializable

    The Complex companion object defines the origin (zero) and the fourth roots of unity as well as some utility functions.

  7. object ComplexTest extends App

    The ComplexTest object is used to test the Complex class.

  8. object DoubleWithExp extends Serializable

    The DoubleWithExp companion object provides implicit conversion from Double to DoubleWithExp allowing '~^' to be applied to Doubles. It also provide a negative exponential function.

  9. object DoubleWithExpTest extends App

    The DoubleWithExpTest object is used to test the DoubleWithExp class.

  10. object ExtremeD

    The ExtremeD object contains constants representing extreme values for Double (IEEE 754 double precision floating point numbers).

    The ExtremeD object contains constants representing extreme values for Double (IEEE 754 double precision floating point numbers).

    See also

    en.wikipedia.org/wiki/Double-precision_floating-point_format

  11. object ExtremeDTest extends App

    The ExtremeDTest object is used to test the ExtremeD class.

  12. object IntWithExp extends Serializable

    The IntWithExp object provides implicit conversion from Int to IntWithExp allowing '~^' to be applied to Ints.

  13. object IntWithExpTest extends App

    The IntWithExpTest object is used to test the IntWithExp class.

  14. object LongWithExp extends Serializable

    The LongWithExp obejct provides implicit conversion from Long to LongWithExp allowing '~^' to be applied to Longs.

  15. object LongWithExpTest extends App

    The LongWithExpTest object is used to test the LongWithExp class.

  16. object Primes

    The Primes object provides an array of 1000 prime numbers as well as methods to generate prime numbers within a given range.

  17. object PrimesTest extends App

    The PrimesTest object is use to perform timing test on the Primes object.

  18. object ProbNumberTest extends App

    The ProbNumberTest object is used to test the ProbNumber class.

  19. object Rational extends Serializable

    The Rational companion object defines the origin (zero), one and minus one as well as some utility functions.

  20. object RationalTest extends App

    The RationalTest object is used to test the Rational class.

Inherited from AnyRef

Inherited from Any

Ungrouped