scalation

math

package math

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

Visibility
  1. Public
  2. All

Type Members

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

    This class is used to represent complex numbers (a + bi) as (a, b), e.

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

    This class defines an expontiation operator '~^' for Doubles.

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

    This class defines an expontiation operator '~^' for Ints.

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

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

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

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

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

    This class is used to represent rational numbers as 2 long integers.

Value Members

  1. object Basic extends AnyRef

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

  2. object BasicTest extends App

    This object is used to test the Basic object.

  3. object Combinatorics extends Error

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

  4. object CombinatoricsTest extends App

    This object test the methods in the Combinatorics object.

  5. object Complex extends Serializable

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

  6. object ComplexTest extends App

    This object is used to test the Complex class.

  7. object DoubleWithExp extends Serializable

    Implicit conversion from Double to DoubleWithExp allowing '~^' to be applied to Doubles.

  8. object DoubleWithExpTest extends App

    This object is used to test the DoubleWithExp class.

  9. object IntWithExp extends Serializable

    Implicit conversion from Int to IntWithExp allowing '~^' to be applied to Ints.

  10. object IntWithExpTest extends App

    This object is used to test the IntWithExp class.

  11. object LongWithExp extends Serializable

    Implicit conversion from Long to LongWithExp allowing '~^' to be applied to Longs.

  12. object LongWithExpTest extends App

    This object is used to test the LongWithExp class.

  13. object Primes extends AnyRef

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

  14. object PrimesTest extends App

    This object is use to perform timing test on the Primes object.

  15. object ProbNumberTest extends App

    This object is used to test the ProbNumber class.

  16. object Rational extends Serializable

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

  17. object RationalTest extends App

    This object is used to test the Rational class.