You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@commons.apache.org by lu...@apache.org on 2015/08/14 21:12:44 UTC
svn commit: r961863 [14/34] - in
/websites/production/commons/content/proper/commons-math: ./ apidocs/
apidocs/org/apache/commons/math3/analysis/class-use/
apidocs/org/apache/commons/math3/analysis/interpolation/
apidocs/org/apache/commons/math3/analys...
Modified: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereInterpolatingFunction.java.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereInterpolatingFunction.java.html (original)
+++ websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereInterpolatingFunction.java.html Fri Aug 14 19:12:42 2015
@@ -34,7 +34,10 @@ import org.apache.commons.math3.util.Fas
* Interpolating function that implements the
* <a href="http://www.dudziak.com/microsphere.php">Microsphere Projection</a>.
*
+ * @deprecated Code will be removed in 4.0. Use {@link InterpolatingMicrosphere}
+ * and {@link MicrosphereProjectionInterpolator} instead.
*/
+@Deprecated
public class MicrosphereInterpolatingFunction
implements MultivariateFunction {
/**
@@ -73,25 +76,25 @@ public class MicrosphereInterpolatingFun
* @param n Normal vector characterizing a surface element
* of the microsphere.
*/
-<span class="fc" id="L76"> MicrosphereSurfaceElement(double[] n) {</span>
-<span class="fc" id="L77"> normal = new ArrayRealVector(n);</span>
-<span class="fc" id="L78"> }</span>
+<span class="fc" id="L79"> MicrosphereSurfaceElement(double[] n) {</span>
+<span class="fc" id="L80"> normal = new ArrayRealVector(n);</span>
+<span class="fc" id="L81"> }</span>
/**
* Return the normal vector.
* @return the normal vector
*/
RealVector normal() {
-<span class="fc" id="L85"> return normal;</span>
+<span class="fc" id="L88"> return normal;</span>
}
/**
* Reset "illumination" and "sampleIndex".
*/
void reset() {
-<span class="fc" id="L92"> brightestIllumination = 0;</span>
-<span class="fc" id="L93"> brightestSample = null;</span>
-<span class="fc" id="L94"> }</span>
+<span class="fc" id="L95"> brightestIllumination = 0;</span>
+<span class="fc" id="L96"> brightestSample = null;</span>
+<span class="fc" id="L97"> }</span>
/**
* Store the illumination and index of the brightest sample.
@@ -100,18 +103,18 @@ public class MicrosphereInterpolatingFun
*/
void store(final double illuminationFromSample,
final Map.Entry<RealVector, Double> sample) {
-<span class="fc bfc" id="L103" title="All 2 branches covered."> if (illuminationFromSample > this.brightestIllumination) {</span>
-<span class="fc" id="L104"> this.brightestIllumination = illuminationFromSample;</span>
-<span class="fc" id="L105"> this.brightestSample = sample;</span>
+<span class="fc bfc" id="L106" title="All 2 branches covered."> if (illuminationFromSample > this.brightestIllumination) {</span>
+<span class="fc" id="L107"> this.brightestIllumination = illuminationFromSample;</span>
+<span class="fc" id="L108"> this.brightestSample = sample;</span>
}
-<span class="fc" id="L107"> }</span>
+<span class="fc" id="L110"> }</span>
/**
* Get the illumination of the element.
* @return the illumination.
*/
double illumination() {
-<span class="fc" id="L114"> return brightestIllumination;</span>
+<span class="fc" id="L117"> return brightestIllumination;</span>
}
/**
@@ -119,7 +122,7 @@ public class MicrosphereInterpolatingFun
* @return the sample.
*/
Map.Entry<RealVector, Double> sample() {
-<span class="fc" id="L122"> return brightestSample;</span>
+<span class="fc" id="L125"> return brightestSample;</span>
}
}
@@ -149,45 +152,45 @@ public class MicrosphereInterpolatingFun
UnitSphereRandomVectorGenerator rand)
throws DimensionMismatchException,
NoDataException,
-<span class="fc" id="L152"> NullArgumentException {</span>
-<span class="pc bpc" id="L153" title="2 of 4 branches missed."> if (xval == null ||</span>
+<span class="fc" id="L155"> NullArgumentException {</span>
+<span class="pc bpc" id="L156" title="2 of 4 branches missed."> if (xval == null ||</span>
yval == null) {
-<span class="nc" id="L155"> throw new NullArgumentException();</span>
+<span class="nc" id="L158"> throw new NullArgumentException();</span>
}
-<span class="pc bpc" id="L157" title="1 of 2 branches missed."> if (xval.length == 0) {</span>
-<span class="nc" id="L158"> throw new NoDataException();</span>
+<span class="pc bpc" id="L160" title="1 of 2 branches missed."> if (xval.length == 0) {</span>
+<span class="nc" id="L161"> throw new NoDataException();</span>
}
-<span class="pc bpc" id="L160" title="1 of 2 branches missed."> if (xval.length != yval.length) {</span>
-<span class="nc" id="L161"> throw new DimensionMismatchException(xval.length, yval.length);</span>
+<span class="pc bpc" id="L163" title="1 of 2 branches missed."> if (xval.length != yval.length) {</span>
+<span class="nc" id="L164"> throw new DimensionMismatchException(xval.length, yval.length);</span>
}
-<span class="pc bpc" id="L163" title="1 of 2 branches missed."> if (xval[0] == null) {</span>
-<span class="nc" id="L164"> throw new NullArgumentException();</span>
+<span class="pc bpc" id="L166" title="1 of 2 branches missed."> if (xval[0] == null) {</span>
+<span class="nc" id="L167"> throw new NullArgumentException();</span>
}
-<span class="fc" id="L167"> dimension = xval[0].length;</span>
-<span class="fc" id="L168"> this.brightnessExponent = brightnessExponent;</span>
+<span class="fc" id="L170"> dimension = xval[0].length;</span>
+<span class="fc" id="L171"> this.brightnessExponent = brightnessExponent;</span>
// Copy data samples.
-<span class="fc" id="L171"> samples = new HashMap<RealVector, Double>(yval.length);</span>
-<span class="fc bfc" id="L172" title="All 2 branches covered."> for (int i = 0; i < xval.length; ++i) {</span>
-<span class="fc" id="L173"> final double[] xvalI = xval[i];</span>
-<span class="pc bpc" id="L174" title="1 of 2 branches missed."> if (xvalI == null) {</span>
-<span class="nc" id="L175"> throw new NullArgumentException();</span>
+<span class="fc" id="L174"> samples = new HashMap<RealVector, Double>(yval.length);</span>
+<span class="fc bfc" id="L175" title="All 2 branches covered."> for (int i = 0; i < xval.length; ++i) {</span>
+<span class="fc" id="L176"> final double[] xvalI = xval[i];</span>
+<span class="pc bpc" id="L177" title="1 of 2 branches missed."> if (xvalI == null) {</span>
+<span class="nc" id="L178"> throw new NullArgumentException();</span>
}
-<span class="pc bpc" id="L177" title="1 of 2 branches missed."> if (xvalI.length != dimension) {</span>
-<span class="nc" id="L178"> throw new DimensionMismatchException(xvalI.length, dimension);</span>
+<span class="pc bpc" id="L180" title="1 of 2 branches missed."> if (xvalI.length != dimension) {</span>
+<span class="nc" id="L181"> throw new DimensionMismatchException(xvalI.length, dimension);</span>
}
-<span class="fc" id="L181"> samples.put(new ArrayRealVector(xvalI), yval[i]);</span>
+<span class="fc" id="L184"> samples.put(new ArrayRealVector(xvalI), yval[i]);</span>
}
-<span class="fc" id="L184"> microsphere = new ArrayList<MicrosphereSurfaceElement>(microsphereElements);</span>
+<span class="fc" id="L187"> microsphere = new ArrayList<MicrosphereSurfaceElement>(microsphereElements);</span>
// Generate the microsphere, assuming that a fairly large number of
// randomly generated normals will represent a sphere.
-<span class="fc bfc" id="L187" title="All 2 branches covered."> for (int i = 0; i < microsphereElements; i++) {</span>
-<span class="fc" id="L188"> microsphere.add(new MicrosphereSurfaceElement(rand.nextVector()));</span>
+<span class="fc bfc" id="L190" title="All 2 branches covered."> for (int i = 0; i < microsphereElements; i++) {</span>
+<span class="fc" id="L191"> microsphere.add(new MicrosphereSurfaceElement(rand.nextVector()));</span>
}
-<span class="fc" id="L190"> }</span>
+<span class="fc" id="L193"> }</span>
/**
* @param point Interpolation point.
@@ -195,46 +198,46 @@ public class MicrosphereInterpolatingFun
* @throws DimensionMismatchException if point dimension does not math sample
*/
public double value(double[] point) throws DimensionMismatchException {
-<span class="fc" id="L198"> final RealVector p = new ArrayRealVector(point);</span>
+<span class="fc" id="L201"> final RealVector p = new ArrayRealVector(point);</span>
// Reset.
-<span class="fc bfc" id="L201" title="All 2 branches covered."> for (MicrosphereSurfaceElement md : microsphere) {</span>
-<span class="fc" id="L202"> md.reset();</span>
-<span class="fc" id="L203"> }</span>
+<span class="fc bfc" id="L204" title="All 2 branches covered."> for (MicrosphereSurfaceElement md : microsphere) {</span>
+<span class="fc" id="L205"> md.reset();</span>
+<span class="fc" id="L206"> }</span>
// Compute contribution of each sample points to the microsphere elements illumination
-<span class="fc bfc" id="L206" title="All 2 branches covered."> for (Map.Entry<RealVector, Double> sd : samples.entrySet()) {</span>
+<span class="fc bfc" id="L209" title="All 2 branches covered."> for (Map.Entry<RealVector, Double> sd : samples.entrySet()) {</span>
// Vector between interpolation point and current sample point.
-<span class="fc" id="L209"> final RealVector diff = sd.getKey().subtract(p);</span>
-<span class="fc" id="L210"> final double diffNorm = diff.getNorm();</span>
+<span class="fc" id="L212"> final RealVector diff = sd.getKey().subtract(p);</span>
+<span class="fc" id="L213"> final double diffNorm = diff.getNorm();</span>
-<span class="fc bfc" id="L212" title="All 2 branches covered."> if (FastMath.abs(diffNorm) < FastMath.ulp(1d)) {</span>
+<span class="fc bfc" id="L215" title="All 2 branches covered."> if (FastMath.abs(diffNorm) < FastMath.ulp(1d)) {</span>
// No need to interpolate, as the interpolation point is
// actually (very close to) one of the sampled points.
-<span class="fc" id="L215"> return sd.getValue();</span>
+<span class="fc" id="L218"> return sd.getValue();</span>
}
-<span class="fc bfc" id="L218" title="All 2 branches covered."> for (MicrosphereSurfaceElement md : microsphere) {</span>
-<span class="fc" id="L219"> final double w = FastMath.pow(diffNorm, -brightnessExponent);</span>
-<span class="fc" id="L220"> md.store(cosAngle(diff, md.normal()) * w, sd);</span>
-<span class="fc" id="L221"> }</span>
+<span class="fc bfc" id="L221" title="All 2 branches covered."> for (MicrosphereSurfaceElement md : microsphere) {</span>
+<span class="fc" id="L222"> final double w = FastMath.pow(diffNorm, -brightnessExponent);</span>
+<span class="fc" id="L223"> md.store(cosAngle(diff, md.normal()) * w, sd);</span>
+<span class="fc" id="L224"> }</span>
-<span class="fc" id="L223"> }</span>
+<span class="fc" id="L226"> }</span>
// Interpolation calculation.
-<span class="fc" id="L226"> double value = 0;</span>
-<span class="fc" id="L227"> double totalWeight = 0;</span>
-<span class="fc bfc" id="L228" title="All 2 branches covered."> for (MicrosphereSurfaceElement md : microsphere) {</span>
-<span class="fc" id="L229"> final double iV = md.illumination();</span>
-<span class="fc" id="L230"> final Map.Entry<RealVector, Double> sd = md.sample();</span>
-<span class="pc bpc" id="L231" title="1 of 2 branches missed."> if (sd != null) {</span>
-<span class="fc" id="L232"> value += iV * sd.getValue();</span>
-<span class="fc" id="L233"> totalWeight += iV;</span>
+<span class="fc" id="L229"> double value = 0;</span>
+<span class="fc" id="L230"> double totalWeight = 0;</span>
+<span class="fc bfc" id="L231" title="All 2 branches covered."> for (MicrosphereSurfaceElement md : microsphere) {</span>
+<span class="fc" id="L232"> final double iV = md.illumination();</span>
+<span class="fc" id="L233"> final Map.Entry<RealVector, Double> sd = md.sample();</span>
+<span class="pc bpc" id="L234" title="1 of 2 branches missed."> if (sd != null) {</span>
+<span class="fc" id="L235"> value += iV * sd.getValue();</span>
+<span class="fc" id="L236"> totalWeight += iV;</span>
}
-<span class="fc" id="L235"> }</span>
+<span class="fc" id="L238"> }</span>
-<span class="fc" id="L237"> return value / totalWeight;</span>
+<span class="fc" id="L240"> return value / totalWeight;</span>
}
/**
@@ -245,7 +248,7 @@ public class MicrosphereInterpolatingFun
* @return the cosine of the angle between {@code v} and {@code w}.
*/
private double cosAngle(final RealVector v, final RealVector w) {
-<span class="fc" id="L248"> return v.dotProduct(w) / (v.getNorm() * w.getNorm());</span>
+<span class="fc" id="L251"> return v.dotProduct(w) / (v.getNorm() * w.getNorm());</span>
}
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.4.201502262128</span></div></body></html>
\ No newline at end of file
Modified: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereInterpolator.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereInterpolator.html (original)
+++ websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereInterpolator.html Fri Aug 14 19:12:42 2015
@@ -1 +1 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>MicrosphereInterpolator</title><script type="text/javascript" src="../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Math</a> > <a href="index.html" class="el_package">org.apache.commons.math3.analysis.interpolation</a> > <span class="el_class">MicrosphereInterpolator</span></div><h1>MicrosphereInterpolator</h1><table class="coverage" cellspacing=
"0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">12 of 49</td><td class="ctr2">76%</td><td class="bar">2 of 4</td><td class="ctr2">50%</td><td class="ctr1">2</td>
<td class="ctr2">5</td><td class="ctr1">2</td><td class="ctr2">12</td><td class="ctr1">0</td><td class="ctr2">3</td></tr></tfoot><tbody><tr><td id="a2"><a href="MicrosphereInterpolator.java.html#L75" class="el_method">MicrosphereInterpolator(int, int)</a></td><td class="bar" id="b0"><img src="../.resources/redbar.gif" width="57" height="10" title="12" alt="12"/><img src="../.resources/greenbar.gif" width="62" height="10" title="13" alt="13"/></td><td class="ctr2" id="c2">52%</td><td class="bar" id="d0"><img src="../.resources/redbar.gif" width="60" height="10" title="2" alt="2"/><img src="../.resources/greenbar.gif" width="60" height="10" title="2" alt="2"/></td><td class="ctr2" id="e0">50%</td><td class="ctr1" id="f0">2</td><td class="ctr2" id="g0">3</td><td class="ctr1" id="h0">2</td><td class="ctr2" id="i0">8</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a0"><a href="MicrosphereInterpolator.java.html#L95" class="el_method">interpolate(double[]
[], double[])</a></td><td class="bar" id="b1"><img src="../.resources/greenbar.gif" width="91" height="10" title="19" alt="19"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d1"/><td class="ctr2" id="e1">n/a</td><td class="ctr1" id="f1">0</td><td class="ctr2" id="g1">1</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i1">2</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a1"><a href="MicrosphereInterpolator.java.html#L62" class="el_method">MicrosphereInterpolator()</a></td><td class="bar" id="b2"><img src="../.resources/greenbar.gif" width="24" height="10" title="5" alt="5"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d2"/><td class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g2">1</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i2">2</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a h
ref="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.4.201502262128</span></div></body></html>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>MicrosphereInterpolator</title><script type="text/javascript" src="../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Math</a> > <a href="index.html" class="el_package">org.apache.commons.math3.analysis.interpolation</a> > <span class="el_class">MicrosphereInterpolator</span></div><h1>MicrosphereInterpolator</h1><table class="coverage" cellspacing=
"0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">12 of 49</td><td class="ctr2">76%</td><td class="bar">2 of 4</td><td class="ctr2">50%</td><td class="ctr1">2</td>
<td class="ctr2">5</td><td class="ctr1">2</td><td class="ctr2">12</td><td class="ctr1">0</td><td class="ctr2">3</td></tr></tfoot><tbody><tr><td id="a2"><a href="MicrosphereInterpolator.java.html#L78" class="el_method">MicrosphereInterpolator(int, int)</a></td><td class="bar" id="b0"><img src="../.resources/redbar.gif" width="57" height="10" title="12" alt="12"/><img src="../.resources/greenbar.gif" width="62" height="10" title="13" alt="13"/></td><td class="ctr2" id="c2">52%</td><td class="bar" id="d0"><img src="../.resources/redbar.gif" width="60" height="10" title="2" alt="2"/><img src="../.resources/greenbar.gif" width="60" height="10" title="2" alt="2"/></td><td class="ctr2" id="e0">50%</td><td class="ctr1" id="f0">2</td><td class="ctr2" id="g0">3</td><td class="ctr1" id="h0">2</td><td class="ctr2" id="i0">8</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a0"><a href="MicrosphereInterpolator.java.html#L98" class="el_method">interpolate(double[]
[], double[])</a></td><td class="bar" id="b1"><img src="../.resources/greenbar.gif" width="91" height="10" title="19" alt="19"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d1"/><td class="ctr2" id="e1">n/a</td><td class="ctr1" id="f1">0</td><td class="ctr2" id="g1">1</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i1">2</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a1"><a href="MicrosphereInterpolator.java.html#L65" class="el_method">MicrosphereInterpolator()</a></td><td class="bar" id="b2"><img src="../.resources/greenbar.gif" width="24" height="10" title="5" alt="5"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d2"/><td class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g2">1</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i2">2</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a h
ref="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.4.201502262128</span></div></body></html>
\ No newline at end of file
Modified: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereInterpolator.java.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereInterpolator.java.html (original)
+++ websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereInterpolator.java.html Fri Aug 14 19:12:42 2015
@@ -30,7 +30,10 @@ import org.apache.commons.math3.random.U
* <a href="http://www.dudziak.com/microsphere.pdf">MS thesis</a>.
*
* @since 2.1
+ * @deprecated Code will be removed in 4.0. Use {@link InterpolatingMicrosphere}
+ * and {@link MicrosphereProjectionInterpolator} instead.
*/
+@Deprecated
public class MicrosphereInterpolator
implements MultivariateInterpolator {
/**
@@ -59,8 +62,8 @@ public class MicrosphereInterpolator
* MicrosphereInterpolator.DEFAULT_BRIGHTNESS_EXPONENT)}.
*/
public MicrosphereInterpolator() {
-<span class="fc" id="L62"> this(DEFAULT_MICROSPHERE_ELEMENTS, DEFAULT_BRIGHTNESS_EXPONENT);</span>
-<span class="fc" id="L63"> }</span>
+<span class="fc" id="L65"> this(DEFAULT_MICROSPHERE_ELEMENTS, DEFAULT_BRIGHTNESS_EXPONENT);</span>
+<span class="fc" id="L66"> }</span>
/** Create a microsphere interpolator.
* @param elements Number of surface elements of the microsphere.
@@ -72,17 +75,17 @@ public class MicrosphereInterpolator
public MicrosphereInterpolator(final int elements,
final int exponent)
throws NotPositiveException,
-<span class="fc" id="L75"> NotStrictlyPositiveException {</span>
-<span class="pc bpc" id="L76" title="1 of 2 branches missed."> if (exponent < 0) {</span>
-<span class="nc" id="L77"> throw new NotPositiveException(exponent);</span>
+<span class="fc" id="L78"> NotStrictlyPositiveException {</span>
+<span class="pc bpc" id="L79" title="1 of 2 branches missed."> if (exponent < 0) {</span>
+<span class="nc" id="L80"> throw new NotPositiveException(exponent);</span>
}
-<span class="pc bpc" id="L79" title="1 of 2 branches missed."> if (elements <= 0) {</span>
-<span class="nc" id="L80"> throw new NotStrictlyPositiveException(elements);</span>
+<span class="pc bpc" id="L82" title="1 of 2 branches missed."> if (elements <= 0) {</span>
+<span class="nc" id="L83"> throw new NotStrictlyPositiveException(elements);</span>
}
-<span class="fc" id="L83"> microsphereElements = elements;</span>
-<span class="fc" id="L84"> brightnessExponent = exponent;</span>
-<span class="fc" id="L85"> }</span>
+<span class="fc" id="L86"> microsphereElements = elements;</span>
+<span class="fc" id="L87"> brightnessExponent = exponent;</span>
+<span class="fc" id="L88"> }</span>
/**
* {@inheritDoc}
@@ -92,9 +95,9 @@ public class MicrosphereInterpolator
throws DimensionMismatchException,
NoDataException,
NullArgumentException {
-<span class="fc" id="L95"> final UnitSphereRandomVectorGenerator rand</span>
+<span class="fc" id="L98"> final UnitSphereRandomVectorGenerator rand</span>
= new UnitSphereRandomVectorGenerator(xval[0].length);
-<span class="fc" id="L97"> return new MicrosphereInterpolatingFunction(xval, yval,</span>
+<span class="fc" id="L100"> return new MicrosphereInterpolatingFunction(xval, yval,</span>
brightnessExponent,
microsphereElements,
rand);
Added: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator$1.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator$1.html (added)
+++ websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator$1.html Fri Aug 14 19:12:42 2015
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>MicrosphereProjectionInterpolator.new MultivariateFunction() {...}</title><script type="text/javascript" src="../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Math</a> > <a href="index.html" class="el_package">org.apache.commons.math3.analysis.interpolation</a> > <span class="el_class">MicrosphereProjectionInterpolator.new MultivariateFunction()
{...}</span></div><h1>MicrosphereProjectionInterpolator.new MultivariateFunction() {...}</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td>
<td class="bar">0 of 30</td><td class="ctr2">100%</td><td class="bar">0 of 0</td><td class="ctr2">n/a</td><td class="ctr1">0</td><td class="ctr2">2</td><td class="ctr1">0</td><td class="ctr2">2</td><td class="ctr1">0</td><td class="ctr2">2</td></tr></tfoot><tbody><tr><td id="a1"><a href="MicrosphereProjectionInterpolator.java.html#L154" class="el_method">{...}</a></td><td class="bar" id="b0"><img src="../.resources/greenbar.gif" width="120" height="10" title="15" alt="15"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d0"/><td class="ctr2" id="e0">n/a</td><td class="ctr1" id="f0">0</td><td class="ctr2" id="g0">1</td><td class="ctr1" id="h0">0</td><td class="ctr2" id="i0">1</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a0"><a href="MicrosphereProjectionInterpolator.java.html#L158" class="el_method">value(double[])</a></td><td class="bar" id="b1"><img src="../.resources/greenbar.gif" width="120" height="10" title="15" alt="15"/></td><t
d class="ctr2" id="c1">100%</td><td class="bar" id="d1"/><td class="ctr2" id="e1">n/a</td><td class="ctr1" id="f1">0</td><td class="ctr2" id="g1">1</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i1">1</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.4.201502262128</span></div></body></html>
\ No newline at end of file
Propchange: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator$1.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator$1.html
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator.html (added)
+++ websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator.html Fri Aug 14 19:12:42 2015
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>MicrosphereProjectionInterpolator</title><script type="text/javascript" src="../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Math</a> > <a href="index.html" class="el_package">org.apache.commons.math3.analysis.interpolation</a> > <span class="el_class">MicrosphereProjectionInterpolator</span></div><h1>MicrosphereProjectionInterpolator</h1><table
class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">38 of 116</td><td class="ctr2">67%</td><td class="bar">8 of 16</td><td class="ctr2"
>50%</td><td class="ctr1">8</td><td class="ctr2">11</td><td class="ctr1">6</td><td class="ctr2">23</td><td class="ctr1">0</td><td class="ctr2">3</td></tr></tfoot><tbody><tr><td id="a0"><a href="MicrosphereProjectionInterpolator.java.html#L133" class="el_method">interpolate(double[][], double[])</a></td><td class="bar" id="b0"><img src="../.resources/redbar.gif" width="52" height="10" title="32" alt="32"/><img src="../.resources/greenbar.gif" width="67" height="10" title="41" alt="41"/></td><td class="ctr2" id="c2">56%</td><td class="bar" id="d0"><img src="../.resources/redbar.gif" width="60" height="10" title="7" alt="7"/><img src="../.resources/greenbar.gif" width="60" height="10" title="7" alt="7"/></td><td class="ctr2" id="e0">50%</td><td class="ctr1" id="f0">7</td><td class="ctr2" id="g0">8</td><td class="ctr1" id="h0">5</td><td class="ctr2" id="i0">13</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a2"><a href="MicrosphereProjectionInterpolato
r.java.html#L110" class="el_method">MicrosphereProjectionInterpolator(InterpolatingMicrosphere, double, boolean, double)</a></td><td class="bar" id="b1"><img src="../.resources/redbar.gif" width="9" height="10" title="6" alt="6"/><img src="../.resources/greenbar.gif" width="31" height="10" title="19" alt="19"/></td><td class="ctr2" id="c1">76%</td><td class="bar" id="d1"><img src="../.resources/redbar.gif" width="8" height="10" title="1" alt="1"/><img src="../.resources/greenbar.gif" width="8" height="10" title="1" alt="1"/></td><td class="ctr2" id="e1">50%</td><td class="ctr1" id="f1">1</td><td class="ctr2" id="g1">2</td><td class="ctr1" id="h1">1</td><td class="ctr2" id="i1">8</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a1"><a href="MicrosphereProjectionInterpolator.java.html#L80" class="el_method">MicrosphereProjectionInterpolator(int, int, double, double, double, double, boolean, double)</a></td><td class="bar" id="b2"><img src="../.resourc
es/greenbar.gif" width="29" height="10" title="18" alt="18"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d2"/><td class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g2">1</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i2">2</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.4.201502262128</span></div></body></html>
\ No newline at end of file
Propchange: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator.html
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator.java.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator.java.html (added)
+++ websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator.java.html Fri Aug 14 19:12:42 2015
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>MicrosphereProjectionInterpolator.java</title><link rel="stylesheet" href="../.resources/prettify.css" type="text/css"/><script type="text/javascript" src="../.resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Math</a> > <a href="index.source.html" class="el_package">org.apache.commons.math3.analysis.interpolation</a> > <span class="el_
source">MicrosphereProjectionInterpolator.java</span></div><h1>MicrosphereProjectionInterpolator.java</h1><pre class="source lang-java linenums">/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math3.analysis.interpolation;
+
+import org.apache.commons.math3.analysis.MultivariateFunction;
+import org.apache.commons.math3.exception.DimensionMismatchException;
+import org.apache.commons.math3.exception.NoDataException;
+import org.apache.commons.math3.exception.NotPositiveException;
+import org.apache.commons.math3.exception.NullArgumentException;
+import org.apache.commons.math3.random.UnitSphereRandomVectorGenerator;
+
+/**
+ * Interpolator that implements the algorithm described in
+ * <em>William Dudziak</em>'s
+ * <a href="http://www.dudziak.com/microsphere.pdf">MS thesis</a>.
+ *
+ * @since 3.6
+ */
+public class MicrosphereProjectionInterpolator
+ implements MultivariateInterpolator {
+ /** Brightness exponent. */
+ private final double exponent;
+ /** Microsphere. */
+ private final InterpolatingMicrosphere microsphere;
+ /** Whether to share the sphere. */
+ private final boolean sharedSphere;
+ /** Tolerance value below which no interpolation is necessary. */
+ private final double noInterpolationTolerance;
+
+ /**
+ * Create a microsphere interpolator.
+ *
+ * @param dimension Space dimension.
+ * @param elements Number of surface elements of the microsphere.
+ * @param exponent Exponent used in the power law that computes the
+ * @param maxDarkFraction 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 {@code background} value will
+ * be returned instead.
+ * @param darkThreshold Value of the illumination below which a facet is
+ * considered dark.
+ * @param background Value returned when the {@code maxDarkFraction}
+ * threshold is exceeded.
+ * @param sharedSphere Whether the sphere can be shared among the
+ * interpolating function instances. If {@code true}, the instances
+ * will share the same data, and thus will <em>not</em> be thread-safe.
+ * @param noInterpolationTolerance 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).
+ * @throws org.apache.commons.math3.exception.NotStrictlyPositiveException
+ * if {@code dimension <= 0} or {@code elements <= 0}.
+ * @throws NotPositiveException if {@code exponent < 0}.
+ * @throws NotPositiveException if {@code darkThreshold < 0}.
+ * @throws org.apache.commons.math3.exception.OutOfRangeException if
+ * {@code maxDarkFraction} does not belong to the interval {@code [0, 1]}.
+ */
+ public MicrosphereProjectionInterpolator(int dimension,
+ int elements,
+ double maxDarkFraction,
+ double darkThreshold,
+ double background,
+ double exponent,
+ boolean sharedSphere,
+ double noInterpolationTolerance) {
+<span class="fc" id="L80"> this(new InterpolatingMicrosphere(dimension,</span>
+ elements,
+ maxDarkFraction,
+ darkThreshold,
+ background,
+ new UnitSphereRandomVectorGenerator(dimension)),
+ exponent,
+ sharedSphere,
+ noInterpolationTolerance);
+<span class="fc" id="L89"> }</span>
+
+ /**
+ * Create a microsphere interpolator.
+ *
+ * @param microsphere Microsphere.
+ * @param exponent Exponent used in the power law that computes the
+ * weights (distance dimming factor) of the sample data.
+ * @param sharedSphere Whether the sphere can be shared among the
+ * interpolating function instances. If {@code true}, the instances
+ * will share the same data, and thus will <em>not</em> be thread-safe.
+ * @param noInterpolationTolerance 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).
+ * @throws NotPositiveException if {@code exponent < 0}.
+ */
+ public MicrosphereProjectionInterpolator(InterpolatingMicrosphere microsphere,
+ double exponent,
+ boolean sharedSphere,
+ double noInterpolationTolerance)
+<span class="fc" id="L110"> throws NotPositiveException {</span>
+<span class="pc bpc" id="L111" title="1 of 2 branches missed."> if (exponent < 0) {</span>
+<span class="nc" id="L112"> throw new NotPositiveException(exponent);</span>
+ }
+
+<span class="fc" id="L115"> this.microsphere = microsphere;</span>
+<span class="fc" id="L116"> this.exponent = exponent;</span>
+<span class="fc" id="L117"> this.sharedSphere = sharedSphere;</span>
+<span class="fc" id="L118"> this.noInterpolationTolerance = noInterpolationTolerance;</span>
+<span class="fc" id="L119"> }</span>
+
+ /**
+ * {@inheritDoc}
+ *
+ * @throws DimensionMismatchException if the space dimension of the
+ * given samples does not match the space dimension of the microsphere.
+ */
+ @Override
+ public MultivariateFunction interpolate(final double[][] xval,
+ final double[] yval)
+ throws DimensionMismatchException,
+ NoDataException,
+ NullArgumentException {
+<span class="pc bpc" id="L133" title="2 of 4 branches missed."> if (xval == null ||</span>
+ yval == null) {
+<span class="nc" id="L135"> throw new NullArgumentException();</span>
+ }
+<span class="pc bpc" id="L137" title="1 of 2 branches missed."> if (xval.length == 0) {</span>
+<span class="nc" id="L138"> throw new NoDataException();</span>
+ }
+<span class="pc bpc" id="L140" title="1 of 2 branches missed."> if (xval.length != yval.length) {</span>
+<span class="nc" id="L141"> throw new DimensionMismatchException(xval.length, yval.length);</span>
+ }
+<span class="pc bpc" id="L143" title="1 of 2 branches missed."> if (xval[0] == null) {</span>
+<span class="nc" id="L144"> throw new NullArgumentException();</span>
+ }
+<span class="fc" id="L146"> final int dimension = microsphere.getDimension();</span>
+<span class="pc bpc" id="L147" title="1 of 2 branches missed."> if (dimension != xval[0].length) {</span>
+<span class="nc" id="L148"> throw new DimensionMismatchException(xval[0].length, dimension);</span>
+ }
+
+ // Microsphere copy.
+<span class="pc bpc" id="L152" title="1 of 2 branches missed."> final InterpolatingMicrosphere m = sharedSphere ? microsphere : microsphere.copy();</span>
+
+<span class="fc" id="L154"> return new MultivariateFunction() {</span>
+ /** {inheritDoc} */
+ @Override
+ public double value(double[] point) {
+<span class="fc" id="L158"> return m.value(point,</span>
+ xval,
+ yval,
+ exponent,
+ noInterpolationTolerance);
+ }
+ };
+ }
+}
+</pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.4.201502262128</span></div></body></html>
\ No newline at end of file
Propchange: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator.java.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/MicrosphereProjectionInterpolator.java.html
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision