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

public Class MicrosphereInterpolatingFunction

extends Object
implements MultivariateFunction
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.analysis.MultivariateFunction
Annotations
@Deprecated
Imports
java.util.ArrayList, .HashMap, .List, .Map, org.apache.commons.math3.analysis.MultivariateFunction, org.apache.commons.math3.exception.DimensionMismatchException, .NoDataException, .NullArgumentException, org.apache.commons.math3.linear.ArrayRealVector, .RealVector, org.apache.commons.math3.random.UnitSphereRandomVectorGenerator, org.apache.commons.math3.util.FastMath

Deprecated

Code will be removed in 4.0. Use InterpolatingMicrosphere and MicrosphereProjectionInterpolator instead.

Interpolating function that implements the Microsphere Projection.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
MicrosphereInterpolatingFunction.MicrosphereSurfaceElement

Class for storing the accounting data needed to perform the microsphere projection.

Field Summary

Modifier and TypeField and Description
private final double
brightnessExponent

Exponent used in the power law that computes the weights of the sample data.

private final int
dimension

Space dimension.

private final List<MicrosphereInterpolatingFunction.MicrosphereSurfaceElement>
microsphere

Internal accounting data for the interpolation algorithm.

private final Map<RealVector, Double>
samples

Sample data.

Constructor Summary

AccessConstructor and Description
public
MicrosphereInterpolatingFunction(double[][]
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 dimension is thus the dimension of the sampled space).
xval
,
double[]
Values for the interpolation points.
yval
,
int
Brightness dimming factor.
brightnessExponent
,
int
Number of surface elements of the microsphere.
microsphereElements
,
UnitSphereRandomVectorGenerator
Unit vector generator for creating the microsphere.
rand
)

Method Summary

Modifier and TypeMethod and Description
private double

Returns:

the cosine of the angle between v and w.
cosAngle
(final RealVector
Vector.
v
,
final RealVector
Vector.
w
)

Compute the cosine of the angle between 2 vectors.

public double

Returns:

the interpolated value.
value
(double[]
Interpolation point.
point
)

Implements org.apache.commons.math3.analysis.MultivariateFunction.value.

Compute the value for the function at the given point.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

brightnessExponentback to summary
private final double brightnessExponent

Exponent used in the power law that computes the weights of the sample data.

dimensionback to summary
private final int dimension

Space dimension.

microsphereback to summary
private final List<MicrosphereInterpolatingFunction.MicrosphereSurfaceElement> microsphere

Internal accounting data for the interpolation algorithm. Each element of the list corresponds to one surface element of the microsphere.

samplesback to summary
private final Map<RealVector, Double> samples

Sample data.

Constructor Detail

MicrosphereInterpolatingFunctionback to summary
public MicrosphereInterpolatingFunction(double[][] xval, double[] yval, int brightnessExponent, int microsphereElements, UnitSphereRandomVectorGenerator rand) throws DimensionMismatchException, NoDataException, NullArgumentException
Parameters
xval:double[][]

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 dimension is thus the dimension of the sampled space).

yval:double[]

Values for the interpolation points.

brightnessExponent:int

Brightness dimming factor.

microsphereElements:int

Number of surface elements of the microsphere.

rand:UnitSphereRandomVectorGenerator

Unit vector generator for creating the microsphere.

Exceptions
DimensionMismatchException:
if the lengths of yval and xval (equal to n, the number of interpolation points) do not match, or the the arrays xval[0] ... xval[n], have lengths different from dimension.
NoDataException:
if there an array has zero-length.
NullArgumentException:
if an argument is null.

Method Detail

cosAngleback to summary
private double cosAngle(final RealVector v, final RealVector w)

Compute the cosine of the angle between 2 vectors.

Parameters
v:RealVector

Vector.

w:RealVector

Vector.

Returns:double

the cosine of the angle between v and w.

valueback to summary
public double value(double[] point) throws DimensionMismatchException

Implements org.apache.commons.math3.analysis.MultivariateFunction.value.

Doc from org.apache.commons.math3.analysis.MultivariateFunction.value.

Compute the value for the function at the given point.

Parameters
point:double[]

Interpolation point.

Returns:double

the interpolated value.

Exceptions
DimensionMismatchException:
if point dimension does not math sample
org.apache.commons.math3.analysis.interpolation back to summary

private Class MicrosphereInterpolatingFunction.MicrosphereSurfaceElement

extends Object
Class Inheritance
  • java.lang.Object
  • org.apache.commons.math3.analysis.interpolation.MicrosphereInterpolatingFunction.MicrosphereSurfaceElement

Class for storing the accounting data needed to perform the microsphere projection.

Field Summary

Modifier and TypeField and Description
private double
brightestIllumination

Illumination received from the brightest sample.

private Map.Entry<RealVector, Double>
brightestSample

Brightest sample.

private final RealVector
normal

Normal vector characterizing a surface element.

Constructor Summary

AccessConstructor and Description
pack-priv
MicrosphereSurfaceElement(double[]
Normal vector characterizing a surface element of the microsphere.
n
)

Method Summary

Modifier and TypeMethod and Description
pack-priv double

Returns:

the illumination.
illumination
()

Get the illumination of the element.

pack-priv RealVector

Returns:

the normal vector
normal
()

Return the normal vector.

pack-priv void
reset()

Reset "illumination" and "sampleIndex".

pack-priv Map.Entry<RealVector, Double>

Returns:

the sample.
sample
()

Get the sample illuminating the element the most.

pack-priv void
store(final double
illumination received from sample
illuminationFromSample
,
final Map.Entry<RealVector, Double>
current sample illuminating the element
sample
)

Store the illumination and index of the brightest sample.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

brightestIlluminationback to summary
private double brightestIllumination

Illumination received from the brightest sample.

brightestSampleback to summary
private Map.Entry<RealVector, Double> brightestSample

Brightest sample.

normalback to summary
private final RealVector normal

Normal vector characterizing a surface element.

Constructor Detail

MicrosphereSurfaceElementback to summary
pack-priv MicrosphereSurfaceElement(double[] n)
Parameters
n:double[]

Normal vector characterizing a surface element of the microsphere.

Method Detail

illuminationback to summary
pack-priv double illumination()

Get the illumination of the element.

Returns:double

the illumination.

normalback to summary
pack-priv RealVector normal()

Return the normal vector.

Returns:RealVector

the normal vector

resetback to summary
pack-priv void reset()

Reset "illumination" and "sampleIndex".

sampleback to summary
pack-priv Map.Entry<RealVector, Double> sample()

Get the sample illuminating the element the most.

Returns:Map.Entry<RealVector, Double>

the sample.

storeback to summary
pack-priv void store(final double illuminationFromSample, final Map.Entry<RealVector, Double> sample)

Store the illumination and index of the brightest sample.

Parameters
illuminationFromSample:double

illumination received from sample

sample:Map.Entry<RealVector, Double>

current sample illuminating the element