You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2012/02/02 21:19:55 UTC
svn commit: r1239805 - in
/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization:
direct/MultivariateFunctionMappingAdapter.java
direct/MultivariateFunctionPenaltyAdapter.java linear/SimplexTableau.java
Author: tn
Date: Thu Feb 2 20:19:54 2012
New Revision: 1239805
URL: http://svn.apache.org/viewvc?rev=1239805&view=rev
Log:
Minor checkstyle fixes in optimization.[direct|linear].
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultivariateFunctionMappingAdapter.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultivariateFunctionPenaltyAdapter.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexTableau.java
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultivariateFunctionMappingAdapter.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultivariateFunctionMappingAdapter.java?rev=1239805&r1=1239804&r2=1239805&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultivariateFunctionMappingAdapter.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultivariateFunctionMappingAdapter.java Thu Feb 2 20:19:54 2012
@@ -22,7 +22,6 @@ import org.apache.commons.math.analysis.
import org.apache.commons.math.analysis.function.Logit;
import org.apache.commons.math.analysis.function.Sigmoid;
import org.apache.commons.math.exception.DimensionMismatchException;
-import org.apache.commons.math.exception.MathIllegalArgumentException;
import org.apache.commons.math.exception.NumberIsTooSmallException;
import org.apache.commons.math.util.FastMath;
import org.apache.commons.math.util.MathUtils;
@@ -92,7 +91,7 @@ public class MultivariateFunctionMapping
* @param upper upper bounds for each element of the input parameters array
* (some elements may be set to {@code Double.POSITIVE_INFINITY} for
* unbounded values)
- * @exception MathIllegalArgumentException if lower and upper bounds are not
+ * @exception DimensionMismatchException if lower and upper bounds are not
* consistent, either according to dimension or to values
*/
public MultivariateFunctionMappingAdapter(final MultivariateFunction bounded,
@@ -151,8 +150,7 @@ public class MultivariateFunctionMapping
}
- /**
- * Map an array from bounded to unbounded.
+ /** Map an array from bounded to unbounded.
* @param point bounded value
* @return unbounded value
*/
@@ -174,6 +172,8 @@ public class MultivariateFunctionMapping
* set up at construction and calls the underlying function using
* the bounded point.
* </p>
+ * @param point unbounded value
+ * @return underlying function value
* @see #unboundedToBounded(double[])
*/
public double value(double[] point) {
@@ -181,19 +181,19 @@ public class MultivariateFunctionMapping
}
/** Mapping interface. */
- private static interface Mapper {
+ private interface Mapper {
/** Map a value from unbounded to bounded.
* @param y unbounded value
* @return bounded value
*/
- public double unboundedToBounded(double y);
+ double unboundedToBounded(double y);
/** Map a value from bounded to unbounded.
* @param x bounded value
* @return unbounded value
*/
- public double boundedToUnbounded(double x);
+ double boundedToUnbounded(double x);
}
@@ -259,12 +259,12 @@ public class MultivariateFunctionMapping
public double unboundedToBounded(final double y) {
return upper - FastMath.exp(-y);
}
-
+
/** {@inheritDoc} */
public double boundedToUnbounded(final double x) {
return -FastMath.log(upper - x);
}
-
+
}
/** Local class for lower and bounds mapping. */
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultivariateFunctionPenaltyAdapter.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultivariateFunctionPenaltyAdapter.java?rev=1239805&r1=1239804&r2=1239805&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultivariateFunctionPenaltyAdapter.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultivariateFunctionPenaltyAdapter.java Thu Feb 2 20:19:54 2012
@@ -19,7 +19,6 @@ package org.apache.commons.math.optimiza
import org.apache.commons.math.analysis.MultivariateFunction;
import org.apache.commons.math.exception.DimensionMismatchException;
-import org.apache.commons.math.exception.MathIllegalArgumentException;
import org.apache.commons.math.exception.NumberIsTooSmallException;
import org.apache.commons.math.util.FastMath;
import org.apache.commons.math.util.MathUtils;
@@ -117,7 +116,7 @@ public class MultivariateFunctionPenalty
* unbounded values)
* @param offset base offset of the penalty function
* @param scale scale of the penalty function
- * @exception MathIllegalArgumentException if lower bounds, upper bounds and
+ * @exception DimensionMismatchException if lower bounds, upper bounds and
* scales are not consistent, either according to dimension or to bounadary
* values
*/
@@ -157,6 +156,7 @@ public class MultivariateFunctionPenalty
* a replacement value using the offset and scale if bounds are
* violated, without calling the function at all.
* </p>
+ * @param point unbounded point
* @return either underlying function value or penalty function value
*/
public double value(double[] point) {
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexTableau.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexTableau.java?rev=1239805&r1=1239804&r2=1239805&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexTableau.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexTableau.java Thu Feb 2 20:19:54 2012
@@ -409,7 +409,7 @@ class SimplexTableau implements Serializ
Integer basicRow = getBasicRow(colIndex);
if (basicRow != null && basicRow == 0) {
// if the basic row is found to be the objective function row
- // set the coefficient to 0 -> this case handles unconstrained
+ // set the coefficient to 0 -> this case handles unconstrained
// variables that are still part of the objective function
coefficients[i] = 0;
} else if (basicRows.contains(basicRow)) {