You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ps...@apache.org on 2009/09/05 19:37:05 UTC
svn commit: r811685 [14/24] - in /commons/proper/math/trunk: ./
src/main/java/org/apache/commons/math/
src/main/java/org/apache/commons/math/analysis/
src/main/java/org/apache/commons/math/analysis/integration/
src/main/java/org/apache/commons/math/ana...
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java Sat Sep 5 17:36:48 2009
@@ -74,7 +74,7 @@
/**
* Add two integers, checking for overflow.
- *
+ *
* @param x an addend
* @param y an addend
* @return the sum <code>x+y</code>
@@ -92,7 +92,7 @@
/**
* Add two long integers, checking for overflow.
- *
+ *
* @param a an addend
* @param b an addend
* @return the sum <code>a+b</code>
@@ -103,10 +103,10 @@
public static long addAndCheck(long a, long b) {
return addAndCheck(a, b, "overflow: add");
}
-
+
/**
* Add two long integers, checking for overflow.
- *
+ *
* @param a an addend
* @param b an addend
* @param msg the message to use for any thrown exception.
@@ -122,7 +122,7 @@
ret = addAndCheck(b, a, msg);
} else {
// assert a <= b
-
+
if (a < 0) {
if (b < 0) {
// check for negative overflow
@@ -149,7 +149,7 @@
}
return ret;
}
-
+
/**
* Returns an exact representation of the <a
* href="http://mathworld.wolfram.com/BinomialCoefficient.html"> Binomial
@@ -167,7 +167,7 @@
* <code>Long.MAX_VALUE</code> an <code>ArithMeticException</code> is
* thrown.</li>
* </ul></p>
- *
+ *
* @param n the size of the set
* @param k the size of the subsets to be counted
* @return <code>n choose k</code>
@@ -186,7 +186,7 @@
// Use symmetry for large k
if (k > n / 2)
return binomialCoefficient(n, n - k);
-
+
// We use the formula
// (n choose k) = n! / (n-k)! / k!
// (n choose k) == ((n-k+1)*...*n) / (1*...*k)
@@ -239,7 +239,7 @@
* Double.MAX_VALUE is 1029. If the computed value exceeds Double.MAX_VALUE,
* Double.POSITIVE_INFINITY is returned</li>
* </ul></p>
- *
+ *
* @param n the size of the set
* @param k the size of the subsets to be counted
* @return <code>n choose k</code>
@@ -259,15 +259,15 @@
if (n < 67) {
return binomialCoefficient(n,k);
}
-
+
double result = 1d;
for (int i = 1; i <= k; i++) {
result *= (double)(n - k + i) / (double)i;
}
-
+
return Math.floor(result + 0.5);
}
-
+
/**
* Returns the natural <code>log</code> of the <a
* href="http://mathworld.wolfram.com/BinomialCoefficient.html"> Binomial
@@ -280,7 +280,7 @@
* <li> <code>0 <= k <= n </code> (otherwise
* <code>IllegalArgumentException</code> is thrown)</li>
* </ul></p>
- *
+ *
* @param n the size of the set
* @param k the size of the subsets to be counted
* @return <code>n choose k</code>
@@ -294,22 +294,22 @@
if ((k == 1) || (k == n - 1)) {
return Math.log(n);
}
-
+
/*
* For values small enough to do exact integer computation,
- * return the log of the exact value
+ * return the log of the exact value
*/
- if (n < 67) {
+ if (n < 67) {
return Math.log(binomialCoefficient(n,k));
}
-
+
/*
* Return the log of binomialCoefficientDouble for values that will not
* overflow binomialCoefficientDouble
*/
- if (n < 1030) {
+ if (n < 1030) {
return Math.log(binomialCoefficientDouble(n, k));
- }
+ }
if (k > n / 2) {
return binomialCoefficientLog(n, n - k);
@@ -330,7 +330,7 @@
logSum -= Math.log(i);
}
- return logSum;
+ return logSum;
}
/**
@@ -352,10 +352,10 @@
n);
}
}
-
+
/**
* Compares two numbers given some amount of allowed error.
- *
+ *
* @param x the first number
* @param y the second number
* @param eps the amount of error to allow when checking for equality
@@ -371,22 +371,22 @@
}
return 1;
}
-
+
/**
* Returns the <a href="http://mathworld.wolfram.com/HyperbolicCosine.html">
* hyperbolic cosine</a> of x.
- *
+ *
* @param x double value for which to find the hyperbolic cosine
* @return hyperbolic cosine of x
*/
public static double cosh(double x) {
return (Math.exp(x) + Math.exp(-x)) / 2.0;
}
-
+
/**
* Returns true iff both arguments are NaN or neither is NaN and they are
* equal
- *
+ *
* @param x first value
* @param y second value
* @return true if the values are equal or both are NaN
@@ -401,7 +401,7 @@
* <p>
* Two NaNs are considered equals, as are two infinities with same sign.
* </p>
- *
+ *
* @param x first value
* @param y second value
* @param eps the amount of absolute error to allow
@@ -410,7 +410,7 @@
public static boolean equals(double x, double y, double eps) {
return equals(x, y) || (Math.abs(y - x) <= eps);
}
-
+
/**
* Returns true iff both arguments are equal or within the range of allowed
* error (inclusive).
@@ -447,7 +447,7 @@
/**
* Returns true iff both arguments are null or have same dimensions
* and all their elements are {@link #equals(double,double) equals}
- *
+ *
* @param x first array
* @param y second array
* @return true if the values are both null or have same dimension
@@ -468,9 +468,9 @@
}
return true;
}
-
+
/** All long-representable factorials */
- private static final long[] FACTORIALS = new long[]
+ private static final long[] FACTORIALS = new long[]
{1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800,
479001600, 6227020800l, 87178291200l, 1307674368000l, 20922789888000l,
355687428096000l, 6402373705728000l, 121645100408832000l,
@@ -491,7 +491,7 @@
* an <code>ArithMeticException </code> is thrown.</li>
* </ul>
* </p>
- *
+ *
* @param n argument
* @return <code>n!</code>
* @throws ArithmeticException if the result is too large to be represented
@@ -526,7 +526,7 @@
* Double.MAX_VALUE, Double.POSITIVE_INFINITY is returned</li>
* </ul>
* </p>
- *
+ *
* @param n argument
* @return <code>n!</code>
* @throws IllegalArgumentException if n < 0
@@ -551,7 +551,7 @@
* <li> <code>n >= 0</code> (otherwise
* <code>IllegalArgumentException</code> is thrown)</li>
* </ul></p>
- *
+ *
* @param n argument
* @return <code>n!</code>
* @throws IllegalArgumentException if preconditions are not met.
@@ -593,7 +593,7 @@
* <li>The invocation <code>gcd(0, 0)</code> is the only one which returns
* <code>0</code>.</li>
* </ul>
- *
+ *
* @param p any number
* @param q any number
* @return the greatest common divisor, never negative
@@ -664,7 +664,7 @@
/**
* Returns an integer hash code representing the given double value.
- *
+ *
* @param value the value to be hashed
* @return the hash code
*/
@@ -674,7 +674,7 @@
/**
* Returns an integer hash code representing the given double array.
- *
+ *
* @param value the value to be hashed (may be null)
* @return the hash code
* @since 1.2
@@ -686,7 +686,7 @@
/**
* For a byte value x, this method returns (byte)(+1) if x >= 0 and
* (byte)(-1) if x < 0.
- *
+ *
* @param x the value, a byte
* @return (byte)(+1) or (byte)(-1), depending on the sign of x
*/
@@ -698,7 +698,7 @@
* For a double precision value x, this method returns +1.0 if x >= 0 and
* -1.0 if x < 0. Returns <code>NaN</code> if <code>x</code> is
* <code>NaN</code>.
- *
+ *
* @param x the value, a double
* @return +1.0 or -1.0, depending on the sign of x
*/
@@ -712,7 +712,7 @@
/**
* For a float value x, this method returns +1.0F if x >= 0 and -1.0F if x <
* 0. Returns <code>NaN</code> if <code>x</code> is <code>NaN</code>.
- *
+ *
* @param x the value, a float
* @return +1.0F or -1.0F, depending on the sign of x
*/
@@ -725,7 +725,7 @@
/**
* For an int value x, this method returns +1 if x >= 0 and -1 if x < 0.
- *
+ *
* @param x the value, an int
* @return +1 or -1, depending on the sign of x
*/
@@ -735,7 +735,7 @@
/**
* For a long value x, this method returns +1L if x >= 0 and -1L if x < 0.
- *
+ *
* @param x the value, a long
* @return +1L or -1L, depending on the sign of x
*/
@@ -746,7 +746,7 @@
/**
* For a short value x, this method returns (short)(+1) if x >= 0 and
* (short)(-1) if x < 0.
- *
+ *
* @param x the value, a short
* @return (short)(+1) or (short)(-1), depending on the sign of x
*/
@@ -768,7 +768,7 @@
* <li>The result of <code>lcm(0, x)</code> and <code>lcm(x, 0)</code> is
* <code>0</code> for any <code>x</code>.
* </ul>
- *
+ *
* @param a any number
* @param b any number
* @return the least common multiple, never negative
@@ -788,29 +788,29 @@
return lcm;
}
- /**
- * <p>Returns the
+ /**
+ * <p>Returns the
* <a href="http://mathworld.wolfram.com/Logarithm.html">logarithm</a>
* for base <code>b</code> of <code>x</code>.
* </p>
- * <p>Returns <code>NaN<code> if either argument is negative. If
+ * <p>Returns <code>NaN<code> if either argument is negative. If
* <code>base</code> is 0 and <code>x</code> is positive, 0 is returned.
- * If <code>base</code> is positive and <code>x</code> is 0,
+ * If <code>base</code> is positive and <code>x</code> is 0,
* <code>Double.NEGATIVE_INFINITY</code> is returned. If both arguments
* are 0, the result is <code>NaN</code>.</p>
- *
+ *
* @param base the base of the logarithm, must be greater than 0
* @param x argument, must be greater than 0
* @return the value of the logarithm - the number y such that base^y = x.
* @since 1.2
- */
+ */
public static double log(double base, double x) {
return Math.log(x)/Math.log(base);
}
/**
* Multiply two integers, checking for overflow.
- *
+ *
* @param x a factor
* @param y a factor
* @return the product <code>x*y</code>
@@ -828,7 +828,7 @@
/**
* Multiply two long integers, checking for overflow.
- *
+ *
* @param a first value
* @param b second value
* @return the product <code>a * b</code>
@@ -857,7 +857,7 @@
ret = a * b;
} else {
throw new ArithmeticException(msg);
-
+
}
} else {
// assert b == 0
@@ -866,7 +866,7 @@
} else if (a > 0) {
// assert a > 0
// assert b > 0
-
+
// check for positive overflow with positive a, positive b
if (a <= Long.MAX_VALUE / b) {
ret = a * b;
@@ -891,7 +891,7 @@
* strictly less than <code>d</code> is returned.</p>
* <p>
* If <code>d</code> is NaN or Infinite, it is returned unchanged.</p>
- *
+ *
* @param d base number
* @param direction (the only important thing is whether
* direction is greater or smaller than d)
@@ -941,7 +941,7 @@
/**
* Scale a number by 2<sup>scaleFactor</sup>.
* <p>If <code>d</code> is 0 or NaN or Infinite, it is returned unchanged.</p>
- *
+ *
* @param d base number
* @param scaleFactor power of two by which d sould be multiplied
* @return d × 2<sup>scaleFactor</sup>
@@ -987,21 +987,21 @@
public static double normalizeAngle(double a, double center) {
return a - TWO_PI * Math.floor((a + Math.PI - center) / TWO_PI);
}
-
+
/**
- * <p>Normalizes an array to make it sum to a specified value.
+ * <p>Normalizes an array to make it sum to a specified value.
* Returns the result of the transformation <pre>
* x |-> x * normalizedSum / sum
* </pre>
* applied to each non-NaN element x of the input array, where sum is the
* sum of the non-NaN entries in the input array.</p>
- *
+ *
* <p>Throws IllegalArgumentException if <code>normalizedSum</code> is infinite
* or NaN and ArithmeticException if the input array contains any infinite elements
* or sums to 0</p>
- *
+ *
* <p>Ignores (i.e., copies unchanged to the output array) NaNs in the input array.</p>
- *
+ *
* @param values input array to be normalized
* @param normalizedSum target sum for the normalized array
* @return normalized array
@@ -1032,7 +1032,7 @@
}
if (sum == 0) {
throw MathRuntimeException.createArithmeticException(
- "Array sums to zero");
+ "Array sums to zero");
}
for (int i = 0; i < len; i++) {
if (Double.isNaN(values[i])) {
@@ -1041,13 +1041,13 @@
out[i] = values[i] * normalizedSum / sum;
}
}
- return out;
+ return out;
}
/**
* Round the given value to the specified number of decimal places. The
* value is rounded using the {@link BigDecimal#ROUND_HALF_UP} method.
- *
+ *
* @param x the value to round.
* @param scale the number of digits to the right of the decimal point.
* @return the rounded value.
@@ -1061,7 +1061,7 @@
* Round the given value to the specified number of decimal places. The
* value is rounded using the given method which is any method defined in
* {@link BigDecimal}.
- *
+ *
* @param x the value to round.
* @param scale the number of digits to the right of the decimal point.
* @param roundingMethod the rounding method as defined in
@@ -1077,7 +1077,7 @@
.doubleValue();
} catch (NumberFormatException ex) {
if (Double.isInfinite(x)) {
- return x;
+ return x;
} else {
return Double.NaN;
}
@@ -1087,7 +1087,7 @@
/**
* Round the given value to the specified number of decimal places. The
* value is rounding using the {@link BigDecimal#ROUND_HALF_UP} method.
- *
+ *
* @param x the value to round.
* @param scale the number of digits to the right of the decimal point.
* @return the rounded value.
@@ -1101,7 +1101,7 @@
* Round the given value to the specified number of decimal places. The
* value is rounded using the given method which is any method defined in
* {@link BigDecimal}.
- *
+ *
* @param x the value to round.
* @param scale the number of digits to the right of the decimal point.
* @param roundingMethod the rounding method as defined in
@@ -1119,7 +1119,7 @@
* Round the given non-negative, value to the "nearest" integer. Nearest is
* determined by the rounding method specified. Rounding methods are defined
* in {@link BigDecimal}.
- *
+ *
* @param unscaled the value to round.
* @param sign the sign of the original, scaled value.
* @param roundingMethod the rounding method as defined in
@@ -1215,7 +1215,7 @@
* <p>
* For a byte value x, this method returns (byte)(+1) if x > 0, (byte)(0) if
* x = 0, and (byte)(-1) if x < 0.</p>
- *
+ *
* @param x the value, a byte
* @return (byte)(+1), (byte)(0), or (byte)(-1), depending on the sign of x
*/
@@ -1231,7 +1231,7 @@
* <code>+1.0</code> if <code>x > 0</code>, <code>0.0</code> if
* <code>x = 0.0</code>, and <code>-1.0</code> if <code>x < 0</code>.
* Returns <code>NaN</code> if <code>x</code> is <code>NaN</code>.</p>
- *
+ *
* @param x the value, a double
* @return +1.0, 0.0, or -1.0, depending on the sign of x
*/
@@ -1249,7 +1249,7 @@
* For a float value x, this method returns +1.0F if x > 0, 0.0F if x =
* 0.0F, and -1.0F if x < 0. Returns <code>NaN</code> if <code>x</code>
* is <code>NaN</code>.</p>
- *
+ *
* @param x the value, a float
* @return +1.0F, 0.0F, or -1.0F, depending on the sign of x
*/
@@ -1266,7 +1266,7 @@
* <p>
* For an int value x, this method returns +1 if x > 0, 0 if x = 0, and -1
* if x < 0.</p>
- *
+ *
* @param x the value, an int
* @return +1, 0, or -1, depending on the sign of x
*/
@@ -1280,7 +1280,7 @@
* <p>
* For a long value x, this method returns +1L if x > 0, 0L if x = 0, and
* -1L if x < 0.</p>
- *
+ *
* @param x the value, a long
* @return +1L, 0L, or -1L, depending on the sign of x
*/
@@ -1294,7 +1294,7 @@
* <p>
* For a short value x, this method returns (short)(+1) if x > 0, (short)(0)
* if x = 0, and (short)(-1) if x < 0.</p>
- *
+ *
* @param x the value, a short
* @return (short)(+1), (short)(0), or (short)(-1), depending on the sign of
* x
@@ -1306,7 +1306,7 @@
/**
* Returns the <a href="http://mathworld.wolfram.com/HyperbolicSine.html">
* hyperbolic sine</a> of x.
- *
+ *
* @param x double value for which to find the hyperbolic sine
* @return hyperbolic sine of x
*/
@@ -1316,7 +1316,7 @@
/**
* Subtract two integers, checking for overflow.
- *
+ *
* @param x the minuend
* @param y the subtrahend
* @return the difference <code>x-y</code>
@@ -1334,7 +1334,7 @@
/**
* Subtract two long integers, checking for overflow.
- *
+ *
* @param a first value
* @param b second value
* @return the difference <code>a-b</code>
@@ -1572,7 +1572,7 @@
}
return sum;
}
-
+
/**
* Calculates the L<sub>1</sub> (sum of abs) distance between two points.
*
@@ -1603,7 +1603,7 @@
}
return Math.sqrt(sum);
}
-
+
/**
* Calculates the L<sub>2</sub> (Euclidean) distance between two points.
*
@@ -1619,7 +1619,7 @@
}
return Math.sqrt(sum);
}
-
+
/**
* Calculates the L<sub>∞</sub> (max of abs) distance between two points.
*
@@ -1634,7 +1634,7 @@
}
return max;
}
-
+
/**
* Calculates the L<sub>∞</sub> (max of abs) distance between two points.
*
@@ -1650,5 +1650,5 @@
return max;
}
-
+
}
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/NumberTransformer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/NumberTransformer.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/NumberTransformer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/NumberTransformer.java Sat Sep 5 17:36:48 2009
@@ -21,19 +21,19 @@
/**
* Subclasses implementing this interface can transform Objects to doubles.
* @version $Revision$ $Date$
- *
+ *
* No longer extends Serializable since 2.0
- *
+ *
*/
public interface NumberTransformer {
-
+
/**
* Implementing this interface provides a facility to transform
* from Object to Double.
- *
+ *
* @param o the Object to be transformed.
* @return the double value of the Object.
- * @throws MathException if the Object can not be transformed into a Double.
+ * @throws MathException if the Object can not be transformed into a Double.
*/
double transform(Object o) throws MathException;
-}
\ No newline at end of file
+}
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/OpenIntToDoubleHashMap.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/OpenIntToDoubleHashMap.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/OpenIntToDoubleHashMap.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/OpenIntToDoubleHashMap.java Sat Sep 5 17:36:48 2009
@@ -281,7 +281,7 @@
j = probe(perturb, j);
index = j & mask;
perturb >>= PERTURB_SHIFT;
-
+
if (states[index] != FULL || keys[index] == key) {
break;
}
@@ -340,7 +340,7 @@
return size;
}
-
+
/**
* Remove the value associated with a key.
* @param key key to which the value is associated
@@ -475,7 +475,7 @@
return h ^ (h >>> 7) ^ (h >>> 4);
}
-
+
/** Iterator class for the map. */
public class Iterator {
@@ -592,5 +592,5 @@
count = 0;
}
-
+
}
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/OpenIntToFieldHashMap.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/OpenIntToFieldHashMap.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/OpenIntToFieldHashMap.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/OpenIntToFieldHashMap.java Sat Sep 5 17:36:48 2009
@@ -40,7 +40,7 @@
* @since 2.0
*/
public class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Serializable {
-
+
/** Serializable version identifier. */
private static final long serialVersionUID = -9179080286849120720L;
@@ -71,7 +71,7 @@
/** Field to which the elements belong. */
private final Field<T> field;
-
+
/** Keys table. */
private int[] keys;
@@ -293,7 +293,7 @@
j = probe(perturb, j);
index = j & mask;
perturb >>= PERTURB_SHIFT;
-
+
if (states[index] != FULL || keys[index] == key) {
break;
}
@@ -352,7 +352,7 @@
return size;
}
-
+
/**
* Remove the value associated with a key.
* @param key key to which the value is associated
@@ -487,7 +487,7 @@
return h ^ (h >>> 7) ^ (h >>> 4);
}
-
+
/** Iterator class for the map. */
public class Iterator {
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/ResizableDoubleArray.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/ResizableDoubleArray.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/ResizableDoubleArray.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/ResizableDoubleArray.java Sat Sep 5 17:36:48 2009
@@ -23,36 +23,36 @@
/**
* <p>
- * A variable length {@link DoubleArray} implementation that automatically
- * handles expanding and contracting its internal storage array as elements
+ * A variable length {@link DoubleArray} implementation that automatically
+ * handles expanding and contracting its internal storage array as elements
* are added and removed.
* </p>
* <p>
* The internal storage array starts with capacity determined by the
* <code>initialCapacity</code> property, which can be set by the constructor.
- * The default initial capacity is 16. Adding elements using
- * {@link #addElement(double)} appends elements to the end of the array. When
- * there are no open entries at the end of the internal storage array, the
- * array is expanded. The size of the expanded array depends on the
- * <code>expansionMode</code> and <code>expansionFactor</code> properties.
- * The <code>expansionMode</code> determines whether the size of the array is
- * multiplied by the <code>expansionFactor</code> (MULTIPLICATIVE_MODE) or if
+ * The default initial capacity is 16. Adding elements using
+ * {@link #addElement(double)} appends elements to the end of the array. When
+ * there are no open entries at the end of the internal storage array, the
+ * array is expanded. The size of the expanded array depends on the
+ * <code>expansionMode</code> and <code>expansionFactor</code> properties.
+ * The <code>expansionMode</code> determines whether the size of the array is
+ * multiplied by the <code>expansionFactor</code> (MULTIPLICATIVE_MODE) or if
* the expansion is additive (ADDITIVE_MODE -- <code>expansionFactor</code>
- * storage locations added). The default <code>expansionMode</code> is
+ * storage locations added). The default <code>expansionMode</code> is
* MULTIPLICATIVE_MODE and the default <code>expansionFactor</code>
* is 2.0.
* </p>
* <p>
* The {@link #addElementRolling(double)} method adds a new element to the end
- * of the internal storage array and adjusts the "usable window" of the
- * internal array forward by one position (effectively making what was the
+ * of the internal storage array and adjusts the "usable window" of the
+ * internal array forward by one position (effectively making what was the
* second element the first, and so on). Repeated activations of this method
* (or activation of {@link #discardFrontElements(int)}) will effectively orphan
* the storage locations at the beginning of the internal storage array. To
* reclaim this storage, each time one of these methods is activated, the size
- * of the internal storage array is compared to the number of addressable
+ * of the internal storage array is compared to the number of addressable
* elements (the <code>numElements</code> property) and if the difference
- * is too large, the internal array is contracted to size
+ * is too large, the internal array is contracted to size
* <code>numElements + 1.</code> The determination of when the internal
* storage array is "too large" depends on the <code>expansionMode</code> and
* <code>contractionFactor</code> properties. If the <code>expansionMode</code>
@@ -60,11 +60,11 @@
* ratio between storage array length and <code>numElements</code> exceeds
* <code>contractionFactor.</code> If the <code>expansionMode</code>
* is <code>ADDITIVE_MODE,</code> the number of excess storage locations
- * is compared to <code>contractionFactor.</code>
+ * is compared to <code>contractionFactor.</code>
* </p>
* <p>
- * To avoid cycles of expansions and contractions, the
- * <code>expansionFactor</code> must not exceed the
+ * To avoid cycles of expansions and contractions, the
+ * <code>expansionFactor</code> must not exceed the
* <code>contractionFactor.</code> Constructors and mutators for both of these
* properties enforce this requirement, throwing IllegalArgumentException if it
* is violated.
@@ -72,33 +72,33 @@
* @version $Revision$ $Date$
*/
public class ResizableDoubleArray implements DoubleArray, Serializable {
-
+
/** Serializable version identifier */
- private static final long serialVersionUID = -3485529955529426875L;
-
+ private static final long serialVersionUID = -3485529955529426875L;
+
/** additive expansion mode */
public static final int ADDITIVE_MODE = 1;
-
+
/** multiplicative expansion mode */
public static final int MULTIPLICATIVE_MODE = 0;
-
- /**
- * The contraction criteria determines when the internal array will be
+
+ /**
+ * The contraction criteria determines when the internal array will be
* contracted to fit the number of elements contained in the element
* array + 1.
*/
protected float contractionCriteria = 2.5f;
- /**
- * The expansion factor of the array. When the array needs to be expanded,
- * the new array size will be
+ /**
+ * The expansion factor of the array. When the array needs to be expanded,
+ * the new array size will be
* <code>internalArray.length * expansionFactor</code>
* if <code>expansionMode</code> is set to MULTIPLICATIVE_MODE, or
- * <code>internalArray.length + expansionFactor</code> if
+ * <code>internalArray.length + expansionFactor</code> if
* <code>expansionMode</code> is set to ADDITIVE_MODE.
*/
protected float expansionFactor = 2.0f;
-
+
/**
* Determines whether array expansion by <code>expansionFactor</code>
* is additive or multiplicative.
@@ -110,19 +110,19 @@
* property as it is only meaningful when passed to a constructor.
*/
protected int initialCapacity = 16;
-
- /**
+
+ /**
* The internal storage array.
*/
protected double[] internalArray;
- /**
+ /**
* The number of addressable elements in the array. Note that this
* has nothing to do with the length of the internal storage array.
*/
protected int numElements = 0;
- /**
+ /**
* The position of the first addressable element in the internal storage
* array. The addressable elements in the array are <code>
* internalArray[startIndex],...,internalArray[startIndex + numElements -1]
@@ -161,7 +161,7 @@
/**
* <p>
- * Create a ResizableArray with the specified initial capacity
+ * Create a ResizableArray with the specified initial capacity
* and expansion factor. The remaining properties take default
* values:
* <ul>
@@ -175,9 +175,9 @@
* <li><code>initialCapacity > 0</code></li>
* <li><code>expansionFactor > 1</code></li>
* </ul></p>
- *
+ *
* @param initialCapacity The initial size of the internal storage array
- * @param expansionFactor the array will be expanded based on this
+ * @param expansionFactor the array will be expanded based on this
* parameter
* @throws IllegalArgumentException if parameters are not valid
*/
@@ -190,7 +190,7 @@
/**
* <p>
- * Create a ResizableArray with the specified initialCapacity,
+ * Create a ResizableArray with the specified initialCapacity,
* expansionFactor, and contractionCriteria. The <code>expansionMode</code>
* will default to <code>MULTIPLICATIVE_MODE.</code></p>
* <p>
@@ -202,7 +202,7 @@
* <li><code>contractionFactor >= expansionFactor</code></li>
* </ul></p>
* @param initialCapacity The initial size of the internal storage array
- * @param expansionFactor the array will be expanded based on this
+ * @param expansionFactor the array will be expanded based on this
* parameter
* @param contractionCriteria The contraction Criteria.
* @throws IllegalArgumentException if parameters are not valid
@@ -214,7 +214,7 @@
setInitialCapacity(initialCapacity);
internalArray = new double[initialCapacity];
}
-
+
/**
* <p>
* Create a ResizableArray with the specified properties.</p>
@@ -228,9 +228,9 @@
* <li><code>expansionMode in {MULTIPLICATIVE_MODE, ADDITIVE_MODE}</code>
* </li>
* </ul></p>
- *
+ *
* @param initialCapacity the initial size of the internal storage array
- * @param expansionFactor the array will be expanded based on this
+ * @param expansionFactor the array will be expanded based on this
* parameter
* @param contractionCriteria the contraction Criteria
* @param expansionMode the expansion mode
@@ -244,13 +244,13 @@
setExpansionMode(expansionMode);
internalArray = new double[initialCapacity];
}
-
+
/**
* Copy constructor. Creates a new ResizableDoubleArray that is a deep,
* fresh copy of the original. Needs to acquire synchronization lock
* on original. Original may not be null; otherwise a NullPointerException
* is thrown.
- *
+ *
* @param original array to copy
* @since 2.0
*/
@@ -260,7 +260,7 @@
/**
* Adds an element to the end of this expandable array.
- *
+ *
* @param value to be added to end of array
*/
public synchronized void addElement(double value) {
@@ -285,7 +285,7 @@
* 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 the value to be added to the array
* @return the value which has been discarded or "pushed" out of the array
* by this rolling insert
@@ -308,12 +308,12 @@
}
return discarded;
}
-
+
/**
* Substitutes <code>value</code> for the most recently added value.
- * Returns the value that has been replaced. If the array is empty (i.e.
+ * Returns the value that has been replaced. If the array is empty (i.e.
* if {@link #numElements} is zero), a MathRuntimeException is thrown.
- *
+ *
* @param value new value to substitute for the most recently added value
* @return value that has been replaced in the array
* @since 2.0
@@ -331,12 +331,12 @@
return discarded;
}
-
+
/**
- * Checks the expansion factor and the contraction criteria and throws an
- * IllegalArgumentException if the contractionCriteria is less than the
+ * Checks the expansion factor and the contraction criteria and throws an
+ * IllegalArgumentException if the contractionCriteria is less than the
* expansionCriteria
- *
+ *
* @param expansion factor to be checked
* @param contraction criteria to be checked
* @throws IllegalArgumentException if the contractionCriteria is less than
@@ -366,9 +366,9 @@
expansion);
}
}
-
+
/**
- * Clear the array, reset the size to the initialCapacity and the number
+ * Clear the array, reset the size to the initialCapacity and the number
* of elements to zero.
*/
public synchronized void clear() {
@@ -376,11 +376,11 @@
startIndex = 0;
internalArray = new double[initialCapacity];
}
-
+
/**
- * 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.
+ * 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.
*/
public synchronized void contract() {
double[] tempArray = new double[numElements + 1];
@@ -395,11 +395,11 @@
/**
* Discards the <code>i<code> initial elements of the array. For example,
- * if the array contains the elements 1,2,3,4, invoking
- * <code>discardFrontElements(2)</code> will cause the first two elements
+ * if the array contains the elements 1,2,3,4, invoking
+ * <code>discardFrontElements(2)</code> will cause the first two elements
* to be discarded, leaving 3,4 in the array. Throws illegalArgumentException
* if i exceeds numElements.
- *
+ *
* @param i the number of elements to discard from the front of the array
* @throws IllegalArgumentException if i is greater than numElements.
* @since 2.0
@@ -407,16 +407,16 @@
public synchronized void discardFrontElements(int i) {
discardExtremeElements(i,true);
-
+
}
/**
* Discards the <code>i<code> last elements of the array. For example,
- * if the array contains the elements 1,2,3,4, invoking
- * <code>discardMostRecentElements(2)</code> will cause the last two elements
+ * if the array contains the elements 1,2,3,4, invoking
+ * <code>discardMostRecentElements(2)</code> will cause the last two elements
* to be discarded, leaving 1,2 in the array. Throws illegalArgumentException
* if i exceeds numElements.
- *
+ *
* @param i the number of elements to discard from the end of the array
* @throws IllegalArgumentException if i is greater than numElements.
* @since 2.0
@@ -424,25 +424,25 @@
public synchronized void discardMostRecentElements(int i) {
discardExtremeElements(i,false);
-
+
}
-
+
/**
* Discards the <code>i<code> first or last elements of the array,
* depending on the value of <code>front</code>.
- * For example, if the array contains the elements 1,2,3,4, invoking
- * <code>discardExtremeElements(2,false)</code> will cause the last two elements
+ * For example, if the array contains the elements 1,2,3,4, invoking
+ * <code>discardExtremeElements(2,false)</code> will cause the last two elements
* to be discarded, leaving 1,2 in the array.
- * For example, if the array contains the elements 1,2,3,4, invoking
- * <code>discardExtremeElements(2,true)</code> will cause the first two elements
+ * For example, if the array contains the elements 1,2,3,4, invoking
+ * <code>discardExtremeElements(2,true)</code> will cause the first two elements
* to be discarded, leaving 3,4 in the array.
* Throws illegalArgumentException
* if i exceeds numElements.
- *
+ *
* @param i the number of elements to discard from the front/end of the array
* @param front true if elements are to be discarded from the front
* of the array, false if elements are to be discarded from the end
- * of the array
+ * of the array
* @throws IllegalArgumentException if i is greater than numElements.
* @since 2.0
*/
@@ -456,7 +456,7 @@
"cannot discard a negative number of elements ({0})",
i);
} else {
- // "Subtract" this number of discarded from numElements
+ // "Subtract" this number of discarded from numElements
numElements -= i;
if (front) startIndex += i;
}
@@ -476,10 +476,10 @@
*/
protected synchronized void expand() {
- // notice the use of Math.ceil(), this guarantees that we will always
- // have an array of at least currentSize + 1. Assume that the
+ // notice the use of Math.ceil(), this guarantees that we will always
+ // have an array of at least currentSize + 1. Assume that the
// current initial capacity is 1 and the expansion factor
- // is 1.000000000000000001. The newly calculated size will be
+ // is 1.000000000000000001. The newly calculated size will be
// rounded up to 2 after the multiplication is performed.
int newSize = 0;
if (expansionMode == MULTIPLICATIVE_MODE) {
@@ -493,10 +493,10 @@
System.arraycopy(internalArray, 0, tempArray, 0, internalArray.length);
internalArray = tempArray;
}
-
+
/**
* Expands the internal storage array to the specified size.
- *
+ *
* @param size Size of the new internal storage array
*/
private synchronized void expandTo(int size) {
@@ -507,24 +507,24 @@
}
/**
- * The contraction criteria defines when the internal array will contract
- * to store only the number of elements in the element array.
+ * The contraction criteria defines when the internal array will contract
+ * to store only the number of elements in the element array.
* If the <code>expansionMode</code> is <code>MULTIPLICATIVE_MODE</code>,
- * contraction is triggered when the ratio between storage array length
+ * contraction is triggered when the ratio between storage array length
* and <code>numElements</code> exceeds <code>contractionFactor</code>.
* If the <code>expansionMode</code> is <code>ADDITIVE_MODE</code>, the
- * number of excess storage locations is compared to
- * <code>contractionFactor.</code>
- *
+ * number of excess storage locations is compared to
+ * <code>contractionFactor.</code>
+ *
* @return the contraction criteria used to reclaim memory.
*/
public float getContractionCriteria() {
return contractionCriteria;
}
-
+
/**
* Returns the element at the specified index
- *
+ *
* @param index index to fetch a value from
* @return value stored at the specified index
* @throws ArrayIndexOutOfBoundsException if <code>index</code> is less than
@@ -543,9 +543,9 @@
index);
}
}
-
+
/**
- * Returns a double array containing the elements of this
+ * Returns a double array containing the elements of this
* <code>ResizableArray</code>. This method returns a copy, not a
* reference to the underlying array, so that changes made to the returned
* array have no effect on this <code>ResizableArray.</code>
@@ -557,40 +557,40 @@
numElements);
return elementArray;
}
-
+
/**
- * The expansion factor controls the size of a new array when an array
+ * The expansion factor controls the size of a new array when an array
* needs to be expanded. The <code>expansionMode</code>
- * determines whether the size of the array is multiplied by the
- * <code>expansionFactor</code> (MULTIPLICATIVE_MODE) or if
+ * determines whether the size of the array is multiplied by the
+ * <code>expansionFactor</code> (MULTIPLICATIVE_MODE) or if
* the expansion is additive (ADDITIVE_MODE -- <code>expansionFactor</code>
- * storage locations added). The default <code>expansionMode</code> is
+ * storage locations added). The default <code>expansionMode</code> is
* MULTIPLICATIVE_MODE and the default <code>expansionFactor</code>
* is 2.0.
- *
+ *
* @return the expansion factor of this expandable double array
*/
public float getExpansionFactor() {
return expansionFactor;
}
-
+
/**
- * The <code>expansionMode</code> determines whether the internal storage
- * array grows additively (ADDITIVE_MODE) or multiplicatively
+ * The <code>expansionMode</code> determines whether the internal storage
+ * array grows additively (ADDITIVE_MODE) or multiplicatively
* (MULTIPLICATIVE_MODE) when it is expanded.
- *
+ *
* @return Returns the expansionMode.
*/
public int getExpansionMode() {
return expansionMode;
}
-
+
/**
- * Notice the package scope on this method. This method is simply here
- * for the JUnit test, it allows us check if the expansion is working
- * properly after a number of expansions. This is not meant to be a part
+ * Notice the package scope on this method. This method is simply here
+ * for the JUnit test, it allows us check if the expansion is working
+ * properly after a number of expansions. This is not meant to be a part
* of the public interface of this class.
- *
+ *
* @return the length of the internal storage array.
*/
synchronized int getInternalLength() {
@@ -599,14 +599,14 @@
/**
* Returns the number of elements currently in the array. Please note
- * that this is different from the length of the internal storage array.
+ * that this is different from the length of the internal storage array.
*
* @return number of elements
*/
public synchronized int getNumElements() {
return (numElements);
}
-
+
/**
* Returns the internal storage array. Note that this method returns
* a reference to the internal storage array, not a copy, and to correctly
@@ -615,7 +615,7 @@
* only be used in cases where copying the internal array is not practical.
* The {@link #getElements} method should be used in all other cases.
*
- *
+ *
* @return the internal storage array used by this object
* @deprecated replaced by {@link #getInternalValues()} as of 2.0
*/
@@ -632,7 +632,7 @@
* only be used in cases where copying the internal array is not practical.
* The {@link #getElements} method should be used in all other cases.
*
- *
+ *
* @return the internal storage array used by this object
* @since 2.0
*/
@@ -641,8 +641,8 @@
}
/**
- * Sets the contraction criteria for this ExpandContractDoubleArray.
- *
+ * Sets the contraction criteria for this ExpandContractDoubleArray.
+ *
* @param contractionCriteria contraction criteria
*/
public void setContractionCriteria(float contractionCriteria) {
@@ -651,15 +651,15 @@
this.contractionCriteria = contractionCriteria;
}
}
-
+
/**
* Sets the element at the specified index. If the specified index is greater than
* <code>getNumElements() - 1</code>, the <code>numElements</code> property
- * is increased to <code>index +1</code> and additional storage is allocated
- * (if necessary) for the new element and all (uninitialized) elements
+ * is increased to <code>index +1</code> and additional storage is allocated
+ * (if necessary) for the new element and all (uninitialized) elements
* between the new element and the previous end of the array).
- *
+ *
* @param index index to store a value in
* @param value value to store at the specified index
* @throws ArrayIndexOutOfBoundsException if <code>index</code> is less than
@@ -673,15 +673,15 @@
}
if (index + 1 > numElements) {
numElements = index + 1;
- }
+ }
if ((startIndex + index) >= internalArray.length) {
expandTo(startIndex + (index + 1));
- }
+ }
internalArray[startIndex + index] = value;
}
/**
- * Sets the expansionFactor. Throws IllegalArgumentException if the
+ * Sets the expansionFactor. Throws IllegalArgumentException if the
* the following conditions are not met:
* <ul>
* <li><code>expansionFactor > 1</code></li>
@@ -702,12 +702,12 @@
/**
* Sets the <code>expansionMode</code>. The specified value must be one of
* ADDITIVE_MODE, MULTIPLICATIVE_MODE.
- *
+ *
* @param expansionMode The expansionMode to set.
* @throws IllegalArgumentException if the specified mode value is not valid
*/
public void setExpansionMode(int expansionMode) {
- if (expansionMode != MULTIPLICATIVE_MODE &&
+ if (expansionMode != MULTIPLICATIVE_MODE &&
expansionMode != ADDITIVE_MODE) {
throw MathRuntimeException.createIllegalArgumentException(
"unsupported expansion mode {0}, supported modes are {1} ({2}) and {3} ({4})",
@@ -718,10 +718,10 @@
this.expansionMode = expansionMode;
}
}
-
+
/**
* Sets the initial capacity. Should only be invoked by constructors.
- *
+ *
* @param initialCapacity of the array
* @throws IllegalArgumentException if <code>initialCapacity</code> is not
* positive.
@@ -737,12 +737,12 @@
initialCapacity);
}
}
-
+
/**
- * This function allows you to control the number of elements contained
- * in this array, and can be used to "throw out" the last n values in an
+ * This function allows you to control the number of elements contained
+ * in this array, and can be used to "throw out" the last n values in an
* array. This function will also expand the internal array as needed.
- *
+ *
* @param i a new number of elements
* @throws IllegalArgumentException if <code>i</code> is negative.
*/
@@ -755,7 +755,7 @@
i);
}
- // Test the new num elements, check to see if the array needs to be
+ // Test the new num elements, check to see if the array needs to be
// expanded to accommodate this new number of elements
if ((startIndex + i) > internalArray.length) {
expandTo(startIndex + i);
@@ -766,13 +766,13 @@
}
/**
- * Returns true if the internal storage array has too many unused
- * storage positions.
- *
+ * Returns true if the internal storage array has too many unused
+ * storage positions.
+ *
* @return true if array satisfies the contraction criteria
*/
private synchronized boolean shouldContract() {
- if (expansionMode == MULTIPLICATIVE_MODE) {
+ if (expansionMode == MULTIPLICATIVE_MODE) {
return (internalArray.length / ((float) numElements)) > contractionCriteria;
} else {
return (internalArray.length - numElements) > contractionCriteria;
@@ -791,22 +791,22 @@
public synchronized int start() {
return startIndex;
}
-
+
/**
* <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 NullPointerException
* is thrown</p>
- *
+ *
* @param source ResizableDoubleArray to copy
* @param dest ResizableArray to replace with a copy of the source array
* @since 2.0
- *
+ *
*/
public static void copy(ResizableDoubleArray source, ResizableDoubleArray dest) {
synchronized(source) {
@@ -823,11 +823,11 @@
}
}
}
-
+
/**
* 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
* properties as this
* @since 2.0
@@ -837,11 +837,11 @@
copy(this, result);
return result;
}
-
+
/**
* Returns true iff object is a ResizableDoubleArray with the same properties
* as this and an identical internal storage array.
- *
+ *
* @param object object to be compared for equality with this
* @return true iff object is a ResizableDoubleArray with the same data and
* properties as this
@@ -865,7 +865,7 @@
result = result && (other.expansionMode == expansionMode);
result = result && (other.numElements == numElements);
result = result && (other.startIndex == startIndex);
- if (!result) {
+ if (!result) {
return false;
} else {
return Arrays.equals(internalArray, other.internalArray);
@@ -873,10 +873,10 @@
}
}
}
-
+
/**
* Returns a hash code consistent with equals.
- *
+ *
* @return hash code representing this ResizableDoubleArray
* @since 2.0
*/
@@ -892,5 +892,5 @@
hashData[6] = startIndex;
return Arrays.hashCode(hashData);
}
-
+
}
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/TransformerMap.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/TransformerMap.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/TransformerMap.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/TransformerMap.java Sat Sep 5 17:36:48 2009
@@ -26,7 +26,7 @@
/**
* This TansformerMap automates the transformation of mixed object types.
- * It provides a means to set NumberTransformers that will be selected
+ * It provides a means to set NumberTransformers that will be selected
* based on the Class of the object handed to the Maps
* <code>double transform(Object o)</code> method.
* @version $Revision$ $Date$
@@ -120,7 +120,7 @@
}
/**
- * Returns the Set of NumberTransformers used as values
+ * Returns the Set of NumberTransformers used as values
* in the map.
* @return Set of NumberTransformers
*/
@@ -131,10 +131,10 @@
/**
* Attempts to transform the Object against the map of
* NumberTransformers. Otherwise it returns Double.NaN.
- *
+ *
* @param o the Object to be transformed.
* @return the double value of the Object.
- * @throws MathException if the Object can not be transformed into a Double.
+ * @throws MathException if the Object can not be transformed into a Double.
* @see org.apache.commons.math.util.NumberTransformer#transform(java.lang.Object)
*/
public double transform(Object o) throws MathException {
@@ -155,7 +155,7 @@
/** {@inheritDoc} */
@Override
public boolean equals(Object other) {
- if (this == other) {
+ if (this == other) {
return true;
}
if (other == null) {
@@ -179,7 +179,7 @@
return false;
}
}
-
+
/** {@inheritDoc} */
@Override
public int hashCode() {
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/ArgumentOutsideDomainExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/ArgumentOutsideDomainExceptionTest.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/ArgumentOutsideDomainExceptionTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/ArgumentOutsideDomainExceptionTest.java Sat Sep 5 17:36:48 2009
@@ -5,9 +5,9 @@
* 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.
@@ -25,7 +25,7 @@
* @version $Revision$ $Date$
*/
public class ArgumentOutsideDomainExceptionTest extends TestCase {
-
+
public void testConstructor(){
ArgumentOutsideDomainException ex = new ArgumentOutsideDomainException(Math.PI, 10.0, 20.0);
assertNull(ex.getCause());
@@ -34,5 +34,5 @@
assertEquals(Math.PI, ex.getArgument()[0], 0);
assertFalse(ex.getMessage().equals(ex.getMessage(Locale.FRENCH)));
}
-
+
}
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/ConvergenceExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/ConvergenceExceptionTest.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/ConvergenceExceptionTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/ConvergenceExceptionTest.java Sat Sep 5 17:36:48 2009
@@ -5,9 +5,9 @@
* 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.
@@ -33,7 +33,7 @@
assertNotNull(ex.getMessage(Locale.FRENCH));
assertFalse(ex.getMessage().equals(ex.getMessage(Locale.FRENCH)));
}
-
+
public void testConstructorPatternArguments(){
String pattern = "a {0}x{1} matrix cannot be a rotation matrix";
Object[] arguments = { Integer.valueOf(6), Integer.valueOf(4) };
@@ -47,7 +47,7 @@
assertFalse(pattern.equals(ex.getMessage()));
assertFalse(ex.getMessage().equals(ex.getMessage(Locale.FRENCH)));
}
-
+
public void testConstructorCause(){
String inMsg = "inner message";
Exception cause = new Exception(inMsg);
@@ -70,5 +70,5 @@
assertFalse(pattern.equals(ex.getMessage()));
assertFalse(ex.getMessage().equals(ex.getMessage(Locale.FRENCH)));
}
-
+
}
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/DuplicateSampleAbscissaExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/DuplicateSampleAbscissaExceptionTest.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/DuplicateSampleAbscissaExceptionTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/DuplicateSampleAbscissaExceptionTest.java Sat Sep 5 17:36:48 2009
@@ -5,9 +5,9 @@
* 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.
@@ -25,7 +25,7 @@
* @version $Revision$ $Date$
*/
public class DuplicateSampleAbscissaExceptionTest extends TestCase {
-
+
public void testConstructor(){
DuplicateSampleAbscissaException ex = new DuplicateSampleAbscissaException(1.2, 10, 11);
assertNull(ex.getCause());
@@ -34,5 +34,5 @@
assertEquals(1.2, ex.getDuplicateAbscissa(), 0);
assertFalse(ex.getMessage().equals(ex.getMessage(Locale.FRENCH)));
}
-
+
}
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/FunctionEvaluationExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/FunctionEvaluationExceptionTest.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/FunctionEvaluationExceptionTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/FunctionEvaluationExceptionTest.java Sat Sep 5 17:36:48 2009
@@ -5,9 +5,9 @@
* 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.
@@ -25,7 +25,7 @@
* @version $Revision$ $Date$
*/
public class FunctionEvaluationExceptionTest extends TestCase {
-
+
public void testConstructor(){
FunctionEvaluationException ex = new FunctionEvaluationException(0.0);
assertNull(ex.getCause());
@@ -33,7 +33,7 @@
assertTrue(ex.getMessage().indexOf("0") > 0);
assertEquals(0.0, ex.getArgument()[0], 0);
}
-
+
public void testConstructorArray(){
FunctionEvaluationException ex =
new FunctionEvaluationException(new double[] { 0, 1, 2 });
@@ -44,7 +44,7 @@
assertEquals(1.0, ex.getArgument()[1], 0);
assertEquals(2.0, ex.getArgument()[2], 0);
}
-
+
public void testConstructorPatternArguments(){
String pattern = "evaluation failed for argument = {0}";
Object[] arguments = { Double.valueOf(0.0) };
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/MathConfigurationExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/MathConfigurationExceptionTest.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/MathConfigurationExceptionTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/MathConfigurationExceptionTest.java Sat Sep 5 17:36:48 2009
@@ -5,9 +5,9 @@
* 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.
@@ -32,7 +32,7 @@
assertNull(ex.getMessage());
assertEquals(0, ex.getMessage(Locale.FRENCH).length());
}
-
+
public void testConstructorPatternArguments(){
String pattern = "a {0}x{1} matrix cannot be a rotation matrix";
Object[] arguments = { Integer.valueOf(6), Integer.valueOf(4) };
@@ -46,7 +46,7 @@
assertFalse(pattern.equals(ex.getMessage()));
assertFalse(ex.getMessage().equals(ex.getMessage(Locale.FRENCH)));
}
-
+
public void testConstructorCause(){
String inMsg = "inner message";
Exception cause = new Exception(inMsg);
@@ -69,5 +69,5 @@
assertFalse(pattern.equals(ex.getMessage()));
assertFalse(ex.getMessage().equals(ex.getMessage(Locale.FRENCH)));
}
-
+
}
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/MathExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/MathExceptionTest.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/MathExceptionTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/MathExceptionTest.java Sat Sep 5 17:36:48 2009
@@ -5,9 +5,9 @@
* 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.
@@ -35,7 +35,7 @@
assertNull(ex.getMessage());
assertEquals(0, ex.getMessage(Locale.FRENCH).length());
}
-
+
public void testConstructorPatternArguments(){
String pattern = "a {0}x{1} matrix cannot be a rotation matrix";
Object[] arguments = { Integer.valueOf(6), Integer.valueOf(4) };
@@ -49,7 +49,7 @@
assertFalse(pattern.equals(ex.getMessage()));
assertFalse(ex.getMessage().equals(ex.getMessage(Locale.FRENCH)));
}
-
+
public void testConstructorCause(){
String inMsg = "inner message";
Exception cause = new Exception(inMsg);
@@ -72,7 +72,7 @@
assertFalse(pattern.equals(ex.getMessage()));
assertFalse(ex.getMessage().equals(ex.getMessage(Locale.FRENCH)));
}
-
+
/**
* Tests the printStackTrace() operation.
*/
@@ -86,18 +86,18 @@
ex.printStackTrace(ps);
String stack = baos.toString();
String outerMsg = "org.apache.commons.math.MathException: outer message";
- String innerMsg = "Caused by: " +
+ String innerMsg = "Caused by: " +
"org.apache.commons.math.MathConfigurationException: inner message";
assertTrue(stack.startsWith(outerMsg));
assertTrue(stack.indexOf(innerMsg) > 0);
-
+
PrintWriter pw = new PrintWriter(ps, true);
ex.printStackTrace(pw);
stack = baos.toString();
assertTrue(stack.startsWith(outerMsg));
assertTrue(stack.indexOf(innerMsg) > 0);
}
-
+
/**
* Test serialization
*/
@@ -107,17 +107,17 @@
MathException cause = new MathConfigurationException(inMsg);
MathException ex = new MathException(cause, outMsg);
MathException image = (MathException) TestUtils.serializeAndRecover(ex);
-
+
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
ex.printStackTrace(ps);
String stack = baos.toString();
-
+
ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
PrintStream ps2 = new PrintStream(baos2);
image.printStackTrace(ps2);
String stack2 = baos2.toString();
-
+
// See if JDK supports nested exceptions. If not, stack trace of
// inner exception will not be serialized
boolean jdkSupportsNesting = false;
@@ -127,7 +127,7 @@
} catch (NoSuchMethodException e) {
jdkSupportsNesting = false;
}
-
+
if (jdkSupportsNesting) {
assertEquals(stack, stack2);
} else {
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/MaxIterationsExceededExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/MaxIterationsExceededExceptionTest.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/MaxIterationsExceededExceptionTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/MaxIterationsExceededExceptionTest.java Sat Sep 5 17:36:48 2009
@@ -5,9 +5,9 @@
* 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.
@@ -25,7 +25,7 @@
* @version $Revision$ $Date$
*/
public class MaxIterationsExceededExceptionTest extends TestCase {
-
+
public void testSimpleConstructor(){
MaxIterationsExceededException ex = new MaxIterationsExceededException(1000000);
assertNull(ex.getCause());
@@ -47,5 +47,5 @@
assertEquals(1000000, ex.getMaxIterations());
assertFalse(ex.getMessage().equals(ex.getMessage(Locale.FRENCH)));
}
-
+
}
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/RetryTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/RetryTestCase.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/RetryTestCase.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/RetryTestCase.java Sat Sep 5 17:36:48 2009
@@ -5,9 +5,9 @@
* 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.
@@ -23,8 +23,8 @@
/**
* A TestCase that retries tests when assertions fail.
* <p>
- * If one or more tests throw an AssertionFailedError, all tests are
- * repeated one time.
+ * If one or more tests throw an AssertionFailedError, all tests are
+ * repeated one time.
* <p>
* Errors or exceptions other than AssertionFailedError do not lead to retries.
*
@@ -39,7 +39,7 @@
public RetryTestCase(String arg0) {
super(arg0);
}
-
+
/**
* Override runTest() to catch AssertionFailedError and retry
*/
@@ -50,7 +50,7 @@
} catch (AssertionFailedError err) {
// System.out.println("Retrying " + this.getName());
super.runTest();
- }
+ }
}
}
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/TestUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/TestUtils.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/TestUtils.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/TestUtils.java Sat Sep 5 17:36:48 2009
@@ -5,9 +5,9 @@
* 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.
@@ -63,7 +63,7 @@
Assert.assertEquals(msg, expected, actual, delta);
}
}
-
+
/**
* Verifies that the two arguments are exactly the same, either
* both NaN or infinities of same sign, or identical floating point values.
@@ -71,7 +71,7 @@
public static void assertSame(double expected, double actual) {
assertEquals(expected, actual, 0);
}
-
+
/**
* Verifies that real and imaginary parts of the two complex arguments
* are exactly the same. Also ensures that NaN / infinite components match.
@@ -80,7 +80,7 @@
assertSame(expected.getReal(), actual.getReal());
assertSame(expected.getImaginary(), actual.getImaginary());
}
-
+
/**
* Verifies that real and imaginary parts of the two complex arguments
* differ by at most delta. Also ensures that NaN / infinite components match.
@@ -89,18 +89,18 @@
assertEquals(expected.getReal(), actual.getReal(), delta);
assertEquals(expected.getImaginary(), actual.getImaginary(), delta);
}
-
+
/**
* Verifies that two double arrays have equal entries, up to tolerance
*/
public static void assertEquals(double expected[], double observed[], double tolerance) {
assertEquals("Array comparison failure", expected, observed, tolerance);
}
-
+
/**
* Serializes an object to a bytes array and then recovers the object from the bytes array.
* Returns the deserialized object.
- *
+ *
* @param o object to serialize and recover
* @return the recovered, deserialized object
*/
@@ -121,11 +121,11 @@
return null;
}
}
-
+
/**
* Verifies that serialization preserves equals and hashCode.
* Serializes the object, then recovers it and checks equals and hash code.
- *
+ *
* @param object the object to serialize and recover
*/
public static void checkSerializedEquality(Object object) {
@@ -138,7 +138,7 @@
* Verifies that the relative error in actual vs. expected is less than or
* equal to relativeError. If expected is infinite or NaN, actual must be
* the same (NaN or infinity of the same sign).
- *
+ *
* @param expected expected value
* @param actual observed value
* @param relativeError maximum allowable relative error
@@ -147,12 +147,12 @@
double relativeError) {
assertRelativelyEquals(null, expected, actual, relativeError);
}
-
+
/**
* Verifies that the relative error in actual vs. expected is less than or
* equal to relativeError. If expected is infinite or NaN, actual must be
* the same (NaN or infinity of the same sign).
- *
+ *
* @param msg message to return with failure
* @param expected expected value
* @param actual observed value
@@ -173,10 +173,10 @@
Assert.assertEquals(msg, 0.0, x, relativeError);
}
}
-
+
/**
* Fails iff values does not contain a number within epsilon of z.
- *
+ *
* @param msg message to return with failure
* @param values complex array to search
* @param z value sought
@@ -189,33 +189,33 @@
while (!found && i < values.length) {
try {
assertEquals(values[i], z, epsilon);
- found = true;
+ found = true;
} catch (AssertionFailedError er) {
// no match
}
i++;
}
if (!found) {
- Assert.fail(msg +
+ Assert.fail(msg +
" Unable to find " + ComplexFormat.formatComplex(z));
}
}
-
+
/**
* Fails iff values does not contain a number within epsilon of z.
- *
+ *
* @param values complex array to search
* @param z value sought
* @param epsilon tolerance
*/
public static void assertContains(Complex[] values,
Complex z, double epsilon) {
- assertContains(null, values, z, epsilon);
+ assertContains(null, values, z, epsilon);
}
-
+
/**
* Fails iff values does not contain a number within epsilon of x.
- *
+ *
* @param msg message to return with failure
* @param values double array to search
* @param x value sought
@@ -228,7 +228,7 @@
while (!found && i < values.length) {
try {
assertEquals(values[i], x, epsilon);
- found = true;
+ found = true;
} catch (AssertionFailedError er) {
// no match
}
@@ -238,10 +238,10 @@
Assert.fail(msg + " Unable to find" + x);
}
}
-
+
/**
* Fails iff values does not contain a number within epsilon of x.
- *
+ *
* @param values double array to search
* @param x value sought
* @param epsilon tolerance
@@ -250,19 +250,19 @@
double epsilon) {
assertContains(null, values, x, epsilon);
}
-
- /** verifies that two matrices are close (1-norm) */
+
+ /** verifies that two matrices are close (1-norm) */
public static void assertEquals(String msg, RealMatrix expected, RealMatrix observed,
double tolerance) {
-
+
if (observed == null) {
Assert.fail(msg + "\nObserved is null");
}
-
- if (expected.getColumnDimension() != observed.getColumnDimension() ||
+
+ if (expected.getColumnDimension() != observed.getColumnDimension() ||
expected.getRowDimension() != observed.getRowDimension()) {
StringBuffer messageBuffer = new StringBuffer(msg);
- messageBuffer.append("\nObserved has incorrect dimensions.");
+ messageBuffer.append("\nObserved has incorrect dimensions.");
messageBuffer.append("\nobserved is " + observed.getRowDimension() +
" x " + observed.getColumnDimension());
messageBuffer.append("\nexpected " + expected.getRowDimension() +
@@ -279,19 +279,19 @@
Assert.fail(messageBuffer.toString());
}
}
-
- /** verifies that two matrices are equal */
+
+ /** verifies that two matrices are equal */
public static void assertEquals(FieldMatrix<? extends FieldElement<?>> expected,
FieldMatrix<? extends FieldElement<?>> observed) {
-
+
if (observed == null) {
Assert.fail("Observed is null");
}
-
- if (expected.getColumnDimension() != observed.getColumnDimension() ||
+
+ if (expected.getColumnDimension() != observed.getColumnDimension() ||
expected.getRowDimension() != observed.getRowDimension()) {
StringBuffer messageBuffer = new StringBuffer();
- messageBuffer.append("Observed has incorrect dimensions.");
+ messageBuffer.append("Observed has incorrect dimensions.");
messageBuffer.append("\nobserved is " + observed.getRowDimension() +
" x " + observed.getColumnDimension());
messageBuffer.append("\nexpected " + expected.getRowDimension() +
@@ -307,7 +307,7 @@
}
}
}
-
+
/** verifies that two arrays are close (sup norm) */
public static void assertEquals(String msg, double[] expected, double[] observed,
double tolerance) {
@@ -332,14 +332,14 @@
out.append(" expected = ");
out.append(expected[i]);
out.append(" observed = ");
- out.append(observed[i]);
+ out.append(observed[i]);
}
}
if (failure) {
Assert.fail(out.toString());
}
}
-
+
/** verifies that two arrays are equal */
public static <T extends FieldElement<T>> void assertEquals(T[] m, T[] n) {
if (m.length != n.length) {
@@ -349,5 +349,5 @@
Assert.assertEquals(m[i],n[i]);
}
}
-
+
}
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/MonitoredFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/MonitoredFunction.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/MonitoredFunction.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/MonitoredFunction.java Sat Sep 5 17:36:48 2009
@@ -5,9 +5,9 @@
* 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.
@@ -21,7 +21,7 @@
/**
* Wrapper class for counting functions calls.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date$
*/
public class MonitoredFunction implements UnivariateRealFunction {
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/QuinticFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/QuinticFunction.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/QuinticFunction.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/QuinticFunction.java Sat Sep 5 17:36:48 2009
@@ -5,9 +5,9 @@
* 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.
@@ -21,7 +21,7 @@
/**
* Auxillary class for testing solvers.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date$
*/
public class QuinticFunction implements DifferentiableUnivariateRealFunction {
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/SinFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/SinFunction.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/SinFunction.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/SinFunction.java Sat Sep 5 17:36:48 2009
@@ -5,9 +5,9 @@
* 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.
@@ -25,7 +25,7 @@
* has an inflection point there (second order derivative is zero),
* which means linear approximation (Regula Falsi) will converge
* quadratically.
- *
+ *
* @version $Revision$ $Date$
*/
public class SinFunction implements DifferentiableUnivariateRealFunction {
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/integration/RombergIntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/integration/RombergIntegratorTest.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/integration/RombergIntegratorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/integration/RombergIntegratorTest.java Sat Sep 5 17:36:48 2009
@@ -29,8 +29,8 @@
* Romberg algorithm is very fast for good behavior integrand. Test runs
* show that for a default relative accuracy of 1E-6, it generally takes
* takes less than 5 iterations for the integral to converge.
- *
- * @version $Revision$ $Date$
+ *
+ * @version $Revision$ $Date$
*/
public final class RombergIntegratorTest extends TestCase {
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/integration/SimpsonIntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/integration/SimpsonIntegratorTest.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/integration/SimpsonIntegratorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/integration/SimpsonIntegratorTest.java Sat Sep 5 17:36:48 2009
@@ -28,8 +28,8 @@
* <p>
* Test runs show that for a default relative accuracy of 1E-6, it
* generally takes 5 to 10 iterations for the integral to converge.
- *
- * @version $Revision$ $Date$
+ *
+ * @version $Revision$ $Date$
*/
public final class SimpsonIntegratorTest extends TestCase {
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/integration/TrapezoidIntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/integration/TrapezoidIntegratorTest.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/integration/TrapezoidIntegratorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/integration/TrapezoidIntegratorTest.java Sat Sep 5 17:36:48 2009
@@ -28,8 +28,8 @@
* <p>
* Test runs show that for a default relative accuracy of 1E-6, it
* generally takes 10 to 15 iterations for the integral to converge.
- *
- * @version $Revision$ $Date$
+ *
+ * @version $Revision$ $Date$
*/
public final class TrapezoidIntegratorTest extends TestCase {
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/interpolation/DividedDifferenceInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/interpolation/DividedDifferenceInterpolatorTest.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/interpolation/DividedDifferenceInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/interpolation/DividedDifferenceInterpolatorTest.java Sat Sep 5 17:36:48 2009
@@ -34,8 +34,8 @@
* Since zeta is unknown, f^(n)(zeta) cannot be calculated. But we can bound
* it and use the absolute value upper bound for estimates. For reference,
* see <b>Introduction to Numerical Analysis</b>, ISBN 038795452X, chapter 2.
- *
- * @version $Revision$ $Date$
+ *
+ * @version $Revision$ $Date$
*/
public final class DividedDifferenceInterpolatorTest extends TestCase {
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/interpolation/NevilleInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/interpolation/NevilleInterpolatorTest.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/interpolation/NevilleInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/interpolation/NevilleInterpolatorTest.java Sat Sep 5 17:36:48 2009
@@ -34,8 +34,8 @@
* Since zeta is unknown, f^(n)(zeta) cannot be calculated. But we can bound
* it and use the absolute value upper bound for estimates. For reference,
* see <b>Introduction to Numerical Analysis</b>, ISBN 038795452X, chapter 2.
- *
- * @version $Revision$ $Date$
+ *
+ * @version $Revision$ $Date$
*/
public final class NevilleInterpolatorTest extends TestCase {