Top Description Fields Constructors Methods
org.apache.commons.math3.analysis.interpolation

public Class MicrosphereProjectionInterpolator

extends Object
implements MultivariateInterpolator
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.analysis.interpolation.MultivariateInterpolator
Imports
org.apache.commons.math3.analysis.MultivariateFunction, org.apache.commons.math3.exception.DimensionMismatchException, .NoDataException, .NotPositiveException, .NullArgumentException, org.apache.commons.math3.random.UnitSphereRandomVectorGenerator

Interpolator that implements the algorithm described in William Dudziak's MS thesis.
Since
3.6

Field Summary

Modifier and TypeField and Description
private final double
exponent

Brightness exponent.

private final InterpolatingMicrosphere
microsphere

Microsphere.

private final double
noInterpolationTolerance

Tolerance value below which no interpolation is necessary.

private final boolean
sharedSphere

Whether to share the sphere.

Constructor Summary

AccessConstructor and Description
public
MicrosphereProjectionInterpolator(int
Space dimension.
dimension
,
int
Number of surface elements of the microsphere.
elements
,
double
Maximum fraction of the facets that can be dark. If the fraction of "non-illuminated" facets is larger, no estimation of the value will be performed, and the background value will be returned instead.
maxDarkFraction
,
double
Value of the illumination below which a facet is considered dark.
darkThreshold
,
double
Value returned when the maxDarkFraction threshold is exceeded.
background
,
double
Exponent used in the power law that computes the
exponent
,
boolean
Whether the sphere can be shared among the interpolating function instances. If true, the instances will share the same data, and thus will not be thread-safe.
sharedSphere
,
double
When the distance between an interpolated point and one of the sample points is less than this value, no interpolation will be performed (the value of the sample will be returned).
noInterpolationTolerance
)

Create a microsphere interpolator.

public
MicrosphereProjectionInterpolator(InterpolatingMicrosphere
Microsphere.
microsphere
,
double
Exponent used in the power law that computes the weights (distance dimming factor) of the sample data.
exponent
,
boolean
Whether the sphere can be shared among the interpolating function instances. If true, the instances will share the same data, and thus will not be thread-safe.
sharedSphere
,
double
When the distance between an interpolated point and one of the sample points is less than this value, no interpolation will be performed (the value of the sample will be returned).
noInterpolationTolerance
)

Create a microsphere interpolator.

Method Summary

Modifier and TypeMethod and Description
public MultivariateFunction
interpolate(final double[][]
the arguments for the interpolation points. xval[i][0] is the first component of interpolation point i, xval[i][1] is the second component, and so on until xval[i][d-1], the last component of that interpolation point (where d is thus the dimension of the space).
xval
,
final double[]
the values for the interpolation points
yval
)

Implements org.apache.commons.math3.analysis.interpolation.MultivariateInterpolator.interpolate.

Computes an interpolating function for the data set.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

exponentback to summary
private final double exponent

Brightness exponent.

microsphereback to summary
private final InterpolatingMicrosphere microsphere

Microsphere.

noInterpolationToleranceback to summary
private final double noInterpolationTolerance

Tolerance value below which no interpolation is necessary.

sharedSphereback to summary
private final boolean sharedSphere

Whether to share the sphere.

Constructor Detail

MicrosphereProjectionInterpolatorback to summary
public MicrosphereProjectionInterpolator(int dimension, int elements, double maxDarkFraction, double darkThreshold, double background, double exponent, boolean sharedSphere, double noInterpolationTolerance)

Create a microsphere interpolator.

Parameters
dimension:int

Space dimension.

elements:int

Number of surface elements of the microsphere.

maxDarkFraction:double

Maximum fraction of the facets that can be dark. If the fraction of "non-illuminated" facets is larger, no estimation of the value will be performed, and the background value will be returned instead.

darkThreshold:double

Value of the illumination below which a facet is considered dark.

background:double

Value returned when the maxDarkFraction threshold is exceeded.

exponent:double

Exponent used in the power law that computes the

sharedSphere:boolean

Whether the sphere can be shared among the interpolating function instances. If true, the instances will share the same data, and thus will not be thread-safe.

noInterpolationTolerance:double

When the distance between an interpolated point and one of the sample points is less than this value, no interpolation will be performed (the value of the sample will be returned).

Exceptions
NotStrictlyPositiveException:
if dimension <= 0 or elements <= 0.
NotPositiveException:
  • if exponent < 0.
  • if darkThreshold < 0.
OutOfRangeException:
if maxDarkFraction does not belong to the interval [0, 1].
MicrosphereProjectionInterpolatorback to summary
public MicrosphereProjectionInterpolator(InterpolatingMicrosphere microsphere, double exponent, boolean sharedSphere, double noInterpolationTolerance) throws NotPositiveException

Create a microsphere interpolator.

Parameters
microsphere:InterpolatingMicrosphere

Microsphere.

exponent:double

Exponent used in the power law that computes the weights (distance dimming factor) of the sample data.

sharedSphere:boolean

Whether the sphere can be shared among the interpolating function instances. If true, the instances will share the same data, and thus will not be thread-safe.

noInterpolationTolerance:double

When the distance between an interpolated point and one of the sample points is less than this value, no interpolation will be performed (the value of the sample will be returned).

Exceptions
NotPositiveException:
if exponent < 0.

Method Detail

interpolateback to summary
public MultivariateFunction interpolate(final double[][] xval, final double[] yval) throws DimensionMismatchException, NoDataException, NullArgumentException

Implements org.apache.commons.math3.analysis.interpolation.MultivariateInterpolator.interpolate.

Doc from org.apache.commons.math3.analysis.interpolation.MultivariateInterpolator.interpolate.

Computes an interpolating function for the data set.

Parameters
xval:double[][]

the arguments for the interpolation points. xval[i][0] is the first component of interpolation point i, xval[i][1] is the second component, and so on until xval[i][d-1], the last component of that interpolation point (where d is thus the dimension of the space).

yval:double[]

the values for the interpolation points

Returns:MultivariateFunction

a function which interpolates the data set

Exceptions
DimensionMismatchException:
if the space dimension of the given samples does not match the space dimension of the microsphere.
NoDataException:
if an array has zero-length.
NullArgumentException:
if the arguments are null.