Packages

  • package root
    Definition Classes
    root
  • package scalation

    The scalation package specifies system-wide constants for directory paths.

    The scalation package specifies system-wide constants for directory paths. Sub-packages may wish to define 'BASE-DIR = DATA_DIR + ⁄ + <package>' in their own 'package.scala' files. For maintainability, directory paths should only be specified in 'package.scala' files.

    Definition Classes
    root
  • package linalgebra

    The linalgebra package contains classes, traits and objects for linear algebra, including vectors and matrices for real and complex numbers.

    The linalgebra package contains classes, traits and objects for linear algebra, including vectors and matrices for real and complex numbers.

    Definition Classes
    scalation
  • package math

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

    The math package contains classes, traits and objects for common mathematical operations. Its package object defines exponentiation, logarithmic, trigonometric, etc. operators and functions.

    Definition Classes
    scalation
  • Combinatorics
  • CombinatoricsTest
  • CombinatoricsTest2
  • Complex
  • ComplexTest
  • Double_Exp
  • ExtensionTest
  • ExtremeD
  • ExtremeDTest
  • Int_Exp
  • Long_Exp
  • MathTest
  • Primes
  • PrimesTest
  • ProbNum
  • ProbNumTest
  • Rational
  • RationalTest
  • Real
  • RealTest
  • StrNumTest
  • StrO
  • package par
    Definition Classes
    scalation
  • package plot

    The plot package contains classes, traits and objects for simple plotting of x-y data.

    The plot package contains classes, traits and objects for simple plotting of x-y data.

    Definition Classes
    scalation
  • package random

    The random package contains classes, traits and objects for the generation of random numbers.

    The random package contains classes, traits and objects for the generation of random numbers.

    Definition Classes
    scalation
  • package relalgebra

    The relalgebra package contains classes, traits and objects for columnar relational algebra, where columns are vectors from the linalgebra package.

    The relalgebra package contains classes, traits and objects for columnar relational algebra, where columns are vectors from the linalgebra package.

    Definition Classes
    scalation
  • package scala2d

    The scala2d package contains classes, traits and objects for for simple 2D graphics in scala, based upon java.swing, java.awt and java_awt_geom.

    The scala2d package contains classes, traits and objects for for simple 2D graphics in scala, based upon java.swing, java.awt and java_awt_geom.

    Definition Classes
    scalation
  • package stat

    The stat package contains classes, traits and objects for basic statistical functions and analyses.

    The stat package contains classes, traits and objects for basic statistical functions and analyses. The package object itself defines an implicit conversion from scalation.linalgebra.VectorD to StatVector.

    Definition Classes
    scalation
  • package util

    The util package contains classes, traits and objects for basic utility functions.

    The util package contains classes, traits and objects for basic utility functions.

    Definition Classes
    scalation

package math

The math package contains classes, traits and objects for common mathematical operations. Its package object defines exponentiation, logarithmic, trigonometric, etc. operators and functions.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. math
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
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. final class Double_Exp extends AnyVal

    The Double_Exp value class adds an exponentiation operator 'x ~ y' and a 'near_eq' operator 'x =~ y' to Double. The '~' has higher precedence than '*' or '/'.

  3. type FunctionS2S = (Double) ⇒ Double

    The type definition for a function of a scalar (f: Double => Double)

  4. type Functions = Array[FunctionS2S]

    The type definition for an array of scalar functions

  5. final class Int_Exp extends AnyVal

    The Int_Exp value class adds an exponentiation operator 'x ~ y' and a 'near_eq' operator 'x =~ y' to Int. The '~' has higher precedence than '*' or '/'.

  6. final class Long_Exp extends AnyVal

    The Long_Exp value class adds an exponentiation operator 'x ~ y' and a 'near_eq' operator 'x =~ y' to Long. The '~' has higher precedence than '*' or '/'.

  7. 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.

    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

  8. 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)

  9. case class Real (hi: Double, lo: Double = 0.0) extends Fractional[Real] with Ordered[Real] with Product with Serializable

    The Real class provides higher precision floating point numbers using the Double Double technique, which supports 106 bits of precision.

    The Real class provides higher precision floating point numbers using the Double Double technique, which supports 106 bits of precision. ----------------------------------------------------------------------------- Code adapted from DoubleDouble.java:

    hi

    the high portion of the real number

    lo

    the low portion of the real number

    See also

    oai.cwi.nl/oai/asset/9159/9159A.pdf -----------------------------------------------------------------------------

    http://tsusiatsoftware.net/dd/main.html

