Java Code Examples for org.apache.commons.math3.analysis.MultivariateFunction#value()

The following examples show how to use org.apache.commons.math3.analysis.MultivariateFunction#value() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractSimplex.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Evaluate all the non-evaluated points of the simplex.
 *
 * @param evaluationFunction Evaluation function.
 * @param comparator Comparator to use to sort simplex vertices from best to worst.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException
 * if the maximal number of evaluations is exceeded.
 */
public void evaluate(final MultivariateFunction evaluationFunction,
                     final Comparator<PointValuePair> comparator) {
    // Evaluate the objective function at all non-evaluated simplex points.
    for (int i = 0; i < simplex.length; i++) {
        final PointValuePair vertex = simplex[i];
        final double[] point = vertex.getPointRef();
        if (Double.isNaN(vertex.getValue())) {
            simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false);
        }
    }

    // Sort the simplex from best to worst.
    Arrays.sort(simplex, comparator);
}
 
Example 2
Source File: AbstractSimplex.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Evaluate all the non-evaluated points of the simplex.
 *
 * @param evaluationFunction Evaluation function.
 * @param comparator Comparator to use to sort simplex vertices from best to worst.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException
 * if the maximal number of evaluations is exceeded.
 */
public void evaluate(final MultivariateFunction evaluationFunction,
                     final Comparator<PointValuePair> comparator) {
    // Evaluate the objective function at all non-evaluated simplex points.
    for (int i = 0; i < simplex.length; i++) {
        final PointValuePair vertex = simplex[i];
        final double[] point = vertex.getPointRef();
        if (Double.isNaN(vertex.getValue())) {
            simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false);
        }
    }

    // Sort the simplex from best to worst.
    Arrays.sort(simplex, comparator);
}
 
Example 3
Source File: AbstractSimplex.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Evaluate all the non-evaluated points of the simplex.
 *
 * @param evaluationFunction Evaluation function.
 * @param comparator Comparator to use to sort simplex vertices from best to worst.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException
 * if the maximal number of evaluations is exceeded.
 */
public void evaluate(final MultivariateFunction evaluationFunction,
                     final Comparator<PointValuePair> comparator) {
    // Evaluate the objective function at all non-evaluated simplex points.
    for (int i = 0; i < simplex.length; i++) {
        final PointValuePair vertex = simplex[i];
        final double[] point = vertex.getPointRef();
        if (Double.isNaN(vertex.getValue())) {
            simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false);
        }
    }

    // Sort the simplex from best to worst.
    Arrays.sort(simplex, comparator);
}
 
Example 4
Source File: AbstractSimplex.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Evaluate all the non-evaluated points of the simplex.
 *
 * @param evaluationFunction Evaluation function.
 * @param comparator Comparator to use to sort simplex vertices from best to worst.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException
 * if the maximal number of evaluations is exceeded.
 */
public void evaluate(final MultivariateFunction evaluationFunction,
                     final Comparator<PointValuePair> comparator) {
    // Evaluate the objective function at all non-evaluated simplex points.
    for (int i = 0; i < simplex.length; i++) {
        final PointValuePair vertex = simplex[i];
        final double[] point = vertex.getPointRef();
        if (Double.isNaN(vertex.getValue())) {
            simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false);
        }
    }

    // Sort the simplex from best to worst.
    Arrays.sort(simplex, comparator);
}
 
Example 5
Source File: AbstractSimplex.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Evaluate all the non-evaluated points of the simplex.
 *
 * @param evaluationFunction Evaluation function.
 * @param comparator Comparator to use to sort simplex vertices from best to worst.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException
 * if the maximal number of evaluations is exceeded.
 */
public void evaluate(final MultivariateFunction evaluationFunction,
                     final Comparator<PointValuePair> comparator) {
    // Evaluate the objective function at all non-evaluated simplex points.
    for (int i = 0; i < simplex.length; i++) {
        final PointValuePair vertex = simplex[i];
        final double[] point = vertex.getPointRef();
        if (Double.isNaN(vertex.getValue())) {
            simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false);
        }
    }

    // Sort the simplex from best to worst.
    Arrays.sort(simplex, comparator);
}
 
Example 6
Source File: AbstractSimplex.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Evaluate all the non-evaluated points of the simplex.
 *
 * @param evaluationFunction Evaluation function.
 * @param comparator Comparator to use to sort simplex vertices from best to worst.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException
 * if the maximal number of evaluations is exceeded.
 */
public void evaluate(final MultivariateFunction evaluationFunction,
                     final Comparator<PointValuePair> comparator) {
    // Evaluate the objective function at all non-evaluated simplex points.
    for (int i = 0; i < simplex.length; i++) {
        final PointValuePair vertex = simplex[i];
        final double[] point = vertex.getPointRef();
        if (Double.isNaN(vertex.getValue())) {
            simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false);
        }
    }

    // Sort the simplex from best to worst.
    Arrays.sort(simplex, comparator);
}
 
Example 7
Source File: AbstractSimplex.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Evaluate all the non-evaluated points of the simplex.
 *
 * @param evaluationFunction Evaluation function.
 * @param comparator Comparator to use to sort simplex vertices from best to worst.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException
 * if the maximal number of evaluations is exceeded.
 */
