package numerics
Contains several standard numerical functions as UFunc with MappingUFuncs,
- Alphabetic
- By Inheritance
- numerics
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
Scaling
extends AnyRef
Scaling utilities.
Scaling utilities.
Often, in order to avoid underflow, we can offload some of the exponent of a double into an int. To make things more efficient, we can actually share that exponent between doubles.
The scales used in this trait are in log space: they can be safely added and subtracted.
Value Members
- val Inf: Double
- val NaN: Double
-
def
closeTo(a: Double, b: Double, relDiff: Double = 1E-4): Boolean
closeTo for Doubles.
- val inf: Double
- val nan: Double
-
def
polyval(coefs: Array[Double], x: Double): Double
Computes the polynomial P(x) with coefficients given in the passed in array.
Computes the polynomial P(x) with coefficients given in the passed in array. coefs(i) is the coef for the x_i term.
-
object
Bessel
Implementations of the Bessel functions, based on Numerical Recipes
-
object
Conversions
Package for common unit conversions.
-
object
I
extends UFunc with MappingUFunc
The indicator function.
The indicator function. 1.0 iff b, else 0.0 For non-boolean arguments, 1.0 iff b != 0, else 0.0
- object IntMath
- object Scaling extends Scaling
- object abs extends UFunc with MappingUFunc
- object acos extends UFunc with MappingUFunc
- object acosh extends UFunc with MappingUFunc
- object asin extends UFunc with MappingUFunc
- object asinh extends UFunc with MappingUFunc
- object atan extends UFunc with MappingUFunc
- object atan2 extends UFunc with MappingUFunc
- object atanh extends UFunc with MappingUFunc
- object cbrt extends UFunc with MappingUFunc
- object ceil extends UFunc with MappingUFunc
- object cos extends UFunc with MappingUFunc
- object cosh extends UFunc with MappingUFunc
-
object
digamma
extends UFunc with MappingUFunc
The derivative of the log gamma function
-
object
erf
extends UFunc with MappingUFunc
An approximation to the error function
-
object
erfc
extends UFunc with MappingUFunc
An approximation to the complementary error function: erfc(x) = 1 - erfc(x)
-
object
erfcinv
extends UFunc with MappingUFunc
Inverse erfc
-
object
erfi
extends UFunc with MappingUFunc
The imaginary error function for real argument x.
The imaginary error function for real argument x.
Adapted from http://www.mathworks.com/matlabcentral/newsreader/view_thread/24120 verified against mathematica
-
object
erfinv
extends UFunc with MappingUFunc
Inverse erf
- object exp extends UFunc with MappingUFunc
- object expm1 extends UFunc with MappingUFunc
- object floor extends UFunc with MappingUFunc
-
object
gammp
extends UFunc with MappingUFunc
regularized incomplete gamma function \int_0x \exp(-t)pow(t,a-1) dt / Gamma(a)
regularized incomplete gamma function \int_0x \exp(-t)pow(t,a-1) dt / Gamma(a)
- See also
http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/special/Gamma.html#regularizedGammaP(double, double)
-
object
gammq
extends UFunc with MappingUFunc
regularized incomplete gamma function \int_0x \exp(-t)pow(t,a-1) dt / Gamma(a)
regularized incomplete gamma function \int_0x \exp(-t)pow(t,a-1) dt / Gamma(a)
- See also
http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/special/Gamma.html#regularizedGammaP(double, double)
-
object
isEven
extends UFunc with MappingUFunc
Whether a number is even.
Whether a number is even. For Double and Float, isEven also implies that the number is an integer, and therefore does not necessarily equal !isOdd for fractional input.
- object isFinite extends UFunc with MappingUFunc
- object isNonfinite extends UFunc with MappingUFunc
-
object
isOdd
extends UFunc with MappingUFunc
Whether a number is odd.
Whether a number is odd. For Double and Float, isOdd also implies that the number is an integer, and therefore does not necessarily equal !isEven for fractional input.
-
object
lbeta
extends UFunc
Evaluates the log of the generalized beta function.
Evaluates the log of the generalized beta function. \sum_a lgamma(c(a))- lgamma(c.sum)
-
object
lgamma
extends UFunc with MappingUFunc
Computes the log of the gamma function.
Computes the log of the gamma function. The two parameter version is the log Incomplete gamma function = \log \int_0x \exp(-t)pow(t,a-1) dt
- returns
an approximation of the log of the Gamma function of x.
- object log extends UFunc with MappingUFunc
- object log10 extends UFunc with MappingUFunc
- object log1p extends UFunc with MappingUFunc
- object log2 extends UFunc with MappingUFunc
-
object
logI
extends UFunc with MappingUFunc
The indicator function in log space: 0.0 iff b else Double.NegativeInfinity
-
object
logit
extends UFunc with MappingUFunc
The logit (inverse sigmoid) function: -log((1/x) - 1)
- object nextExponent extends UFunc with MappingUFunc
- object nextExponent10 extends UFunc with MappingUFunc
- object nextExponent2 extends UFunc with MappingUFunc
- object nextPower extends UFunc with MappingUFunc
- object nextPower10 extends UFunc with MappingUFunc
- object nextPower2 extends UFunc with MappingUFunc
- object pow extends UFunc with MappingUFunc
-
object
relu
extends UFunc with MappingUFunc
The Relu function: max(0, x)
The Relu function: max(0, x)
- See also
https://en.wikipedia.org/wiki/Rectifier_(neural_networks)
- object rint extends UFunc with MappingUFunc
- object round extends UFunc with MappingUFunc
- object sech extends UFunc with MappingUFunc
-
object
sigmoid
extends UFunc with MappingUFunc
The sigmoid function: 1/(1 + exp(-x))
- object signum extends UFunc with MappingUFunc
- object sin extends UFunc with MappingUFunc
-
object
sinc
extends UFunc with MappingUFunc
The sine cardinal (sinc) function, as defined by sinc(0)=1, sinc(n != 0)=sin(x)/x.
The sine cardinal (sinc) function, as defined by sinc(0)=1, sinc(n != 0)=sin(x)/x. Note that this differs from some signal analysis conventions, where sinc(n != 0) is defined by sin(Pi*x)/(Pi*x). This variant is provided for convenience as breeze.numerics.sincpi. Use it instead when translating from numpy.sinc..
-
object
sincpi
extends UFunc with MappingUFunc
The pi-normalized sine cardinal (sinc) function, as defined by sinc(0)=1, sinc(n != 0)=sin(Pi*x)/(Pi*x).
The pi-normalized sine cardinal (sinc) function, as defined by sinc(0)=1, sinc(n != 0)=sin(Pi*x)/(Pi*x). See also breeze.numerics.sinc.
- object sinh extends UFunc with MappingUFunc
- object sqrt extends UFunc with MappingUFunc
- object tan extends UFunc with MappingUFunc
- object tanh extends UFunc with MappingUFunc
- object toDegrees extends UFunc with MappingUFunc
- object toRadians extends UFunc with MappingUFunc
-
object
trigamma
extends UFunc with MappingUFunc
The second derivative of the log gamma function