commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r811685 [5/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/anal...
Date Sat, 05 Sep 2009 17:37:05 GMT
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/BigFractionFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/BigFractionFormat.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/BigFractionFormat.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/BigFractionFormat.java Sat Sep  5 17:36:48 2009
@@ -38,13 +38,13 @@
  * @version $Revision$ $Date$
  */
 public class BigFractionFormat extends AbstractFormat implements Serializable {
-    
+
     /** Serializable version identifier */
     private static final long serialVersionUID = -2932167925527338976L;
 
     /**
      * Create an improper formatting instance with the default number format
-     * for the numerator and denominator.  
+     * for the numerator and denominator.
      */
     public BigFractionFormat() {
     }
@@ -71,7 +71,7 @@
 
     /**
      * Get the set of locales for which complex formats are available.  This
-     * is the same set as the {@link NumberFormat} set. 
+     * is the same set as the {@link NumberFormat} set.
      * @return available complex format locales.
      */
     public static Locale[] getAvailableLocales() {
@@ -88,7 +88,7 @@
     public static String formatBigFraction(final BigFraction f) {
         return getImproperInstance().format(f);
     }
-    
+
     /**
      * Returns the default complex format for the current locale.
      * @return the default complex format.
@@ -96,7 +96,7 @@
     public static BigFractionFormat getImproperInstance() {
         return getImproperInstance(Locale.getDefault());
     }
-    
+
     /**
      * Returns the default complex format for the given locale.
      * @param locale the specific locale used by the format.
@@ -105,7 +105,7 @@
     public static BigFractionFormat getImproperInstance(final Locale locale) {
         return new BigFractionFormat(getDefaultNumberFormat(locale));
     }
-    
+
     /**
      * Returns the default complex format for the current locale.
      * @return the default complex format.
@@ -113,7 +113,7 @@
     public static BigFractionFormat getProperInstance() {
         return getProperInstance(Locale.getDefault());
     }
-    
+
     /**
      * Returns the default complex format for the given locale.
      * @param locale the specific locale used by the format.
@@ -122,7 +122,7 @@
     public static BigFractionFormat getProperInstance(final Locale locale) {
         return new ProperBigFractionFormat(getDefaultNumberFormat(locale));
     }
-    
+
     /**
      * Formats a {@link BigFraction} object to produce a string.  The BigFraction is
      * output in improper format.
@@ -135,17 +135,17 @@
      */
     public StringBuffer format(final BigFraction BigFraction,
                                final StringBuffer toAppendTo, final FieldPosition pos) {
-        
+
         pos.setBeginIndex(0);
         pos.setEndIndex(0);
 
         getNumeratorFormat().format(BigFraction.getNumerator(), toAppendTo, pos);
         toAppendTo.append(" / ");
         getDenominatorFormat().format(BigFraction.getDenominator(), toAppendTo, pos);
-        
+
         return toAppendTo;
     }
-    
+
     /**
      * Formats an object and appends the result to a StringBuffer.
      * <code>obj</code> must be either a  {@link BigFraction} object or a
@@ -172,11 +172,11 @@
         } else if (obj instanceof Number) {
             ret = format(new BigFraction(((Number) obj).doubleValue()),
                          toAppendTo, pos);
-        } else { 
+        } else {
             throw MathRuntimeException.createIllegalArgumentException(
                 "cannot format given object as a fraction number");
         }
-        
+
         return ret;
     }
 
@@ -198,10 +198,10 @@
         }
         return result;
     }
-    
+
     /**
      * Parses a string to produce a {@link BigFraction} object.
-     * This method expects the string to be formatted as an improper BigFraction.  
+     * This method expects the string to be formatted as an improper BigFraction.
      * @param source the string to parse
      * @param pos input/ouput parsing parameter.
      * @return the parsed {@link BigFraction} object.

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/Fraction.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/Fraction.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/Fraction.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/Fraction.java Sat Sep  5 17:36:48 2009
@@ -27,7 +27,7 @@
  * Representation of a rational number.
  *
  * implements Serializable since 2.0
- * 
+ *
  * @since 1.1
  * @version $Revision$ $Date$
  */
@@ -82,7 +82,7 @@
 
     /** The denominator. */
     private final int denominator;
-    
+
     /** The numerator. */
     private final int numerator;
 
@@ -206,7 +206,7 @@
             if ((p2 > overflow) || (q2 > overflow)) {
                 throw new FractionConversionException(value, p2, q2);
             }
-            
+
             double convergent = (double)p2 / (double)q2;
             if (n < maxIterations && Math.abs(convergent - value) > epsilon && q2 < maxDenominator) {
                 p0 = p1;
@@ -223,7 +223,7 @@
         if (n >= maxIterations) {
             throw new FractionConversionException(value, maxIterations);
         }
-        
+
         if (q2 < maxDenominator) {
             this.numerator = (int) p2;
             this.denominator = (int) q2;
@@ -233,16 +233,16 @@
         }
 
     }
-    
+
     /**
-     * Create a fraction from an int. 
+     * Create a fraction from an int.
      * The fraction is num / 1.
      * @param num the numerator.
      */
     public Fraction(int num) {
         this(num, 1);
     }
-    
+
     /**
      * Create a fraction given the numerator and denominator.  The fraction is
      * reduced to lowest terms.
@@ -269,7 +269,7 @@
             num /= d;
             den /= d;
         }
-        
+
         // move sign to numerator.
         if (den < 0) {
             num = -num;
@@ -278,7 +278,7 @@
         this.numerator   = num;
         this.denominator = den;
     }
-    
+
     /**
      * Returns the absolute value of this fraction.
      * @return the absolute value.
@@ -290,9 +290,9 @@
         } else {
             ret = negate();
         }
-        return ret;        
+        return ret;
     }
-    
+
     /**
      * Compares this object to another based on size.
      * @param object the object to compare to
@@ -314,7 +314,7 @@
     public double doubleValue() {
         return (double)numerator / (double)denominator;
     }
-    
+
     /**
      * Test for the equality of two fractions.  If the lowest term
      * numerator and denominators are the same for both fractions, the two
@@ -327,8 +327,8 @@
     @Override
     public boolean equals(Object other) {
         boolean ret;
-        
-        if (this == other) { 
+
+        if (this == other) {
             ret = true;
         } else if (other == null) {
             ret = false;
@@ -344,10 +344,10 @@
                 ret = false;
             }
         }
-        
+
         return ret;
     }
-    
+
     /**
      * Gets the fraction as a <tt>float</tt>. This calculates the fraction as
      * the numerator divided by denominator.
@@ -357,7 +357,7 @@
     public float floatValue() {
         return (float)doubleValue();
     }
-    
+
     /**
      * Access the denominator.
      * @return the denominator.
@@ -365,7 +365,7 @@
     public int getDenominator() {
         return denominator;
     }
-    
+
     /**
      * Access the numerator.
      * @return the numerator.
@@ -373,7 +373,7 @@
     public int getNumerator() {
         return numerator;
     }
-    
+
     /**
      * Gets a hashCode for the fraction.
      * @return a hash code value for this object
@@ -382,7 +382,7 @@
     public int hashCode() {
         return 37 * (37 * 17 + getNumerator()) + getDenominator();
     }
-    
+
     /**
      * Gets the fraction as an <tt>int</tt>. This returns the whole number part
      * of the fraction.
@@ -392,7 +392,7 @@
     public int intValue() {
         return (int)doubleValue();
     }
-    
+
     /**
      * Gets the fraction as a <tt>long</tt>. This returns the whole number part
      * of the fraction.
@@ -402,7 +402,7 @@
     public long longValue() {
         return (long)doubleValue();
     }
-    
+
     /**
      * Return the additive inverse of this fraction.
      * @return the negation of this fraction.
@@ -422,7 +422,7 @@
     public Fraction reciprocal() {
         return new Fraction(denominator, numerator);
     }
-    
+
     /**
      * <p>Adds the value of this fraction to another, returning the result in reduced form.
      * The algorithm follows Knuth, 4.5.1.</p>
@@ -447,7 +447,7 @@
     }
 
     /**
-     * <p>Subtracts the value of another fraction from the value of this one, 
+     * <p>Subtracts the value of another fraction from the value of this one,
      * returning the result in reduced form.</p>
      *
      * @param fraction  the fraction to subtract, must not be <code>null</code>
@@ -469,9 +469,9 @@
         return new Fraction(numerator - i * denominator, denominator);
     }
 
-    /** 
+    /**
      * Implement add and subtract using algorithm described in Knuth 4.5.1.
-     * 
+     *
      * @param fraction the fraction to subtract, must not be <code>null</code>
      * @param isAdd true to add, false to subtract
      * @return a <code>Fraction</code> instance with the resulting values
@@ -489,7 +489,7 @@
         }
         if (fraction.numerator == 0) {
             return this;
-        }     
+        }
         // if denominators are randomly distributed, d1 will be 1 about 61%
         // of the time.
         int d1 = MathUtils.gcd(denominator, fraction.denominator);
@@ -498,7 +498,7 @@
             int uvp = MathUtils.mulAndCheck(numerator, fraction.denominator);
             int upv = MathUtils.mulAndCheck(fraction.numerator, denominator);
             return new Fraction
-                (isAdd ? MathUtils.addAndCheck(uvp, upv) : 
+                (isAdd ? MathUtils.addAndCheck(uvp, upv) :
                  MathUtils.subAndCheck(uvp, upv),
                  MathUtils.mulAndCheck(denominator, fraction.denominator));
         }
@@ -521,13 +521,13 @@
             throw MathRuntimeException.createArithmeticException("overflow, numerator too large after multiply: {0}",
                                                                  w);
         }
-        return new Fraction (w.intValue(), 
-                MathUtils.mulAndCheck(denominator/d1, 
+        return new Fraction (w.intValue(),
+                MathUtils.mulAndCheck(denominator/d1,
                         fraction.denominator/d2));
     }
 
     /**
-     * <p>Multiplies the value of this fraction by another, returning the 
+     * <p>Multiplies the value of this fraction by another, returning the
      * result in reduced form.</p>
      *
      * @param fraction  the fraction to multiply by, must not be <code>null</code>
@@ -638,7 +638,7 @@
      * Returns the <code>String</code> representing this fraction, ie
      * "num / dem" or just "num" if the denominator is one.
      * </p>
-     * 
+     *
      * @return a string representation of the fraction.
      * @see java.lang.Object#toString()
      */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionConversionException.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionConversionException.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionConversionException.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionConversionException.java Sat Sep  5 17:36:48 2009
@@ -45,7 +45,7 @@
      * Constructs an exception with specified formatted detail message.
      * Message formatting is delegated to {@link java.text.MessageFormat}.
      * @param value double value to convert
-     * @param p current numerator 
+     * @param p current numerator
      * @param q current denominator
      */
     public FractionConversionException(double value, long p, long q) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionField.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionField.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionField.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionField.java Sat Sep  5 17:36:48 2009
@@ -70,7 +70,7 @@
      */
     private Object readResolve() {
         // return the singleton instance
-        return LazyHolder.INSTANCE; 
+        return LazyHolder.INSTANCE;
     }
 
 }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionFormat.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionFormat.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionFormat.java Sat Sep  5 17:36:48 2009
@@ -35,13 +35,13 @@
  * @version $Revision$ $Date$
  */
 public class FractionFormat extends AbstractFormat {
-    
+
     /** Serializable version identifier */
     private static final long serialVersionUID = 3008655719530972611L;
 
     /**
      * Create an improper formatting instance with the default number format
-     * for the numerator and denominator.  
+     * for the numerator and denominator.
      */
     public FractionFormat() {
     }
@@ -68,7 +68,7 @@
 
     /**
      * Get the set of locales for which complex formats are available.  This
-     * is the same set as the {@link NumberFormat} set. 
+     * is the same set as the {@link NumberFormat} set.
      * @return available complex format locales.
      */
     public static Locale[] getAvailableLocales() {
@@ -85,7 +85,7 @@
     public static String formatFraction(Fraction f) {
         return getImproperInstance().format(f);
     }
-    
+
     /**
      * Returns the default complex format for the current locale.
      * @return the default complex format.
@@ -93,7 +93,7 @@
     public static FractionFormat getImproperInstance() {
         return getImproperInstance(Locale.getDefault());
     }
-    
+
     /**
      * Returns the default complex format for the given locale.
      * @param locale the specific locale used by the format.
@@ -102,7 +102,7 @@
     public static FractionFormat getImproperInstance(final Locale locale) {
         return new FractionFormat(getDefaultNumberFormat(locale));
     }
-    
+
     /**
      * Returns the default complex format for the current locale.
      * @return the default complex format.
@@ -110,7 +110,7 @@
     public static FractionFormat getProperInstance() {
         return getProperInstance(Locale.getDefault());
     }
-    
+
     /**
      * Returns the default complex format for the given locale.
      * @param locale the specific locale used by the format.
@@ -119,17 +119,17 @@
     public static FractionFormat getProperInstance(final Locale locale) {
         return new ProperFractionFormat(getDefaultNumberFormat(locale));
     }
-    
+
     /**
      * Create a default number format.  The default number format is based on
      * {@link NumberFormat#getNumberInstance(java.util.Locale)} with the only
-     * customizing is the maximum number of fraction digits, which is set to 0.  
+     * customizing is the maximum number of fraction digits, which is set to 0.
      * @return the default number format.
      */
     protected static NumberFormat getDefaultNumberFormat() {
         return getDefaultNumberFormat(Locale.getDefault());
     }
-    
+
     /**
      * Formats a {@link Fraction} object to produce a string.  The fraction is
      * output in improper format.
@@ -142,7 +142,7 @@
      */
     public StringBuffer format(final Fraction fraction,
                                final StringBuffer toAppendTo, final FieldPosition pos) {
-        
+
         pos.setBeginIndex(0);
         pos.setEndIndex(0);
 
@@ -150,12 +150,12 @@
         toAppendTo.append(" / ");
         getDenominatorFormat().format(fraction.getDenominator(), toAppendTo,
             pos);
-        
+
         return toAppendTo;
     }
-    
+
     /**
-     * Formats an object and appends the result to a StringBuffer. <code>obj</code> must be either a 
+     * Formats an object and appends the result to a StringBuffer. <code>obj</code> must be either a
      * {@link Fraction} object or a {@link Number} object.  Any other type of
      * object will result in an {@link IllegalArgumentException} being thrown.
      *
@@ -171,7 +171,7 @@
     public StringBuffer format(final Object obj,
                                final StringBuffer toAppendTo, final FieldPosition pos) {
         StringBuffer ret = null;
-        
+
         if (obj instanceof Fraction) {
             ret = format((Fraction) obj, toAppendTo, pos);
         } else if (obj instanceof Number) {
@@ -183,11 +183,11 @@
                     "cannot convert given object to a fraction number: {0}",
                     ex.getLocalizedMessage());
             }
-        } else { 
+        } else {
             throw MathRuntimeException.createIllegalArgumentException(
                 "cannot format given object as a fraction number");
         }
-        
+
         return ret;
     }
 
@@ -209,10 +209,10 @@
         }
         return result;
     }
-    
+
     /**
      * Parses a string to produce a {@link Fraction} object.  This method
-     * expects the string to be formatted as an improper fraction.  
+     * expects the string to be formatted as an improper fraction.
      * @param source the string to parse
      * @param pos input/ouput parsing parameter.
      * @return the parsed {@link Fraction} object.
@@ -269,5 +269,5 @@
 
         return new Fraction(num.intValue(), den.intValue());
     }
-    
+
 }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/ProperBigFractionFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/ProperBigFractionFormat.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/ProperBigFractionFormat.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/ProperBigFractionFormat.java Sat Sep  5 17:36:48 2009
@@ -30,26 +30,26 @@
  * Minus signs are only allowed in the whole number part - i.e.,
  * "-3 1/2" is legitimate and denotes -7/2, but "-3 -1/2" is invalid and
  * will result in a <code>ParseException</code>.</p>
- * 
+ *
  * @since 1.1
  * @version $Revision$ $Date$
  */
 public class ProperBigFractionFormat extends BigFractionFormat {
-    
+
     /** Serializable version identifier */
     private static final long serialVersionUID = -6337346779577272307L;
-    
+
     /** The format used for the whole number. */
     private NumberFormat wholeFormat;
 
     /**
      * Create a proper formatting instance with the default number format for
-     * the whole, numerator, and denominator.  
+     * the whole, numerator, and denominator.
      */
     public ProperBigFractionFormat() {
         this(getDefaultNumberFormat());
     }
-    
+
     /**
      * Create a proper formatting instance with a custom number format for the
      * whole, numerator, and denominator.
@@ -59,7 +59,7 @@
     public ProperBigFractionFormat(final NumberFormat format) {
         this(format, (NumberFormat)format.clone(), (NumberFormat)format.clone());
     }
-    
+
     /**
      * Create a proper formatting instance with a custom number format for each
      * of the whole, numerator, and denominator.
@@ -73,7 +73,7 @@
         super(numeratorFormat, denominatorFormat);
         setWholeFormat(wholeFormat);
     }
-    
+
     /**
      * Formats a {@link BigFraction} object to produce a string.  The BigFraction
      * is output in proper format.
@@ -87,7 +87,7 @@
     @Override
     public StringBuffer format(final BigFraction fraction,
                                final StringBuffer toAppendTo, final FieldPosition pos) {
-        
+
         pos.setBeginIndex(0);
         pos.setEndIndex(0);
 
@@ -95,7 +95,7 @@
         BigInteger den = fraction.getDenominator();
         BigInteger whole = num.divide(den);
         num = num.remainder(den);
-        
+
         if (!BigInteger.ZERO.equals(whole)) {
             getWholeFormat().format(whole, toAppendTo, pos);
             toAppendTo.append(' ');
@@ -106,7 +106,7 @@
         getNumeratorFormat().format(num, toAppendTo, pos);
         toAppendTo.append(" / ");
         getDenominatorFormat().format(den, toAppendTo, pos);
-        
+
         return toAppendTo;
     }
 
@@ -117,7 +117,7 @@
     public NumberFormat getWholeFormat() {
         return wholeFormat;
     }
-    
+
     /**
      * Parses a string to produce a {@link BigFraction} object.  This method
      * expects the string to be formatted as a proper BigFraction.
@@ -125,7 +125,7 @@
      * Minus signs are only allowed in the whole number part - i.e.,
      * "-3 1/2" is legitimate and denotes -7/2, but "-3 -1/2" is invalid and
      * will result in a <code>ParseException</code>.</p>
-     * 
+     *
      * @param source the string to parse
      * @param pos input/ouput parsing parameter.
      * @return the parsed {@link BigFraction} object.
@@ -137,7 +137,7 @@
         if (ret != null) {
             return ret;
         }
-        
+
         final int initialIndex = pos.getIndex();
 
         // parse whitespace
@@ -155,7 +155,7 @@
 
         // parse whitespace
         parseAndIgnoreWhitespace(source, pos);
-        
+
         // parse numerator
         BigInteger num = parseNextBigInteger(source, pos);
         if (num == null) {
@@ -165,7 +165,7 @@
             pos.setIndex(initialIndex);
             return null;
         }
-        
+
         if (num.compareTo(BigInteger.ZERO) < 0) {
             // minus signs should be leading, invalid expression
             pos.setIndex(initialIndex);
@@ -204,7 +204,7 @@
             pos.setIndex(initialIndex);
             return null;
         }
-        
+
         if (den.compareTo(BigInteger.ZERO) < 0) {
             // minus signs must be leading, invalid
             pos.setIndex(initialIndex);
@@ -223,7 +223,7 @@
         return new BigFraction(num, den);
 
     }
-    
+
     /**
      * Modify the whole format.
      * @param format The new whole format value.

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/ProperFractionFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/ProperFractionFormat.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/ProperFractionFormat.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/ProperFractionFormat.java Sat Sep  5 17:36:48 2009
@@ -30,12 +30,12 @@
  * Minus signs are only allowed in the whole number part - i.e.,
  * "-3 1/2" is legitimate and denotes -7/2, but "-3 -1/2" is invalid and
  * will result in a <code>ParseException</code>.</p>
- * 
+ *
  * @since 1.1
  * @version $Revision$ $Date$
  */
 public class ProperFractionFormat extends FractionFormat {
-    
+
     /** Serializable version identifier */
     private static final long serialVersionUID = 760934726031766749L;
 
@@ -44,12 +44,12 @@
 
     /**
      * Create a proper formatting instance with the default number format for
-     * the whole, numerator, and denominator.  
+     * the whole, numerator, and denominator.
      */
     public ProperFractionFormat() {
         this(getDefaultNumberFormat());
     }
-    
+
     /**
      * Create a proper formatting instance with a custom number format for the
      * whole, numerator, and denominator.
@@ -59,7 +59,7 @@
     public ProperFractionFormat(NumberFormat format) {
         this(format, (NumberFormat)format.clone(), (NumberFormat)format.clone());
     }
-    
+
     /**
      * Create a proper formatting instance with a custom number format for each
      * of the whole, numerator, and denominator.
@@ -74,7 +74,7 @@
         super(numeratorFormat, denominatorFormat);
         setWholeFormat(wholeFormat);
     }
-    
+
     /**
      * Formats a {@link Fraction} object to produce a string.  The fraction
      * is output in proper format.
@@ -88,7 +88,7 @@
     @Override
     public StringBuffer format(Fraction fraction, StringBuffer toAppendTo,
             FieldPosition pos) {
-        
+
         pos.setBeginIndex(0);
         pos.setEndIndex(0);
 
@@ -96,7 +96,7 @@
         int den = fraction.getDenominator();
         int whole = num / den;
         num = num % den;
-        
+
         if (whole != 0) {
             getWholeFormat().format(whole, toAppendTo, pos);
             toAppendTo.append(' ');
@@ -106,7 +106,7 @@
         toAppendTo.append(" / ");
         getDenominatorFormat().format(den, toAppendTo,
             pos);
-        
+
         return toAppendTo;
     }
 
@@ -117,7 +117,7 @@
     public NumberFormat getWholeFormat() {
         return wholeFormat;
     }
-    
+
     /**
      * Parses a string to produce a {@link Fraction} object.  This method
      * expects the string to be formatted as a proper fraction.
@@ -125,7 +125,7 @@
      * Minus signs are only allowed in the whole number part - i.e.,
      * "-3 1/2" is legitimate and denotes -7/2, but "-3 -1/2" is invalid and
      * will result in a <code>ParseException</code>.</p>
-     * 
+     *
      * @param source the string to parse
      * @param pos input/ouput parsing parameter.
      * @return the parsed {@link Fraction} object.
@@ -137,7 +137,7 @@
         if (ret != null) {
             return ret;
         }
-        
+
         int initialIndex = pos.getIndex();
 
         // parse whitespace
@@ -155,7 +155,7 @@
 
         // parse whitespace
         parseAndIgnoreWhitespace(source, pos);
-        
+
         // parse numerator
         Number num = getNumeratorFormat().parse(source, pos);
         if (num == null) {
@@ -165,7 +165,7 @@
             pos.setIndex(initialIndex);
             return null;
         }
-        
+
         if (num.intValue() < 0) {
             // minus signs should be leading, invalid expression
             pos.setIndex(initialIndex);
@@ -204,7 +204,7 @@
             pos.setIndex(initialIndex);
             return null;
         }
-        
+
         if (den.intValue() < 0) {
             // minus signs must be leading, invalid
             pos.setIndex(initialIndex);
@@ -216,7 +216,7 @@
         int d = den.intValue();
         return new Fraction(((Math.abs(w) * d) + n) * MathUtils.sign(w), d);
     }
-    
+
     /**
      * Modify the whole format.
      * @param format The new whole format value.

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/package.html
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/package.html?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/package.html (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/package.html Sat Sep  5 17:36:48 2009
@@ -6,9 +6,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.

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/AbstractListChromosome.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/AbstractListChromosome.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/AbstractListChromosome.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/AbstractListChromosome.java Sat Sep  5 17:36:48 2009
@@ -23,16 +23,16 @@
 
 /**
  * Chromosome represented by an immutable list of a fixed length.
- * 
+ *
  * @param <T> type of the representation list
  * @version $Revision$ $Date$
  * @since 2.0
  */
 public abstract class AbstractListChromosome<T> extends Chromosome {
-    
+
     /** List representing the chromosome */
     private final List<T> representation;
-    
+
     /**
      * Constructor.
      * @param representation inner representation of the chromosome
@@ -45,7 +45,7 @@
         }
         this.representation = Collections.unmodifiableList(new ArrayList<T> (representation));
     }
-    
+
     /**
      * Constructor.
      * @param representation inner representation of the chromosome
@@ -55,7 +55,7 @@
     }
 
     /**
-     * 
+     *
      * Asserts that <code>representation</code> can represent a valid chromosome.
      * @param chromosomeRepresentation representation of the chromosome
      * @throws InvalidRepresentationException iff the <code>representation</code> can not represent
@@ -84,16 +84,16 @@
      * given <code>arrayRepresentation</code>. This is needed in crossover and
      * mutation operators, where we need a new instance of the same class, but
      * with different array representation.
-     * 
+     *
      * Usually, this method just calls a constructor of the class.
-     * 
+     *
      * @param chromosomeRepresentation
      *            the inner array representation of the new chromosome.
      * @return new instance extended from FixedLengthChromosome with the given
      *         arrayRepresentation
      */
     public abstract AbstractListChromosome<T> newFixedLengthChromosome(final List<T> chromosomeRepresentation);
-    
+
     /**
      * {@inheritDoc}
      */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/BinaryChromosome.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/BinaryChromosome.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/BinaryChromosome.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/BinaryChromosome.java Sat Sep  5 17:36:48 2009
@@ -22,12 +22,12 @@
 
 /**
  * Chromosome represented by a vector of 0s and 1s.
- * 
+ *
  * @version $Revision$ $Date$
  * @since 2.0
  */
 public abstract class BinaryChromosome extends AbstractListChromosome<Integer> {
-    
+
     /**
      * Constructor.
      * @param representation list of {0,1} values representing the chromosome
@@ -35,7 +35,7 @@
     public BinaryChromosome(List<Integer> representation) {
         super(representation);
     }
-    
+
     /**
      * Constructor.
      * @param representation array of {0,1} values representing the chromosome
@@ -43,7 +43,7 @@
     public BinaryChromosome(Integer[] representation) {
         super(representation);
     }
-     
+
     /**
      * {@inheritDoc}
      */
@@ -68,7 +68,7 @@
         }
         return rList;
     }
-    
+
     /**
      * {@inheritDoc}
      */
@@ -81,7 +81,7 @@
         // size check
         if (getLength() != anotherBc.getLength())
             return false;
-        
+
         for (int i=0; i< getRepresentation().size(); i++) {
             if (!(getRepresentation().get(i).equals(anotherBc.getRepresentation().get(i))))
                 return false;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/BinaryMutation.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/BinaryMutation.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/BinaryMutation.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/BinaryMutation.java Sat Sep  5 17:36:48 2009
@@ -34,17 +34,17 @@
      */
     public Chromosome mutate(Chromosome original) {
         if (!(original instanceof BinaryChromosome)) {
-            throw new IllegalArgumentException("Binary mutation works on BinaryChromosome only."); 
+            throw new IllegalArgumentException("Binary mutation works on BinaryChromosome only.");
         }
-        
+
         BinaryChromosome origChrom = (BinaryChromosome) original;
         List<Integer> newRepr = new ArrayList<Integer>(origChrom.getRepresentation());
-        
+
         // randomly select a gene
         int geneIndex = GeneticAlgorithm.getRandomGenerator().nextInt(origChrom.getLength());
         // and change it
         newRepr.set(geneIndex, origChrom.getRepresentation().get(geneIndex) == 0 ? 1 : 0);
-        
+
         Chromosome newChrom = origChrom.newFixedLengthChromosome(newRepr);
         return newChrom;
     }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/Chromosome.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/Chromosome.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/Chromosome.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/Chromosome.java Sat Sep  5 17:36:48 2009
@@ -18,27 +18,27 @@
 
 /**
  * Individual in a population. Chromosomes are compared based on their fitness.
- * 
+ *
  * The chromosomes are IMMUTABLE, and so their fitness is also immutable and
  * therefore it can be cached.
- * 
+ *
  * @since 2.0
- * @version $Revision:$ $Date:$
+ * @version $Revision$ $Date$
  */
 public abstract class Chromosome implements Comparable<Chromosome>,Fitness {
-    
+
     /**
      * Cached value of the fitness of this chromosome.
      */
     private double fitness = Double.MIN_VALUE;
-    
+
     /**
      * Access the fitness of this chromosome. The bigger the fitness, the better
      * the chromosome.
-     * 
+     *
      * Computation of fitness is usually very time-consuming task, therefore the
      * fitness is cached.
-     * 
+     *
      * @return the fitness.
      */
     public double getFitness() {
@@ -48,11 +48,11 @@
         }
         return this.fitness;
     }
-        
+
     /**
      * Compares two chromosomes based on their fitness. The bigger the fitness,
      * the better the chromosome.
-     * 
+     *
      * @param another another chromosome to compare
      * @return
      * <ul>
@@ -68,7 +68,7 @@
     /**
      * Returns <code>true<code> iff <code>another</code> has the same
      * representation and therefore the same fitness. By default, it returns
-     * false -- override it in your implementation if you need it. 
+     * false -- override it in your implementation if you need it.
      * @param another chromosome to compare
      * @return true if <code>another</code> is equivalent to this chromosome
      */
@@ -80,7 +80,7 @@
      * Searches the <code>population</code> for another chromosome with the same
      * representation. If such chromosome is found, it is returned, if no such
      * chromosome exists, returns <code>null</code>.
-     * 
+     *
      * @param population
      *            Population to search
      * @return Chromosome with the same representation, or <code>null</code> if
@@ -97,7 +97,7 @@
     /**
      * Searches the population for a chromosome representing the same solution,
      * and if it finds one, updates the fitness to its value.
-     * 
+     *
      * @param population
      *            Population to search
      */
@@ -107,5 +107,5 @@
             fitness = sameChromosome.getFitness();
         }
     }
-    
+
 }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/ChromosomePair.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/ChromosomePair.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/ChromosomePair.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/ChromosomePair.java Sat Sep  5 17:36:48 2009
@@ -19,7 +19,7 @@
 /**
  * A pair of {@link Chromosome} objects.
  * @since 2.0
- * 
+ *
  * @version $Revision$ $Date$
  */
 public class ChromosomePair {
@@ -31,7 +31,7 @@
 
     /**
      * Create a chromosome pair.
-     * 
+     *
      * @param c1 the first chromosome.
      * @param c2 the second chromosome.
      */
@@ -43,7 +43,7 @@
 
     /**
      * Access the first chromosome.
-     * 
+     *
      * @return the first chromosome.
      */
     public Chromosome getFirst() {
@@ -52,18 +52,18 @@
 
     /**
      * Access the second chromosome.
-     * 
+     *
      * @return the second chromosome.
      */
     public Chromosome getSecond() {
         return second;
     }
-    
+
     /**
      * {@inheritDoc}
      */
     @Override
-    public String toString() {        
+    public String toString() {
         return String.format("(%s,%s)", getFirst(), getSecond());
     }
 }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/CrossoverPolicy.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/CrossoverPolicy.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/CrossoverPolicy.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/CrossoverPolicy.java Sat Sep  5 17:36:48 2009
@@ -19,14 +19,14 @@
 /**
  * Policy used to create a pair of new chromosomes by performing a crossover
  * operation on a source pair of chromosomes.
- * 
+ *
  * @since 2.0
  * @version $Revision$ $Date$
  */
 public interface CrossoverPolicy {
     /**
      * Perform a crossover operation on the given chromosomes.
-     * 
+     *
      * @param first the first chromosome.
      * @param second the second chromosome.
      * @return the pair of new chromosomes that resulted from the crossover.

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/ElitisticListPopulation.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/ElitisticListPopulation.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/ElitisticListPopulation.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/ElitisticListPopulation.java Sat Sep  5 17:36:48 2009
@@ -22,18 +22,18 @@
 /**
  * Population of chromosomes which uses elitism (certain percentace of the best
  * chromosomes is directly copied to the next generation).
- * 
+ *
  * @version $Revision$ $Date$
  * @since 2.0
  */
 public class ElitisticListPopulation extends ListPopulation {
-    
+
     /** percentage of chromosomes copied to the next generation */
     private double elitismRate = 0.9;
 
     /**
      * Creates a new ElitisticListPopulation instance.
-     * 
+     *
      * @param chromosomes
      *            list of chromosomes in the population
      * @param populationLimit
@@ -50,11 +50,11 @@
     /**
      * Creates a new ListPopulation instance and initializes its inner
      * chromosome list.
-     * 
+     *
      * @param populationLimit maximal size of the population
      * @param elitismRate
      *            how many best chromosomes will be directly transferred to the
-     *            next generation [in %] 
+     *            next generation [in %]
      */
     public ElitisticListPopulation(int populationLimit, double elitismRate) {
         super(populationLimit);
@@ -63,19 +63,19 @@
 
     /**
      * Start the population for the next generation. The
-     * <code>{@link #elitismRate}<code> percents of the best 
+     * <code>{@link #elitismRate}<code> percents of the best
      * chromosomes are directly copied to the next generation.
-     * 
+     *
      * @return the beginnings of the next generation.
      */
     public Population nextGeneration() {
         // initialize a new generation with the same parameters
         ElitisticListPopulation nextGeneration = new ElitisticListPopulation(this.getPopulationLimit(), this.getElitismRate());
-        
+
         List<Chromosome> oldChromosomes = this.getChromosomes();
         Collections.sort(oldChromosomes);
-        
-        // index of the last "not good enough" chromosome 
+
+        // index of the last "not good enough" chromosome
         int boundIndex = (int) Math.ceil((1.0 - this.getElitismRate()) * oldChromosomes.size());
         for (int i=boundIndex; i<oldChromosomes.size(); i++) {
             nextGeneration.addChromosome(oldChromosomes.get(i));
@@ -86,7 +86,7 @@
     /**
      * Sets the elitism rate, i.e. how many best chromosomes will be directly
      * transferred to the next generation [in %].
-     * 
+     *
      * @param elitismRate
      *            how many best chromosomes will be directly transferred to the
      *            next generation [in %]

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/Fitness.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/Fitness.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/Fitness.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/Fitness.java Sat Sep  5 17:36:48 2009
@@ -19,14 +19,14 @@
 /**
  * Fitness of a chromosome.
  *
- * @version $Revision:$ $Date:$
+ * @version $Revision$ $Date$
  * @since 2.0
  */
 public interface Fitness {
     /**
      * Compute the fitness. This is usually very time-consuming, so the value
      * should be cached.
-     * 
+     *
      * @return fitness
      */
     public double fitness();

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/FixedGenerationCount.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/FixedGenerationCount.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/FixedGenerationCount.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/FixedGenerationCount.java Sat Sep  5 17:36:48 2009
@@ -17,38 +17,38 @@
 package org.apache.commons.math.genetics;
 
 /**
- * Stops after a fixed number of generations.  Each time 
+ * Stops after a fixed number of generations.  Each time
  * {@link #isSatisfied(Population)} is invoked, a generation counter is
- * incremented.  Once the counter reaches the configured 
+ * incremented.  Once the counter reaches the configured
  * <code>maxGenerations</code> value, {@link #isSatisfied(Population)} returns
  * true.
- * 
+ *
  * @version $Revision$ $Date$
  * @since 2.0
  */
 public class FixedGenerationCount implements StoppingCondition {
     /** Number of generations that have passed */
     private int numGenerations = 0;
-    
+
     /** Maximum number of generations (stopping criteria) */
     private final int maxGenerations;
-    
+
     /**
      * Create a new FixedGenerationCount instance.
-     * 
+     *
      * @param maxGenerations number of generations to evolve
      */
     public FixedGenerationCount(int maxGenerations) {
-        if (maxGenerations <= 0) 
+        if (maxGenerations <= 0)
             throw new IllegalArgumentException("The number of generations has to be >= 0");
         this.maxGenerations = maxGenerations;
     }
-    
+
     /**
      * Determine whether or not the given number of generations have passed.
      * Increments the number of generations counter if the maximum has not
      * been reached.
-     * 
+     *
      * @param population ignored (no impact on result)
      * @return <code>true</code> IFF the maximum number of generations has been exceeded
      */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/GeneticAlgorithm.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/GeneticAlgorithm.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/GeneticAlgorithm.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/GeneticAlgorithm.java Sat Sep  5 17:36:48 2009
@@ -30,31 +30,31 @@
 
     /**
      * Static random number generator shared by GA implementation classes.
-     * Set the randomGenerator seed to get reproducible results.  
+     * Set the randomGenerator seed to get reproducible results.
      * Use {@link #setRandomGenerator(RandomGenerator)} to supply an alternative
      * to the default JDK-provided PRNG.
      */
     //@GuardedBy("this")
     private static RandomGenerator randomGenerator = new JDKRandomGenerator();
-    
+
     /**
      * Set the (static) random generator.
-     * 
+     *
      * @param random random generator
      */
     public synchronized static void setRandomGenerator(RandomGenerator random) {
         randomGenerator = random;
     }
-    
+
     /**
      * Returns the (static) random generator.
-     * 
+     *
      * @return the static random generator shared by GA implementation classes
      */
     public synchronized static RandomGenerator getRandomGenerator() {
         return randomGenerator;
     }
-      
+
     /** the crossover policy used by the algorithm. */
     private final CrossoverPolicy crossoverPolicy;
 
@@ -69,7 +69,7 @@
 
     /** the selection policy used by the algorithm. */
     private final SelectionPolicy selectionPolicy;
-    
+
     /**
      * @param crossoverPolicy The {@link CrossoverPolicy}
      * @param crossoverRate The crossover rate as a percentage (0-1 inclusive)
@@ -93,11 +93,11 @@
         this.mutationRate = mutationRate;
         this.selectionPolicy = selectionPolicy;
     }
-    
+
     /**
      * Evolve the given population. Evolution stops when the stopping condition
      * is satisfied.
-     * 
+     *
      * @param initial the initial, seed population.
      * @param condition the stopping condition used to stop evolution.
      * @return the population that satisfies the stopping condition.
@@ -128,7 +128,7 @@
      *    <li>Return nextGeneration</li>
      *    </ol>
      * </p>
-     * 
+     *
      * @param current the current population.
      * @return the population for the next generation.
      */
@@ -136,7 +136,7 @@
         Population nextGeneration = current.nextGeneration();
 
         RandomGenerator randGen = getRandomGenerator();
-        
+
         while (nextGeneration.getPopulationSize() < nextGeneration.getPopulationLimit()) {
             // select parent chromosomes
             ChromosomePair pair = getSelectionPolicy().select(current);
@@ -165,8 +165,8 @@
         }
 
         return nextGeneration;
-    }    
-    
+    }
+
     /**
      * Returns the crossover policy.
      * @return crossover policy
@@ -206,5 +206,5 @@
     public SelectionPolicy getSelectionPolicy() {
         return selectionPolicy;
     }
-        
+
 }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/InvalidRepresentationException.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/InvalidRepresentationException.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/InvalidRepresentationException.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/InvalidRepresentationException.java Sat Sep  5 17:36:48 2009
@@ -18,7 +18,7 @@
 
 /**
  * Exception indicating that the representation of a chromosome is not valid.
- * 
+ *
  * @version $Revision$ $Date$
  * @since 2.0
  */
@@ -52,7 +52,7 @@
 
     /**
      * Construct an InvalidRepresentationException
-     * 
+     *
      * @param arg0 exception message
      * @param arg1 cause
      */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/ListPopulation.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/ListPopulation.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/ListPopulation.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/ListPopulation.java Sat Sep  5 17:36:48 2009
@@ -27,17 +27,17 @@
  * @version $Revision$ $Date$
  */
 public abstract class ListPopulation implements Population {
-    
+
     /** List of chromosomes */
     private List<Chromosome> chromosomes;
-    
+
     /** maximial size of the population */
     private int populationLimit;
-    
-    
+
+
     /**
      * Creates a new ListPopulation instance.
-     * 
+     *
      * @param chromosomes list of chromosomes in the population
      * @param populationLimit maximal size of the population
      */
@@ -48,15 +48,15 @@
         if (populationLimit < 0) {
             throw new IllegalArgumentException("Population limit has to be >= 0");
         }
-            
+
         this.chromosomes = chromosomes;
         this.populationLimit = populationLimit;
     }
-    
+
     /**
      * Creates a new ListPopulation instance and initializes its inner
      * chromosome list.
-     * 
+     *
      * @param populationLimit maximal size of the population
      */
     public ListPopulation (int populationLimit) {
@@ -74,7 +74,7 @@
     public void setChromosomes(List<Chromosome> chromosomes) {
         this.chromosomes = chromosomes;
     }
-    
+
     /**
      * Access the list of chromosomes.
      * @return the list of chromosomes
@@ -97,7 +97,7 @@
      */
     public Chromosome getFittestChromosome() {
         // best so far
-        Chromosome bestChromosome = this.chromosomes.get(0);    
+        Chromosome bestChromosome = this.chromosomes.get(0);
         for (Chromosome chromosome : this.chromosomes) {
             if (chromosome.compareTo(bestChromosome) > 0) {
                 // better chromosome found
@@ -106,7 +106,7 @@
         }
         return bestChromosome;
     }
-    
+
     /**
      * Access the maximum population size.
      * @return the maximum population size.
@@ -114,7 +114,7 @@
     public int getPopulationLimit() {
         return this.populationLimit;
     }
-    
+
     /**
      * Sets the maximal population size.
      * @param populationLimit maximal population size.
@@ -127,10 +127,10 @@
      * Access the current population size.
      * @return the current population size.
      */
-    public int getPopulationSize() {        
+    public int getPopulationSize() {
         return this.chromosomes.size();
     }
-    
+
     /**
      * {@inheritDoc}
      */
@@ -138,13 +138,13 @@
     public String toString() {
         return this.chromosomes.toString();
     }
-    
+
     /**
      * Chromosome list iterator
-     * 
+     *
      * @return chromosome iterator
      */
-    public Iterator<Chromosome> iterator() {        
+    public Iterator<Chromosome> iterator() {
         return chromosomes.iterator();
     }
 }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/MutationPolicy.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/MutationPolicy.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/MutationPolicy.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/MutationPolicy.java Sat Sep  5 17:36:48 2009
@@ -18,7 +18,7 @@
 
 /**
  * Algorithm used to mutate a chrommosome.
- * 
+ *
  * @since 2.0
  * @version $Revision$ $Date$
  */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/OnePointCrossover.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/OnePointCrossover.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/OnePointCrossover.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/OnePointCrossover.java Sat Sep  5 17:36:48 2009
@@ -24,7 +24,7 @@
  * One point crossover policy. A random crossover point is selected and the
  * first part from each parent is copied to the corresponding child, and the
  * second parts are copied crosswise.
- * 
+ *
  * Example:
  * <pre>
  * -C- denotes a crossover point
@@ -36,22 +36,22 @@
  *      /------------\ /-----\              /------------\ /-----\
  * c1 = (1 0 1 0 0 1  | 1 1 1)    X    p2 = (0 1 1 0 1 0  | 0 1 1)
  * </pre>
- * 
- * This policy works only on {@link AbstractListChromosome}, and therefore it 
+ *
+ * This policy works only on {@link AbstractListChromosome}, and therefore it
  * is parametrized by T. Moreover, the chromosomes must have same lengths.
- * 
+ *
  * @param <T> generic type of the {@link AbstractListChromosome}s for crossover
  * @since 2.0
  * @version $Revision$ $Date$
- * 
+ *
  */
 public class OnePointCrossover<T> implements CrossoverPolicy {
-    
+
     /**
      * Performs one point crossover. A random crossover point is selected and the
      * first part from each parent is copied to the corresponding child, and the
      * second parts are copied crosswise.
-     * 
+     *
      * Example:
      * -C- denotes a crossover point
      *                   -C-                                -C-
@@ -61,7 +61,7 @@
      *            VV         (**)                      VV        (*)
      *      /------------\ /-----\              /------------\ /-----\
      * c1 = (1 0 1 0 0 1  | 1 1 1)    X    p2 = (0 1 1 0 1 0  | 0 1 1)
-     * 
+     *
      * @param first first parent (p1)
      * @param second second parent (p2)
      * @return pair of two children (c1,c2)
@@ -77,23 +77,23 @@
 
     /**
      * Helper for {@link #crossover(Chromosome, Chromosome)}. Performs the actual crossover.
-     * 
+     *
      * @param first the first chromosome.
      * @param second the second chromosome.
      * @return the pair of new chromosomes that resulted from the crossover.
      */
     private ChromosomePair crossover(AbstractListChromosome<T> first, AbstractListChromosome<T> second) {
         int length = first.getLength();
-        if (length != second.getLength()) 
+        if (length != second.getLength())
             throw new IllegalArgumentException("Both chromosomes must have same lengths.");
-        
+
         // array representations of the parents
         List<T> parent1Rep = first.getRepresentation();
         List<T> parent2Rep = second.getRepresentation();
         // and of the children
         ArrayList<T> child1Rep = new ArrayList<T> (first.getLength());
         ArrayList<T> child2Rep = new ArrayList<T> (second.getLength());
-        
+
         // select a crossover point at random (0 and length makes no sense)
         int crossoverIndex = 1 + (GeneticAlgorithm.getRandomGenerator().nextInt(length-2));
 
@@ -107,7 +107,7 @@
             child1Rep.add(parent2Rep.get(i));
             child2Rep.add(parent1Rep.get(i));
         }
-        
+
         return new ChromosomePair(
                 first.newFixedLengthChromosome(child1Rep),
                 second.newFixedLengthChromosome(child2Rep)

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/PermutationChromosome.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/PermutationChromosome.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/PermutationChromosome.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/PermutationChromosome.java Sat Sep  5 17:36:48 2009
@@ -20,7 +20,7 @@
 
 /**
  * Interface indicating that the chromosome represents a permutation of objects.
- * 
+ *
  * @param <T>
  *            type of the permuted objects
  * @since 2.0
@@ -33,12 +33,12 @@
      * permutation this chromosome represents. For example, if this chromosome
      * represents a permutation (3,0,1,2), and the unpermuted sequence is
      * (a,b,c,d), this yields (d,a,b,c).
-     * 
+     *
      * @param sequence
      *            the unpermuted (original) sequence of objects
      * @return permutation of <code>sequence</code> represented by this
      *         permutation
      */
     public List<T> decode(List<T> sequence);
-    
+
 }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/Population.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/Population.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/Population.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/Population.java Sat Sep  5 17:36:48 2009
@@ -18,9 +18,9 @@
 
 /**
  * A collection of chromosomes that facilitates generational evolution.
- * 
+ *
  * @since 2.0
- * @version $Revision:$ $Date:$
+ * @version $Revision$ $Date$
  */
 public interface Population extends Iterable<Chromosome> {
     /**

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/RandomKey.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/RandomKey.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/RandomKey.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/RandomKey.java Sat Sep  5 17:36:48 2009
@@ -28,23 +28,23 @@
  * of a fixed length of real numbers in [0,1] interval. The index of the i-th
  * smallest value in the vector represents an i-th member of the permutation.
  * </p>
- * 
+ *
  * <p>
  * For example, the random key [0.2, 0.3, 0.8, 0.1] corresponds to the
  * permutation of indices (3,0,1,2). If the original (unpermuted) sequence would
  * be (a,b,c,d), this would mean the sequence (d,a,b,c).
  * </p>
- * 
+ *
  * <p>
  * With this representation, common operators like n-point crossover can be
  * used, because any such chromosome represents a valid permutation.
  * </p>
- * 
+ *
  * <p>
  * Since the chromosome (and thus its arrayRepresentation) is immutable, the
  * array representation is sorted only once in the constructor.
  * </p>
- * 
+ *
  * <p>
  * For details, see:
  * <ul>
@@ -55,27 +55,27 @@
  * Heidelberg (2002)</li>
  * </ul>
  * </p>
- * 
+ *
  * @param <T>
  *            type of the permuted objects
  * @since 2.0
  * @version $Revision$ $Date$
  */
 public abstract class RandomKey<T> extends AbstractListChromosome<Double> implements PermutationChromosome<T> {
-    
+
     /**
      * Cache of sorted representation (unmodifiable).
      */
     private final List<Double> sortedRepresentation;
-    
+
     /**
      * Base sequence [0,1,...,n-1], permuted accorting to the representation (unmodifiable).
      */
     private final List<Integer> baseSeqPermutation;
-    
+
     /**
      * Constructor.
-     * 
+     *
      * @param representation list of [0,1] values representing the permutation
      */
     public RandomKey(List<Double> representation) {
@@ -89,10 +89,10 @@
             decodeGeneric(baseSequence(getLength()), getRepresentation(), sortedRepresentation)
         );
     }
-    
+
     /**
      * Constructor.
-     * 
+     *
      * @param representation array of [0,1] values representing the permutation
      */
     public RandomKey(Double[] representation) {
@@ -109,7 +109,7 @@
     /**
      * Decodes a permutation represented by <code>representation</code> and
      * returns a (generic) list with the permuted values.
-     * 
+     *
      * @param <S> generic type of the sequence values
      * @param sequence the unpermuted sequence
      * @param representation representation of the permutation ([0,1] vector)
@@ -118,16 +118,16 @@
      */
     private static <S> List<S> decodeGeneric(List<S> sequence, List<Double> representation, List<Double> sortedRepr) {
         int l = sequence.size();
-        
+
         if (representation.size() != l) {
             throw new IllegalArgumentException(String.format("Length of sequence for decoding (%s) has to be equal to the length of the RandomKey (%s)", l, representation.size()));
         }
         if (representation.size() != sortedRepr.size()) {
             throw new IllegalArgumentException(String.format("Representation and sortedRepr must have same sizes, %d != %d", representation.size(), sortedRepr.size()));
         }
-        
+
         List<Double> reprCopy = new ArrayList<Double> (representation);// do not modify the orig. representation
-        
+
         // now find the indices in the original repr and use them for permuting
         List<S> res = new ArrayList<S> (l);
         for (int i=0; i<l; i++) {
@@ -141,7 +141,7 @@
     /**
      * Returns <code>true</code> iff <code>another</code> is a RandomKey and
      * encodes the same permutation.
-     * 
+     *
      * @param another chromosome to compare
      * @return true iff chromosomes encode the same permutation
      */
@@ -154,12 +154,12 @@
         // size check
         if (getLength() != anotherRk.getLength())
             return false;
-        
+
         // two different representations can still encode the same permutation
         // the ordering is what counts
         List<Integer> thisPerm = this.baseSeqPermutation;
         List<Integer> anotherPerm = anotherRk.baseSeqPermutation;
-        
+
         for (int i=0; i<getLength(); i++) {
             if (thisPerm.get(i) != anotherPerm.get(i))
                 return false;
@@ -167,11 +167,11 @@
         // the permutations are the same
         return true;
     }
-    
+
     /**
      * {@inheritDoc}
      */
-    @Override    
+    @Override
     protected void checkValidity(java.util.List<Double> chromosomeRepresentation) throws InvalidRepresentationException {
         for (double val : chromosomeRepresentation) {
             if (val < 0 || val > 1) {
@@ -179,12 +179,12 @@
             }
         }
     }
-    
+
 
     /**
      * Generates a representation corresponding to a random permutation of
      * length l which can be passed to the RandomKey constructor.
-     * 
+     *
      * @param l
      *            length of the permutation
      * @return representation of a random permutation
@@ -200,7 +200,7 @@
     /**
      * Generates a representation corresponding to an identity permutation of
      * length l which can be passed to the RandomKey constructor.
-     * 
+     *
      * @param l
      *            length of the permutation
      * @return representation of an identity permutation
@@ -217,10 +217,10 @@
      * Generates a representation of a permutation corresponding to the
      * <code>data</code> sorted by <code>comparator</code>. The
      * <code>data</code> is not modified during the process.
-     * 
+     *
      * This is useful if you want to inject some permutations to the initial
      * population.
-     * 
+     *
      * @param <S> type of the data
      * @param data list of data determining the order
      * @param comparator how the data will be compared
@@ -229,7 +229,7 @@
     public static <S> List<Double> comparatorPermutation(List<S> data, Comparator<S> comparator) {
         List<S> sortedData = new ArrayList<S> (data);
         Collections.sort(sortedData, comparator);
-        
+
         return inducedPermutation(data, sortedData);
     }
 
@@ -237,23 +237,23 @@
      * Generates a representation of a permutation corresponding to a
      * permutation which yields <code>permutedData</code> when applied to
      * <code>originalData</code>.
-     * 
+     *
      * This method can be viewed as an inverse to {@link #decode(List)}.
-     * 
+     *
      * @param <S> type of the data
      * @param originalData the original, unpermuted data
      * @param permutedData the data, somehow permuted
      * @return representation of a permutation corresponding to the permutation <code>originalData -> permutedData</code>
-     * @throws IllegalArgumentException iff the <code>permutedData</code> and <code>originalData</code> contains different data 
+     * @throws IllegalArgumentException iff the <code>permutedData</code> and <code>originalData</code> contains different data
      */
     public static <S> List<Double> inducedPermutation(List<S> originalData, List<S> permutedData) throws IllegalArgumentException {
         if (originalData.size() != permutedData.size()) {
             throw new IllegalArgumentException("originalData and permutedData must have same length");
         }
         int l = originalData.size();
-        
+
         List<S> origDataCopy = new ArrayList<S> (originalData);
-        
+
         Double[] res = new Double[l];
         for (int i=0; i<l; i++) {
             int index = origDataCopy.indexOf(permutedData.get(i));
@@ -265,7 +265,7 @@
         }
         return Arrays.asList(res);
     }
-    
+
     /**
      * {@inheritDoc}
      */
@@ -276,7 +276,7 @@
 
     /**
      * Helper for constructor. Generates a list of natural numbers (0,1,...,l-1).
-     * 
+     *
      * @param l length of list to generate
      * @return list of integers from 0 to l-1
      */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/RandomKeyMutation.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/RandomKeyMutation.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/RandomKeyMutation.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/RandomKeyMutation.java Sat Sep  5 17:36:48 2009
@@ -24,7 +24,7 @@
 /**
  * Mutation operator for {@link RandomKey}s. Changes a randomly chosen element
  * of the array representation to a random value uniformly distributed in [0,1].
- * 
+ *
  * @since 2.0
  * @version $Revision$ $Date$
  */
@@ -32,8 +32,8 @@
 
     /**
      * {@inheritDoc}
-     * 
-     * @throws IllegalArgumentException if <code>original</code> is not a 
+     *
+     * @throws IllegalArgumentException if <code>original</code> is not a
      * {@link RandomKey} instance
      */
     public Chromosome mutate(Chromosome original) {
@@ -42,14 +42,14 @@
                     "RandomKeyMutation works only with RandomKeys, got " +
                     original.getClass().getSimpleName());
         }
-        
+
         RandomKey<?> originalRk = (RandomKey<?>) original;
         List<Double> repr = originalRk.getRepresentation();
         int rInd = GeneticAlgorithm.getRandomGenerator().nextInt(repr.size());
-        
+
         List<Double> newRepr = new ArrayList<Double> (repr);
         newRepr.set(rInd, GeneticAlgorithm.getRandomGenerator().nextDouble());
-        
+
         return originalRk.newFixedLengthChromosome(newRepr);
     }
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/SelectionPolicy.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/SelectionPolicy.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/SelectionPolicy.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/SelectionPolicy.java Sat Sep  5 17:36:48 2009
@@ -18,9 +18,9 @@
 
 /**
  * Algorithm used to select a chromosome pair from a population.
- * 
+ *
  * @since 2.0
- * @version $Revision:$ $Date:$
+ * @version $Revision$ $Date$
  */
 public interface SelectionPolicy {
     /**

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/StoppingCondition.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/StoppingCondition.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/StoppingCondition.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/StoppingCondition.java Sat Sep  5 17:36:48 2009
@@ -18,15 +18,15 @@
 
 /**
  * Algorithm used to determine when to stop evolution.
- * 
+ *
  * @since 2.0
- * @version $Revision:$ $Date:$
+ * @version $Revision$ $Date$
  */
 public interface StoppingCondition {
     /**
      * Determine whether or not the given population satisfies the stopping
      * condition.
-     * 
+     *
      * @param population the population to test.
      * @return <code>true</code> if this stopping condition is met by the
      *         given population. <code>false</code> otherwise.

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/TournamentSelection.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/TournamentSelection.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/TournamentSelection.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/TournamentSelection.java Sat Sep  5 17:36:48 2009
@@ -23,19 +23,19 @@
  * Tournament selection scheme. Each of the two selected chromosomes is selected
  * based on n-ary tournament -- this is done by drawing {@link #arity} random
  * chromosomes without replacement from the population, and then selecting the
- * fittest chromosome among them. 
- * 
+ * fittest chromosome among them.
+ *
  * @since 2.0
  * @version $Revision$ $Date$
  */
 public class TournamentSelection implements SelectionPolicy {
-    
+
     /** number of chromosomes included in the tournament selections */
     private int arity;
-    
+
     /**
      * Creates a new TournamentSelection instance.
-     * 
+     *
      * @param arity
      *            how many chromosomes will be drawn to the tournament
      */
@@ -48,7 +48,7 @@
      * chromosomes is selected based on n-ary tournament -- this is done by
      * drawing {@link #arity} random chromosomes without replacement from the
      * population, and then selecting the fittest chromosome among them.
-     * 
+     *
      * @param population
      *            the population from which the chromosomes are choosen.
      * @return the selected chromosomes.
@@ -59,12 +59,12 @@
                 tournament((ListPopulation)population)
                 );
     }
-    
+
     /**
      * Helper for {@link #select(Population)}. Draw {@link #arity} random
      * chromosomes without replacement from the population, and then select the
      * fittest chromosome among them.
-     * 
+     *
      * @param population
      *            the population from which the chromosomes are choosen.
      * @return the selected chromosome.
@@ -79,7 +79,7 @@
                 return null;
             }
         };
-        
+
         // create a copy of the chromosome list
         List<Chromosome> chromosomes = new ArrayList<Chromosome> (population.getChromosomes());
         for (int i=0; i<this.arity; i++) {
@@ -95,7 +95,7 @@
 
     /**
      * Gets the arity (number of chromosomes drawn to the tournament).
-     * 
+     *
      * @return arity of the tournament
      */
     public int getArity() {
@@ -104,7 +104,7 @@
 
     /**
      * Sets the arity (number of chromosomes drawn to the tournament).
-     * 
+     *
      * @param arity arity of the tournament
      */
     public void setArity(int arity) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/CardanEulerSingularityException.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/CardanEulerSingularityException.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/CardanEulerSingularityException.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/CardanEulerSingularityException.java Sat Sep  5 17:36:48 2009
@@ -28,7 +28,7 @@
 public class CardanEulerSingularityException
   extends MathException {
 
-  /** 
+  /**
    * Simple constructor.
    * build an exception with a default message.
    * @param isCardan if true, the rotation is related to Cardan angles,

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/NotARotationMatrixException.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/NotARotationMatrixException.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/NotARotationMatrixException.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/NotARotationMatrixException.java Sat Sep  5 17:36:48 2009
@@ -19,7 +19,7 @@
 
 import org.apache.commons.math.MathException;
 
-/** 
+/**
  * This class represents exceptions thrown while building rotations
  * from matrices.
  *
@@ -30,7 +30,7 @@
 public class NotARotationMatrixException
   extends MathException {
 
-  /** 
+  /**
    * Simple constructor.
    * Build an exception by translating and formating a message
    * @param specifier format specifier (to be translated)

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3D.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3D.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3D.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3D.java Sat Sep  5 17:36:48 2009
@@ -22,7 +22,7 @@
 import org.apache.commons.math.MathRuntimeException;
 import org.apache.commons.math.util.MathUtils;
 
-/** 
+/**
  * This class implements vectors in a three-dimensional space.
  * <p>Instance of this class are guaranteed to be immutable.</p>
  * @version $Revision$ $Date$
@@ -113,7 +113,7 @@
   }
 
   /** Multiplicative constructor
-   * Build a vector from another one and a scale factor. 
+   * Build a vector from another one and a scale factor.
    * The vector built will be a * u
    * @param a scale factor
    * @param u base (unscaled) vector
@@ -350,7 +350,7 @@
       }
       return Math.PI - Math.asin(v3.getNorm() / normProduct);
     }
-    
+
     // the vectors are sufficiently separated to use the cosine
     return Math.acos(dot / normProduct);
 
@@ -376,9 +376,9 @@
    * @return  true if any coordinate of this vector is NaN; false otherwise
    */
   public boolean isNaN() {
-      return Double.isNaN(x) || Double.isNaN(y) || Double.isNaN(z);        
+      return Double.isNaN(x) || Double.isNaN(y) || Double.isNaN(z);
   }
-  
+
   /**
    * Returns true if any coordinate of this vector is infinite and none are NaN;
    * false otherwise
@@ -386,9 +386,9 @@
    * false otherwise
    */
   public boolean isInfinite() {
-      return !isNaN() && (Double.isInfinite(x) || Double.isInfinite(y) || Double.isInfinite(z));        
+      return !isNaN() && (Double.isInfinite(x) || Double.isInfinite(y) || Double.isInfinite(z));
   }
-  
+
   /**
    * Test for the equality of two 3D vectors.
    * <p>
@@ -406,12 +406,12 @@
    * @return true if two 3D vector objects are equal, false if
    *         object is null, not an instance of Vector3D, or
    *         not equal to this Vector3D instance
-   * 
+   *
    */
   @Override
   public boolean equals(Object other) {
 
-    if (this == other) { 
+    if (this == other) {
       return true;
     }
 
@@ -426,7 +426,7 @@
           return this.isNaN();
       }
 
-      return (x == rhs.x) && (y == rhs.y) && (z == rhs.z); 
+      return (x == rhs.x) && (y == rhs.y) && (z == rhs.z);
 
     } catch (ClassCastException ex) {
         // ignore exception
@@ -434,12 +434,12 @@
     }
 
   }
-  
+
   /**
    * Get a hashCode for the 3D vector.
    * <p>
    * All NaN values have the same hash code.</p>
-   * 
+   *
    * @return a hash code value for this object
    */
   @Override

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractFieldMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractFieldMatrix.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractFieldMatrix.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractFieldMatrix.java Sat Sep  5 17:36:48 2009
@@ -34,7 +34,7 @@
  * @since 2.0
  */
 public abstract class AbstractFieldMatrix<T extends FieldElement<T>> implements FieldMatrix<T> {
-    
+
     /** Field to which the elements belong. */
     private final Field<T> field;
 
@@ -48,10 +48,10 @@
     protected static <T extends FieldElement<T>> Field<T> extractField(final T[][] d)
         throws IllegalArgumentException {
         if (d.length == 0) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row"); 
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row");
         }
         if (d[0].length == 0) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column"); 
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");
         }
         return d[0][0].getField();
     }
@@ -66,7 +66,7 @@
     protected static <T extends FieldElement<T>> Field<T> extractField(final T[] d)
         throws IllegalArgumentException {
         if (d.length == 0) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row"); 
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row");
         }
         return d[0].getField();
     }
@@ -87,8 +87,8 @@
                                                                   final int rows,
                                                                   final int columns) {
         if (columns < 0) {
-            T[] dummyRow = (T[]) Array.newInstance(field.getZero().getClass(), 0); 
-            return (T[][]) Array.newInstance(dummyRow.getClass(), rows);            
+            T[] dummyRow = (T[]) Array.newInstance(field.getZero().getClass(), 0);
+            return (T[][]) Array.newInstance(dummyRow.getClass(), rows);
         }
         T[][] array =
             (T[][]) Array.newInstance(field.getZero().getClass(), new int[] { rows, columns });
@@ -121,7 +121,7 @@
     protected AbstractFieldMatrix() {
         field = null;
     }
-    
+
     /**
      * Creates a matrix with no data
      * @param field field to which the elements belong
@@ -178,7 +178,7 @@
         for (int row = 0; row < rowCount; ++row) {
             for (int col = 0; col < columnCount; ++col) {
                 out.setEntry(row, col, getEntry(row, col).add(m.getEntry(row, col)));
-            }  
+            }
         }
 
         return out;
@@ -197,7 +197,7 @@
         for (int row = 0; row < rowCount; ++row) {
             for (int col = 0; col < columnCount; ++col) {
                 out.setEntry(row, col, getEntry(row, col).subtract(m.getEntry(row, col)));
-            }  
+            }
         }
 
         return out;
@@ -324,7 +324,7 @@
 
         return subMatrix;
 
-    } 
+    }
 
     /** {@inheritDoc} */
     public void copySubMatrix(final int startRow, final int endRow,
@@ -396,24 +396,24 @@
     }
 
     /** {@inheritDoc} */
-    public void setSubMatrix(final T[][] subMatrix, final int row, final int column) 
+    public void setSubMatrix(final T[][] subMatrix, final int row, final int column)
         throws MatrixIndexException {
 
         final int nRows = subMatrix.length;
         if (nRows == 0) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row"); 
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row");
         }
 
         final int nCols = subMatrix[0].length;
         if (nCols == 0) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column"); 
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");
         }
 
         for (int r = 1; r < nRows; ++r) {
             if (subMatrix[r].length != nCols) {
                 throw MathRuntimeException.createIllegalArgumentException(
                         "some rows have length {0} while others have length {1}",
-                        nCols, subMatrix[r].length); 
+                        nCols, subMatrix[r].length);
             }
         }
 
@@ -426,7 +426,7 @@
             for (int j = 0; j < nCols; ++j) {
                 setEntry(row + i, column + j, subMatrix[i][j]);
             }
-        } 
+        }
 
     }
 
@@ -444,7 +444,7 @@
         return out;
 
     }
-    
+
     /** {@inheritDoc} */
     public void setRowMatrix(final int row, final FieldMatrix<T> matrix)
         throws MatrixIndexException, InvalidMatrixException {
@@ -462,7 +462,7 @@
         }
 
     }
-    
+
     /** {@inheritDoc} */
     public FieldMatrix<T> getColumnMatrix(final int column)
         throws MatrixIndexException {
@@ -495,7 +495,7 @@
         }
 
     }
-    
+
     /** {@inheritDoc} */
     public FieldVector<T> getRowVector(final int row)
         throws MatrixIndexException {
@@ -518,7 +518,7 @@
         }
 
     }
-    
+
     /** {@inheritDoc} */
     public FieldVector<T> getColumnVector(final int column)
         throws MatrixIndexException {
@@ -541,7 +541,7 @@
         }
 
     }
-    
+
     /** {@inheritDoc} */
     public T[] getRow(final int row)
         throws MatrixIndexException {
@@ -573,7 +573,7 @@
         }
 
     }
-    
+
     /** {@inheritDoc} */
     public T[] getColumn(final int column)
         throws MatrixIndexException {
@@ -605,7 +605,7 @@
         }
 
     }
-    
+
     /** {@inheritDoc} */
     public abstract T getEntry(int row, int column)
         throws MatrixIndexException;
@@ -953,20 +953,20 @@
                     res.append(",");
                 }
                 res.append(getEntry(i, j));
-            } 
+            }
             res.append("}");
-        } 
+        }
 
         res.append("}");
         return res.toString();
 
-    } 
-    
+    }
+
     /**
      * Returns true iff <code>object</code> is a
      * <code>FieldMatrix</code> instance with the same dimensions as this
      * and all corresponding matrix entries are equal.
-     * 
+     *
      * @param object the object to test equality against.
      * @return true if object equals this
      */
@@ -994,10 +994,10 @@
         }
         return true;
     }
-    
+
     /**
      * Computes a hashcode for the matrix.
-     * 
+     *
      * @return hashcode for matrix
      */
     @Override
@@ -1066,7 +1066,7 @@
                                            startColumn, endColumn);
         }
 
-    
+
     }
 
     /**



Mime
View raw message