public void evaluate(final MultivariateFunction evaluationFunction,
                     final Comparator<PointValuePair> comparator) {
    // Evaluate the objective function at all non-evaluated simplex points.
    for (int i = 0; i < simplex.length; i++) {
        final PointValuePair vertex = simplex[i];
        final double[] point = vertex.getPointRef();
        if (Double.isNaN(vertex.getValue())) {
            simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false);
        }
    }

    // Sort the simplex from best to worst.
    Arrays.sort(simplex, comparator);
}
 
Example 8
Source File: AbstractSimplex.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Evaluate all the non-evaluated points of the simplex.
 *
 * @param evaluationFunction Evaluation function.
 * @param comparator Comparator to use to sort simplex vertices from best to worst.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException
 * if the maximal number of evaluations is exceeded.
 */
public void evaluate(final MultivariateFunction evaluationFunction,
                     final Comparator<PointValuePair> comparator) {
    // Evaluate the objective function at all non-evaluated simplex points.
    for (int i = 0; i < simplex.length; i++) {
        final PointValuePair vertex = simplex[i];
        final double[] point = vertex.getPointRef();
        if (Double.isNaN(vertex.getValue())) {
            simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false);
        }
    }

    // Sort the simplex from best to worst.
    Arrays.sort(simplex, comparator);
}
 
Example 9
Source File: AbstractSimplex.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Evaluate all the non-evaluated points of the simplex.
 *
 * @param evaluationFunction Evaluation function.
 * @param comparator Comparator to use to sort simplex vertices from best to worst.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException
 * if the maximal number of evaluations is exceeded.
 */
public void evaluate(final MultivariateFunction evaluationFunction,
                     final Comparator<PointValuePair> comparator) {
    // Evaluate the objective function at all non-evaluated simplex points.
    for (int i = 0; i < simplex.length; i++) {
        final PointValuePair vertex = simplex[i];
        final double[] point = vertex.getPointRef();
        if (Double.isNaN(vertex.getValue())) {
            simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false);
        }
    }

    // Sort the simplex from best to worst.
    Arrays.sort(simplex, comparator);
}
 
Example 10
Source File: AbstractSimplex.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Evaluate all the non-evaluated points of the simplex.
 *
 * @param evaluationFunction Evaluation function.
 * @param comparator Comparator to use to sort simplex vertices from best to worst.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException
 * if the maximal number of evaluations is exceeded.
 */
public void evaluate(final MultivariateFunction evaluationFunction,
                     final Comparator<PointValuePair> comparator) {
    // Evaluate the objective function at all non-evaluated simplex points.
    for (int i = 0; i < simplex.length; i++) {
        final PointValuePair vertex = simplex[i];
        final double[] point = vertex.getPointRef();
        if (Double.isNaN(vertex.getValue())) {
            simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false);
        }
    }

    // Sort the simplex from best to worst.
    Arrays.sort(simplex, comparator);
}
 
Example 11
Source File: AbstractSimplex.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Evaluate all the non-evaluated points of the simplex.
 *
 * @param evaluationFunction Evaluation function.
 * @param comparator Comparator to use to sort simplex vertices from best to worst.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException
 * if the maximal number of evaluations is exceeded.
 */
public void evaluate(final MultivariateFunction evaluationFunction,
                     final Comparator<PointValuePair> comparator) {
    // Evaluate the objective function at all non-evaluated simplex points.
    for (int i = 0; i < simplex.length; i++) {
        final PointValuePair vertex = simplex[i];
        final double[] point = vertex.getPointRef();
        if (Double.isNaN(vertex.getValue())) {
            simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false);
        }
    }

    // Sort the simplex from best to worst.
    Arrays.sort(simplex, comparator);
}
 
Example 12
Source File: AbstractSimplex.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Evaluate all the non-evaluated points of the simplex.
 *
 * @param evaluationFunction Evaluation function.
 * @param comparator Comparator to use to sort simplex vertices from best to worst.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException
 * if the maximal number of evaluations is exceeded.
 */
public void evaluate(final MultivariateFunction evaluationFunction,
                     final Comparator<PointValuePair> comparator) {
    // Evaluate the objective function at all non-evaluated simplex points.
    for (int i = 0; i < simplex.length; i++) {
        final PointValuePair vertex = simplex[i];
        final double[] point = vertex.getPointRef();
        if (Double.isNaN(vertex.getValue())) {
            simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false);
        }
    }

    // Sort the simplex from best to worst.
    Arrays.sort(simplex, comparator);
}
 
Example 13
Source File: AbstractSimplex.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Evaluate all the non-evaluated points of the simplex.
 *
 * @param evaluationFunction Evaluation function.
 * @param comparator Comparator to use to sort simplex vertices from best to worst.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException
 * if the maximal number of evaluations is exceeded.
 */
public void evaluate(final MultivariateFunction evaluationFunction,
                     final Comparator<PointValuePair> comparator) {
    // Evaluate the objective function at all non-evaluated simplex points.
    for (int i = 0; i < simplex.length; i++) {
        final PointValuePair vertex = simplex[i];
        final double[] point = vertex.getPointRef();
        if (Double.isNaN(vertex.getValue())) {
            simplex[i] = new PointValuePair(point, evaluationFunction.value(point), false);
        }
    }

    // Sort the simplex from best to worst.
    Arrays.sort(simplex, comparator);
}