Author: luc
Date: Sun Aug 1 15:01:30 2010
New Revision: 981238
URL: http://svn.apache.org/viewvc?rev=981238&view=rev
Log:
fixed another bunch of checkstyle warnings
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/MicrosphereInterpolatingFunction.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/BaseAbstractScalarOptimizer.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BracketFinder.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MultidimensionalCounter.java
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/MicrosphereInterpolatingFunction.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/MicrosphereInterpolatingFunction.java?rev=981238&r1=981237&r2=981238&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/MicrosphereInterpolatingFunction.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/interpolation/MicrosphereInterpolatingFunction.java
Sun Aug 1 15:01:30 2010
@@ -148,7 +148,7 @@ public class MicrosphereInterpolatingFun
int brightnessExponent,
int microsphereElements,
UnitSphereRandomVectorGenerator
rand)
- throws DimensionMismatchException, IllegalArgumentException {
+ throws DimensionMismatchException, NoDataException {
if (xval.length == 0 || xval[0] == null) {
throw new NoDataException();
}
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/BaseAbstractScalarOptimizer.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/BaseAbstractScalarOptimizer.java?rev=981238&r1=981237&r2=981238&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/BaseAbstractScalarOptimizer.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/BaseAbstractScalarOptimizer.java
Sun Aug 1 15:01:30 2010
@@ -37,6 +37,7 @@ import org.apache.commons.math.optimizat
* A class that implements an optimization algorithm should inherit from
* {...@link AbstractScalarOptimizer} or from
* {...@link AbstractScalarDifferentiableOptimizer}.
+ * @param <T> the type of the objective function to be optimized
*
* @version $Revision$ $Date$
* @since 2.2
@@ -120,8 +121,8 @@ public abstract class BaseAbstractScalar
}
/** {...@inheritdoc} */
- public void setConvergenceChecker(RealConvergenceChecker checker) {
- this.checker = checker;
+ public void setConvergenceChecker(RealConvergenceChecker
convergenceChecker) {
+ this.checker = convergenceChecker;
}
/** {...@inheritdoc} */
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java?rev=981238&r1=981237&r2=981238&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java
Sun Aug 1 15:01:30 2010
@@ -46,13 +46,13 @@ public abstract class AbstractUnivariate
/** Number of evaluations already performed. */
private int evaluations;
/** Optimization type */
- private GoalType goal;
+ private GoalType optimizationGoal;
/** Lower end of search interval. */
- private double min;
+ private double searchMin;
/** Higher end of search interval. */
- private double max;
+ private double searchMax;
/** Initial guess . */
- private double startValue;
+ private double searchStart;
/** Function to optimize. */
private UnivariateRealFunction function;
@@ -155,25 +155,25 @@ public abstract class AbstractUnivariate
* @return the optimization type.
*/
public GoalType getGoalType() {
- return goal;
+ return optimizationGoal;
}
/**
* @return the lower of the search interval.
*/
public double getMin() {
- return min;
+ return searchMin;
}
/**
* @return the higher of the search interval.
*/
public double getMax() {
- return max;
+ return searchMax;
}
/**
* @return the initial guess.
*/
public double getStartValue() {
- return startValue;
+ return searchStart;
}
/**
@@ -215,15 +215,15 @@ public abstract class AbstractUnivariate
}
/** {...@inheritdoc} */
- public double optimize(UnivariateRealFunction function, GoalType goal,
+ public double optimize(UnivariateRealFunction f, GoalType goal,
double min, double max, double startValue)
throws MaxIterationsExceededException, FunctionEvaluationException {
// Initialize.
- this.min = min;
- this.max = max;
- this.startValue = startValue;
- this.goal = goal;
- this.function = function;
+ this.searchMin = min;
+ this.searchMax = max;
+ this.searchStart = startValue;
+ this.optimizationGoal = goal;
+ this.function = f;
// Reset.
functionValue = Double.NaN;
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BracketFinder.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BracketFinder.java?rev=981238&r1=981237&r2=981238&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BracketFinder.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BracketFinder.java
Sun Aug 1 15:01:30 2010
@@ -228,24 +228,53 @@ public class BracketFinder {
/**
* @return the lower bound of the bracket.
+ * @see #getFLow()
*/
public double getLo() {
return lo;
}
+
+ /**
+ * Get function value at {...@link #getLo()}.
+ * @return function value at {...@link #getLo()}
+ */
+ public double getFLow() {
+ return fLo;
+ }
+
/**
* @return the higher bound of the bracket.
+ * @see #getFHi()
*/
public double getHi() {
return hi;
}
+
+ /**
+ * Get function value at {...@link #getHi()}.
+ * @return function value at {...@link #getHi()}
+ */
+ public double getFHi() {
+ return fHi;
+ }
+
/**
* @return a point in the middle of the bracket.
+ * @see #getFMid()
*/
public double getMid() {
return mid;
}
/**
+ * Get function value at {...@link #getMid()}.
+ * @return function value at {...@link #getMid()}
+ */
+ public double getFMid() {
+ return fMid;
+ }
+
+ /**
* @param f Function.
* @param x Argument.
* @return {...@code f(x)}
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=981238&r1=981237&r2=981238&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
Sun Aug 1 15:01:30 2010
@@ -1868,10 +1868,18 @@ public final class MathUtils {
}
public static class Order {
+
+ /** Enumerate type for increasing/decreasing directions. */
public static enum Direction {
- INCREASING,
- DECREASING
+
+ /** Constant for increasing direction. */
+ INCREASING,
+
+ /** Constant for decreasing direction. */
+ DECREASING
+
};
+
}
/**
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MultidimensionalCounter.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MultidimensionalCounter.java?rev=981238&r1=981237&r2=981238&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MultidimensionalCounter.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MultidimensionalCounter.java
Sun Aug 1 15:01:30 2010
@@ -140,7 +140,7 @@ public class MultidimensionalCounter imp
* of the iterator.
* @throws IndexOutOfBoundsException if {...@code index} is not in the
* correct interval (as defined by the length of the argument in the
- * {...@link #MultidimensionalCounter(int[])
+ * {...@link MultidimensionalCounter#MultidimensionalCounter(int[])
* constructor of the enclosing class}).
*/
public int getCount(int dim) {
@@ -159,7 +159,7 @@ public class MultidimensionalCounter imp
* Create a counter.
*
* @param size Counter sizes (number of slots in each dimension).
- * @throws {...@link NotStrictlyPositiveException} if one of the sizes is
+ * @throws NotStrictlyPositiveException if one of the sizes is
* negative or zero.
*/
public MultidimensionalCounter(int ... size) {
@@ -210,12 +210,12 @@ public class MultidimensionalCounter imp
*
* @param index Index in unidimensional counter.
* @return the multidimensional counts.
- * @throws {...@link OutOfRangeException} if {...@code index} is not
between
+ * @throws OutOfRangeException if {...@code index} is not between
* {...@code 0} and the value returned by {...@link #getSize()} (excluded).
*/
public int[] getCounts(int index) {
- if (index < 0
- || index >= totalSize) {
+ if (index < 0 ||
+ index >= totalSize) {
throw new OutOfRangeException(index, 0, totalSize);
}
@@ -250,21 +250,21 @@ public class MultidimensionalCounter imp
*
* @param c Indices in multidimensional counter.
* @return the index within the unidimensionl counter.
- * @throws {...@link DimensionMismatchException} if the size of {...@code
c}
- * does not match the size of the array given in the contructor.
- * @throws {...@link OutOfRangeException} if a value of {...@code c} is
not in
+ * @throws DimensionMismatchException if the size of {...@code c}
+ * does not match the size of the array given in the constructor.
+ * @throws OutOfRangeException if a value of {...@code c} is not in
* the range of the corresponding dimension, as defined in the
- * {...@link #MultidimensionalCounter(int[]) constructor}.
+ * {...@link MultidimensionalCounter#MultidimensionalCounter(int...)
constructor}.
*/
- public int getCount(int ... c) {
+ public int getCount(int ... c) throws OutOfRangeException {
if (c.length != dimension) {
throw new DimensionMismatchException(c.length, dimension);
}
int count = 0;
for (int i = 0; i < dimension; i++) {
final int index = c[i];
- if (index < 0
- || index >= size[i]) {
+ if (index < 0 ||
+ index >= size[i]) {
throw new OutOfRangeException(index, 0, size[i] - 1);
}
count += uniCounterOffset[i] * c[i];