You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2014/05/02 11:04:02 UTC
svn commit: r1591835 [2/2] - in
/commons/proper/math/trunk/src/main/java/org/apache/commons/math3: ./
complex/ geometry/enclosing/ geometry/euclidean/threed/
geometry/partitioning/ geometry/partitioning/utilities/
geometry/spherical/twod/ optim/ optimi...
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Precision.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Precision.java?rev=1591835&r1=1591834&r2=1591835&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Precision.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Precision.java Fri May 2 09:04:01 2014
@@ -47,7 +47,7 @@ public class Precision {
/**
* Safe minimum, such that {@code 1 / SAFE_MIN} does not overflow.
- * <p>
+ * <br/>
* In IEEE 754 arithmetic, this is also the smallest normalized
* number 2<sup>-1022</sup>.
*/
@@ -92,7 +92,7 @@ public class Precision {
* @param eps the amount of error to allow when checking for equality
* @return <ul><li>0 if {@link #equals(double, double, double) equals(x, y, eps)}</li>
* <li>< 0 if !{@link #equals(double, double, double) equals(x, y, eps)} && x < y</li>
- * <li>> 0 if !{@link #equals(double, double, double) equals(x, y, eps)} && x > y</li></ul>
+ * <li>> 0 if !{@link #equals(double, double, double) equals(x, y, eps)} && x > y</li></ul>
*/
public static int compareTo(double x, double y, double eps) {
if (equals(x, y, eps)) {
@@ -118,7 +118,7 @@ public class Precision {
* values between {@code x} and {@code y}.
* @return <ul><li>0 if {@link #equals(double, double, int) equals(x, y, maxUlps)}</li>
* <li>< 0 if !{@link #equals(double, double, int) equals(x, y, maxUlps)} && x < y</li>
- * <li>> 0 if !{@link #equals(double, double, int) equals(x, y, maxUlps)} && x > y</li></ul>
+ * <li>> 0 if !{@link #equals(double, double, int) equals(x, y, maxUlps)} && x > y</li></ul>
*/
public static int compareTo(final double x, final double y, final int maxUlps) {
if (equals(x, y, maxUlps)) {
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java?rev=1591835&r1=1591834&r2=1591835&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java Fri May 2 09:04:01 2014
@@ -22,8 +22,8 @@ import java.util.Arrays;
import org.apache.commons.math3.exception.MathIllegalArgumentException;
import org.apache.commons.math3.exception.MathIllegalStateException;
import org.apache.commons.math3.exception.MathInternalError;
-import org.apache.commons.math3.exception.NotStrictlyPositiveException;
import org.apache.commons.math3.exception.NullArgumentException;
+import org.apache.commons.math3.exception.NotStrictlyPositiveException;
import org.apache.commons.math3.exception.NumberIsTooSmallException;
import org.apache.commons.math3.exception.util.LocalizedFormats;
@@ -220,6 +220,7 @@ public class ResizableDoubleArray implem
* <li>{@code expansionMode = MULTIPLICATIVE}</li>
* <li>{@code contractionCriterion = 0.5 + expansionFactor}</li>
* </ul>
+ * <br/>
* Throws IllegalArgumentException if the following conditions are
* not met:
* <ul>
@@ -250,6 +251,7 @@ public class ResizableDoubleArray implem
* <li>{@code expansionMode = MULTIPLICATIVE}</li>
* <li>{@code contractionCriterion = 0.5 + expansionFactor}</li>
* </ul>
+ * <br/>
* Throws IllegalArgumentException if the following conditions are
* not met:
* <ul>
@@ -275,7 +277,7 @@ public class ResizableDoubleArray implem
* Creates an instance with the specified initialCapacity,
* expansionFactor, and contractionCriterion.
* The expansion mode will default to {@code MULTIPLICATIVE}.
- * <p>
+ * <br/>
* Throws IllegalArgumentException if the following conditions are
* not met:
* <ul>
@@ -306,7 +308,7 @@ public class ResizableDoubleArray implem
* Creates an instance with the specified initial capacity,
* expansion factor, and contraction criteria.
* The expansion mode will default to {@code MULTIPLICATIVE}.
- * <p>
+ * <br/>
* Throws IllegalArgumentException if the following conditions are
* not met:
* <ul>
@@ -316,7 +318,8 @@ public class ResizableDoubleArray implem
* </ul>
*
* @param initialCapacity Initial size of the internal storage array..
- * @param expansionFactor The array will be expanded based on this parameter.
+ * @param expansionFactor The array will be expanded based on this
+ * parameter.
* @param contractionCriterion Contraction criterion.
* @throws MathIllegalArgumentException if the parameters are not valid.
* @since 3.1
@@ -333,17 +336,18 @@ public class ResizableDoubleArray implem
}
/**
- * Create a ResizableArray with the specified properties.
+ * <p>
+ * Create a ResizableArray with the specified properties.</p>
* <p>
* Throws IllegalArgumentException if the following conditions are
* not met:
* <ul>
- * <li><code>initialCapacity > 0</code></li>
- * <li><code>expansionFactor > 1</code></li>
- * <li><code>contractionFactor ≥ expansionFactor</code></li>
+ * <li><code>initialCapacity > 0</code></li>
+ * <li><code>expansionFactor > 1</code></li>
+ * <li><code>contractionFactor >= expansionFactor</code></li>
* <li><code>expansionMode in {MULTIPLICATIVE_MODE, ADDITIVE_MODE}</code>
* </li>
- * </ul>
+ * </ul></p>
*
* @param initialCapacity the initial size of the internal storage array
* @param expansionFactor the array will be expanded based on this
@@ -372,12 +376,12 @@ public class ResizableDoubleArray implem
/**
* Creates an instance with the specified properties.
- * <p>
+ * <br/>
* Throws MathIllegalArgumentException if the following conditions are
* not met:
* <ul>
- * <li>{@code initialCapacity > 0}</li>
- * <li>{@code expansionFactor > 1}</li>
+ * <li>{@code initialCapacity > 0}</li>
+ * <li>{@code expansionFactor > 1}</li>
* <li>{@code contractionCriterion >= expansionFactor}</li>
* </ul>
*
@@ -415,9 +419,9 @@ public class ResizableDoubleArray implem
/**
* Copy constructor. Creates a new ResizableDoubleArray that is a deep,
- * fresh copy of the original. Needs to acquire synchronization lock on original.
- * <p>
- * Original may not be null; otherwise a {@link NullArgumentException} is thrown.
+ * fresh copy of the original. Needs to acquire synchronization lock
+ * on original. Original may not be null; otherwise a {@link NullArgumentException}
+ * is thrown.
*
* @param original array to copy
* @exception NullArgumentException if original is null
@@ -461,10 +465,12 @@ public class ResizableDoubleArray implem
* Adds an element to the end of the array and removes the first
* element in the array. Returns the discarded first element.
* The effect is similar to a push operation in a FIFO queue.
+ * </p>
* <p>
* Example: If the array contains the elements 1, 2, 3, 4 (in that order)
* and addElementRolling(5) is invoked, the result is an array containing
* the entries 2, 3, 4, 5 and the value returned is 1.
+ * </p>
*
* @param value Value to be added to the array.
* @return the value which has been discarded or "pushed" out of the array
@@ -517,7 +523,7 @@ public class ResizableDoubleArray implem
/**
* Checks the expansion factor and the contraction criterion and throws an
* IllegalArgumentException if the contractionCriteria is less than the
- * expansionCriteria.
+ * expansionCriteria
*
* @param expansion factor to be checked
* @param contraction criteria to be checked
@@ -580,7 +586,8 @@ public class ResizableDoubleArray implem
/**
* Contracts the storage array to the (size of the element set) + 1 - to
- * avoid a zero length array. This function also resets the startIndex to zero.
+ * avoid a zero length array. This function also resets the startIndex to
+ * zero.
*/
public synchronized void contract() {
final double[] tempArray = new double[numElements + 1];
@@ -871,15 +878,15 @@ public class ResizableDoubleArray implem
* Provides <em>direct</em> access to the internal storage array.
* Please note that this method returns a reference to this object's
* storage array, not a copy.
- * <p>
+ * <br/>
* To correctly address elements of the array, the "start index" is
* required (available via the {@link #getStartIndex() getStartIndex}
* method.
- * <p>
+ * <br/>
* This method should only be used to avoid copying the internal array.
* The returned value <em>must</em> be used for reading only; other
* uses could lead to this object becoming inconsistent.
- * <p>
+ * <br/>
* The {@link #getElements} method has no such limitation since it
* returns a copy of this array's addressable elements.
*
@@ -969,11 +976,11 @@ public class ResizableDoubleArray implem
* Sets the expansionFactor. Throws IllegalArgumentException if the
* the following conditions are not met:
* <ul>
- * <li><code>expansionFactor > 1</code></li>
- * <li><code>contractionFactor ≥ expansionFactor</code></li>
+ * <li><code>expansionFactor > 1</code></li>
+ * <li><code>contractionFactor >= expansionFactor</code></li>
* </ul>
* @param expansionFactor the new expansion factor value.
- * @throws MathIllegalArgumentException if expansionFactor is ≤ 1 or greater
+ * @throws MathIllegalArgumentException if expansionFactor is <= 1 or greater
* than contractionFactor
* @deprecated As of 3.1 (to be removed in 4.0 as field will become "final").
*/
@@ -1095,14 +1102,15 @@ public class ResizableDoubleArray implem
}
/**
- * Copies source to dest, copying the underlying data, so dest is
- * a new, independent copy of source. Does not contract before the copy.
- * <p>
- * Obtains synchronization locks on both source and dest
- * (in that order) before performing the copy.
- * <p>
- * Neither source nor dest may be null; otherwise a {@link NullArgumentException}
- * is thrown.
+ * <p>Copies source to dest, copying the underlying data, so dest is
+ * a new, independent copy of source. Does not contract before
+ * the copy.</p>
+ *
+ * <p>Obtains synchronization locks on both source and dest
+ * (in that order) before performing the copy.</p>
+ *
+ * <p>Neither source nor dest may be null; otherwise a {@link NullArgumentException}
+ * is thrown</p>
*
* @param source ResizableDoubleArray to copy
* @param dest ResizableArray to replace with a copy of the source array
@@ -1130,7 +1138,7 @@ public class ResizableDoubleArray implem
}
/**
- * Returns a copy of the ResizableDoubleArray. Does not contract before
+ * Returns a copy of the ResizableDoubleArray. Does not contract before
* the copy, so the returned object is an exact copy of this.
*
* @return a new ResizableDoubleArray with the same data and configuration