Value Members

  1. val THRES: Double

    The threshold used for near equality

  2. def cot(x: Double): Double

    Return the cotangent of 'x'

  3. def csc(x: Double): Double

    Return the cosecant of 'x'

  4. implicit def double_exp(x: Double): Double_Exp

    Implicit conversion from 'Double' to 'Double_Exp', which supports exponentiation and nearly equals.

    Implicit conversion from 'Double' to 'Double_Exp', which supports exponentiation and nearly equals.

    x

    the base parameter

  5. implicit def int_exp(x: Int): Int_Exp

    Implicit conversion from 'Int' to 'Int_Exp', which supports exponentiation and nearly equals.

    Implicit conversion from 'Int' to 'Int_Exp', which supports exponentiation and nearly equals.

    x

    the base parameter

  6. def log2(x: Double): Double

    Compute the log of 'x' base 2.

    Compute the log of 'x' base 2.

    x

    the value whose log is sought

  7. val log_10: Double

    The natural log of 10

  8. val log_2: Double

    The natural log of 2

  9. def logb(b: Double, x: Double): Double

    Compute the log of 'x' base 'b'.

    Compute the log of 'x' base 'b'.

    b

    the base of the logarithm

    x

    the value whose log is sought

  10. implicit def long_exp(x: Long): Long_Exp

    Implicit conversion from 'Long' to 'Long_Exp', which supports exponentiation and nearly equals.

    Implicit conversion from 'Long' to 'Long_Exp', which supports exponentiation and nearly equals.

    x

    the base parameter

  11. def near_eq(x: Double, y: Double): Boolean

    Determine whether two double precision floating point numbers 'x' and 'y' are nearly equal.

    Determine whether two double precision floating point numbers 'x' and 'y' are nearly equal. Two numbers are considered to be nearly equal, if within '2 EPSILON'. A number is considered to be nearly zero, if within '2 MIN_NORMAL'. To accommodate round-off errors, may use 'TOL' instead of 'EPSILON'. --------------------------------------------------------------------------

    x

    the first double precision floating point number

    y

    the second double precision floating point number

    See also

    http://stackoverflow.com/questions/10034149/why-is-nan-not-equal-to-nan --------------------------------------------------------------------------

    stackoverflow.com/questions/4915462/how-should-i-do-floating-point-comparison -------------------------------------------------------------------------- If both 'x' and 'y' are NaN (Not-a-Number), the IEEE standard indicates that should be considered always not equal. For 'near_eq', they are considered nearly equal. Comment out the first line below to conform more closely to the IEEE standard.

    BasicTest

  12. def nexp(x: Double): Double

    Negative exponential function (e to the minus 'x').

    Negative exponential function (e to the minus 'x').

    x

    the argument of the function

  13. def oneIf(cond: Boolean): Int

    Return 1 if condition 'cond' is true, else 0.

    Return 1 if condition 'cond' is true, else 0.

    cond

    the condition to evaluate

  14. def pow(x: Long, y: Long): Long

    Power function for scala Longs 'x ~^ y'. Compute: 'math.pow (x, y).toLong' without using floating point, so as to not lose precision.

    Power function for scala Longs 'x ~^ y'. Compute: 'math.pow (x, y).toLong' without using floating point, so as to not lose precision.

    x

    the Long base parameter

    y

    the Long exponent parameter

  15. def root(x: Long, y: Long): Long

    Find the 'y'-th root of 'x', i.e., 'x ~ 1/y' for scala Longs. 'r = x ~ 1/y' is largest long integer 'r' such that 'r ~^ y <= x'.

    Find the 'y'-th root of 'x', i.e., 'x ~ 1/y' for scala Longs. 'r = x ~ 1/y' is largest long integer 'r' such that 'r ~^ y <= x'.

    x

    the Long base parameter

    y

    the Long root level (reciprocal exponent) parameter

    See also

    http://stackoverflow.com/questions/8826822/calculate-nth-root-with-integer-arithmetic

    http://en.wikipedia.org/wiki/Shifting_nth_root_algorithm

  16. def sec(x: Double): Double

    Return the secant of 'x'

  17. def sign(x: Double, y: Double): Double

    Return the absolute value of 'x' with the sign of 'y'.

    Return the absolute value of 'x' with the sign of 'y'.

    x

    the value contributor

    y

    the sign contributor

  18. object Combinatorics extends Error

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

  19. object CombinatoricsTest extends App

    The CombinatoricsTest object tests the methods in the Combinatorics object.

  20. object CombinatoricsTest2 extends App

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

  21. object Complex extends Serializable

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

  22. object ComplexTest extends App

    The ComplexTest object is used to test the Complex class.

    The ComplexTest object is used to test the Complex class. > run-main scalation.math.ComplexTest

  23. object ExtensionTest extends App

    The ExtensionTest object is used to test the Int_Exp, Long_Exp and Double_Exp classes.

    The ExtensionTest object is used to test the Int_Exp, Long_Exp and Double_Exp classes. > run-main scalation.math.ExtensionTest

  24. 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 ------------------------------------------------------------------------------ 64 bits: 1 sign-bit, 11 exponent-bits, 52 mantissa-bits + 1 implicit

    http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html

  25. object ExtremeDTest extends App

    The ExtremeDTest object is used to test the ExtremeD class.

    The ExtremeDTest object is used to test the ExtremeD class. > run-main scalation.math.ExtremeDTest

  26. object MathTest extends App

    The MathTest object is used to test the supplemental exponential, logarithmic and trigonmetric functions defined in the 'scalation.math' package object.

    The MathTest object is used to test the supplemental exponential, logarithmic and trigonmetric functions defined in the 'scalation.math' package object. > run-main scalation.math.MathTest

  27. object Primes

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

  28. object PrimesTest extends App

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

  29. object ProbNumTest extends App

    The ProbNumTest object is used to test the ProbNum class.

    The ProbNumTest object is used to test the ProbNum class. > run-main scalation.math.ProbNumTest

  30. object Rational extends Serializable

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

  31. object RationalTest extends App

    The RationalTest object is used to test the Rational class.

  32. object Real extends Serializable

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

  33. object RealTest extends App

    The RealTest object is used to test the Real class.

    The RealTest object is used to test the Real class. > run-main scalation.math.RealTest

  34. object StrNumTest extends App

    The StrNumTest object is used to test the StrNum class.

    The StrNumTest object is used to test the StrNum class. > run-main scalation.math.StrNumTest

  35. object StrO

    The StrO object is used to represent and operate on string numbers.

    The StrO object is used to represent and operate on string numbers. It contains an implicit class definition for StrNum, which extends strings with Numeric operations, it it can be used in VectorS. The semantics of StrNum operators are similar those in Pike.

    See also

    http://docs.roxen.com/pike/7.0/tutorial/strings/operators.xml

Inherited from AnyRef

Inherited from Any

Ungrouped