breeze.numerics

Contains several standard numerical functions as MappingUFuncs,

Type members

Classlikes

object Bessel

Implementations of the Bessel functions, based on Numerical Recipes

Implementations of the Bessel functions, based on Numerical Recipes

Package for common unit conversions.

Package for common unit conversions.

object I extends ZeroPreservingUFunc

The indicator function. 1.0 iff b, else 0.0 For non-boolean arguments, 1.0 iff b != 0, else 0.0

The indicator function. 1.0 iff b, else 0.0 For non-boolean arguments, 1.0 iff b != 0, else 0.0

object IntMath
trait Scaling

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.

Companion:
object
object Scaling extends Scaling
Companion:
class
object abs extends ZeroPreservingUFunc
object acos extends MappingUFunc
object acosh extends MappingUFunc
object asin extends ZeroPreservingUFunc
object asinh extends ZeroPreservingUFunc
object atan extends ZeroPreservingUFunc
object atan2 extends MappingUFunc
object atanh extends ZeroPreservingUFunc
object cbrt extends ZeroPreservingUFunc
object ceil extends ZeroPreservingUFunc
object cos extends MappingUFunc
object cosh extends MappingUFunc
object digamma extends MappingUFunc

The derivative of the log gamma function

The derivative of the log gamma function

object erf extends ZeroPreservingUFunc

An approximation to the error function

An approximation to the error function

object erfc extends MappingUFunc

An approximation to the complementary error function: erfc(x) = 1 - erfc(x)

An approximation to the complementary error function: erfc(x) = 1 - erfc(x)

object erfcinv extends MappingUFunc

Inverse erfc

Inverse erfc

object erfi extends 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 MappingUFunc

Inverse erf

Inverse erf

object exp extends MappingUFunc
object expm1 extends ZeroPreservingUFunc
object floor extends ZeroPreservingUFunc
object gammp extends 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:
object gammq extends 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:
object isEven extends MappingUFunc

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.

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 MappingUFunc
object isOdd extends ZeroPreservingUFunc

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.

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. \sum_a lgamma(c(a))- lgamma(c.sum)

Evaluates the log of the generalized beta function. \sum_a lgamma(c(a))- lgamma(c.sum)

object lgamma extends MappingUFunc

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

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 MappingUFunc
object log10 extends MappingUFunc
object log1p extends MappingUFunc
object log2 extends MappingUFunc
object logI extends UFunc with MappingUFunc

The indicator function in log space: 0.0 iff b else Double.NegativeInfinity

The indicator function in log space: 0.0 iff b else Double.NegativeInfinity

object logit extends MappingUFunc

The logit (inverse sigmoid) function: -log((1/x) - 1)

The logit (inverse sigmoid) function: -log((1/x) - 1)

object multidigamma extends MappingUFunc

Multivariate Digamma

Multivariate Digamma

Multivariate digamma log

Multivariate digamma log

object nextExponent extends MappingUFunc
object nextPower extends MappingUFunc
object nextPower10 extends MappingUFunc
object nextPower2 extends MappingUFunc
object pow extends MappingUFunc
object relu extends ZeroPreservingUFunc

The Relu function: max(0, x)

The Relu function: max(0, x)

See also:
object rint extends ZeroPreservingUFunc
object round extends ZeroPreservingUFunc
object sech extends MappingUFunc
object sigmoid extends MappingUFunc

The sigmoid function: 1/(1 + exp(-x))

The sigmoid function: 1/(1 + exp(-x))

object sin extends ZeroPreservingUFunc
object sinc extends MappingUFunc

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(Pix)/(Pix). This variant is provided for convenience as breeze.numerics.sincpi. Use it instead when translating from numpy.sinc..

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(Pix)/(Pix). This variant is provided for convenience as breeze.numerics.sincpi. Use it instead when translating from numpy.sinc..

object sincpi extends MappingUFunc

The pi-normalized sine cardinal (sinc) function, as defined by sinc(0)=1, sinc(n != 0)=sin(Pix)/(Pix). See also breeze.numerics.sinc.

The pi-normalized sine cardinal (sinc) function, as defined by sinc(0)=1, sinc(n != 0)=sin(Pix)/(Pix). See also breeze.numerics.sinc.

object sinh extends ZeroPreservingUFunc
object sqrt extends ZeroPreservingUFunc
object step extends MappingUFunc

The Step function: if (x > 0) 1 else 0

The Step function: if (x > 0) 1 else 0

See also:
object tan extends ZeroPreservingUFunc
object tanh extends ZeroPreservingUFunc
object trigamma extends MappingUFunc

The second derivative of the log gamma function

The second derivative of the log gamma function

Value members

Concrete methods

def closeTo(a: Double, b: Double, relDiff: Double): Boolean

closeTo for Doubles.

closeTo for Doubles.

def polyval(coefs: Array[Double], x: Double): Double

Computes the polynomial P(x) with coefficients given in the passed in array. coefs(i) is the coef for the x_i term.

Computes the polynomial P(x) with coefficients given in the passed in array. coefs(i) is the coef for the x_i term.

Concrete fields

val Inf: Double
val NaN: Double
val inf: Double
val nan: Double