|
ImageScience 3.0.0 | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectimagescience.utility.FMath
public class FMath
Performs elementary mathematical operations and function evaluations.
Constructor Summary | |
---|---|
FMath()
Default constructor. |
Method Summary | |
---|---|
static double |
besselj(int n,
double x)
Returns the value at x of the Bessel function of the first kind of order n . |
static double |
besselj0(double x)
Returns the value at x of the zeroth-order Bessel function of the first kind. |
static double |
besselj1(double x)
Returns the value at x of the first-order Bessel function of the first kind. |
static double |
bspline(double x,
int n,
int d)
Returns the value at x of the d th derivative of the n th-degree centered uniform B-spline basis function. |
static int |
ceil(double d)
Returns the ceiling of the given value. |
static double |
clip(double d,
double min,
double max)
Returns the value of d clipped to the range [min,max] . |
static int |
floor(double d)
Returns the floor of the given value. |
static double |
gauss(double x,
double s)
Returns The value at x of the Gaussian distribution with standard deviation s . |
static double |
lngamma(double x)
Returns the natural logarithm of the Gamma function at x . |
static double |
lommelu(int n,
int t,
double u,
double v)
Returns the value at (u,v) of the series expansion of the Lommel U-function of order n evaluated to t terms. |
static double |
lommelv(int n,
int t,
double u,
double v)
Returns the value at (u,v) of the series expansion of the Lommel V-function of order n evaluated to t terms. |
static double |
max(double d1,
double d2)
Returns the maximum of the given values. |
static double |
max(double d1,
double d2,
double d3,
double d4)
Returns the maximum of the given values. |
static double |
max(double d1,
double d2,
double d3,
double d4,
double d5,
double d6,
double d7,
double d8)
Returns the maximum of the given values. |
static double |
min(double d1,
double d2)
Returns the minimum of the given values. |
static double |
min(double d1,
double d2,
double d3,
double d4)
Returns the minimum of the given values. |
static double |
min(double d1,
double d2,
double d3,
double d4,
double d5,
double d6,
double d7,
double d8)
Returns the minimum of the given values. |
static boolean |
power2(int i)
Indicates whether the given integer value is a power of 2. |
static int |
round(double d)
Returns the given value rounded to the nearest integral value. |
static double |
sinc(double x)
Returns the value of the sinc function at x . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FMath()
Method Detail |
---|
public static int floor(double d)
d
- The value whose floor is to be returned.
d
. This method works only for double
values that fall within the range spanned by the int
egers. In that case, this method yields the same result as the corresponding method in Java's Math
class, but is in general much faster and returns an int
rather than a double
.public static int ceil(double d)
d
- The value whose ceiling is to be returned.
d
. This method works only for double
values that fall within the range spanned by the int
egers. In that case, this method yields the same result as the corresponding method in Java's Math
class, but is in general much faster and returns an int
rather than a double
.public static int round(double d)
d
- The value whose rounded value is to be returned.
d
. This method works only for double
values that fall within the range spanned by the int
egers. In that case, this method yields the same result as the corresponding method in Java's Math
class, but is in general much faster and returns an int
rather than a double
.public static double clip(double d, double min, double max)
d
clipped to the range [min,max]
.
d
- The value to be clipped.min
- The lower bound (minimum value) of the clip range.max
- The upper bound (maximum value) of the clip range.
d
clipped to the range [min,max]
. Guaranteed to be correct only if min <= max
.public static double min(double d1, double d2)
d1
- d2
- The values.
d1
and d2
.public static double min(double d1, double d2, double d3, double d4)
d1
- d2
- d3
- d4
- The values.
d1,...,d4
.public static double min(double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8)
d1
- d2
- d3
- d4
- d5
- d6
- d7
- d8
- The values.
d1,...,d8
.public static double max(double d1, double d2)
d1
- d2
- The values.
d1
and d2
.public static double max(double d1, double d2, double d3, double d4)
d1
- d2
- d3
- d4
- The values.
d1,...,d4
.public static double max(double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8)
d1
- d2
- d3
- d4
- d5
- d6
- d7
- d8
- The values.
d1,...,d8
.public static double lngamma(double x)
x
.
x
- The input value. Must be larger than 0
.
x
. Computed using the approximation described by C. Lanczos, "A Precision Approximation of the Gamma Function", SIAM Journal on Numerical Analysis, Series B, vol. 1, 1964, pp. 86-96, as implemented by W. H. Press et al., Numerical Recipes in C: The Art of Scientific Computing, 2nd ed., Cambridge University Press, Cambridge, 1992, Section 6.1.
java.lang.IllegalArgumentException
- If x
is less than or equal to 0
.public static double bspline(double x, int n, int d)
x
of the d
th derivative of the n
th-degree centered uniform B-spline basis function.
x
- The input value.n
- The B-spline degree. Must be larger than or equal to 0
.d
- The derivate order. Must be larger than or equal to 0
and less than or equal to n
.
x
of the d
th derivative of the n
th-degree centered uniform B-spline basis function.
java.lang.IllegalArgumentException
- If n
or d
is out of range.public static double gauss(double x, double s)
x
of the Gaussian distribution with standard deviation s
. The distribution is normalized to unit integral.
x
- The input value.s
- The standard deviation of the Gaussian distribution.
x
of the Gaussian distribution with standard deviation s
.
java.lang.IllegalArgumentException
- If s
is less than or equal to 0
.public static double sinc(double x)
x
. The sinc function is defined as the limit of sin(x)/x
.
x
- The input value.
x
.public static double besselj0(double x)
x
of the zeroth-order Bessel function of the first kind.
x
- The input value.
x
of the zeroth-order Bessel function of the first kind. Computed using the algorithm described by W. H. Press et al., Numerical Recipes in C: The Art of Scientific Computing, 2nd ed., Cambridge University Press, Cambridge, 1992, Section 6.5.public static double besselj1(double x)
x
of the first-order Bessel function of the first kind.
x
- The input value.
x
of the first-order Bessel function of the first kind. Computed using the algorithm described by W. H. Press et al., Numerical Recipes in C: The Art of Scientific Computing, 2nd ed., Cambridge University Press, Cambridge, 1992, Section 6.5.public static double besselj(int n, double x)
x
of the Bessel function of the first kind of order n
.
n
- The order of the Bessel function of the first kind. Must be larger than or equal to 0
.x
- The input value.
x
of the Bessel function of the first kind of order n
. Computed using the algorithm described by W. H. Press et al., Numerical Recipes in C: The Art of Scientific Computing, 2nd ed., Cambridge University Press, Cambridge, 1992, Section 6.5.
java.lang.IllegalArgumentException
- If n
is less than 0
.public static double lommelu(int n, int t, double u, double v)
(u,v)
of the series expansion of the Lommel U-function of order n
evaluated to t
terms.
n
- The order of the Lommel U-function. Must be larger than or equal to 0
.t
- The number of terms to which the series expansion is to be computed. Must be larger than 0
.u
- The first input value.v
- The second input value. Must be different from 0
.
(u,v)
of the series expansion of the Lommel U-function of order n
evaluated to t
terms. Computed using a straightforward implementation of the formula given by M. Born and E. Wolf, Principles of Optics, 5th ed., Pergamon Press, Oxford, 1975, Section 8.8.
java.lang.IllegalArgumentException
- If any of the parameter values is out of range.public static double lommelv(int n, int t, double u, double v)
(u,v)
of the series expansion of the Lommel V-function of order n
evaluated to t
terms.
n
- The order of the Lommel V-function. Must be larger than or equal to 0
.t
- The number of terms to which the series expansion is to be computed. Must be larger than 0
.u
- The first input value. Must be different from 0
.v
- The second input value.
(u,v)
of the series expansion of the Lommel V-function of order n
evaluated to t
terms. Computed using a straightforward implementation of the formula given by M. Born and E. Wolf, Principles of Optics, 5th ed., Pergamon Press, Oxford, 1975, Section 8.8.
java.lang.IllegalArgumentException
- If any of the parameter values is out of range.public static boolean power2(int i)
i
- The integer value to be tested. Should not be larger than 2^30
in magnitude.
true
if i
is a power of 2, or false
if this is not the case.
|
ImageScience 3.0.0 | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (C) Erik Meijering. Permission to use this software and corresponding documentation for educational, research, and not-for-profit purposes, without a fee and without a signed licensing agreement, is granted, subject to the following terms and conditions.
IT IS NOT ALLOWED TO REDISTRIBUTE, SELL, OR LEASE THIS SOFTWARE, OR DERIVATIVE WORKS THEREOF, WITHOUT PERMISSION IN WRITING FROM THE COPYRIGHT HOLDER. THE COPYRIGHT HOLDER IS FREE TO MAKE VERSIONS OF THE SOFTWARE AVAILABLE FOR A FEE OR COMMERCIALLY ONLY.
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OF ANY KIND WHATSOEVER, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE EXPRESS OR IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND CORRESPONDING DOCUMENTATION IS PROVIDED "AS IS". THE COPYRIGHT HOLDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.