Package org.apache.commons.math

Examples of org.apache.commons.math.FunctionEvaluationException


     * of iterations is exceeded
     */
    protected double computeObjectiveValue(final double[] evaluationPoint)
        throws FunctionEvaluationException {
        if (++evaluations > maxEvaluations) {
            throw new FunctionEvaluationException(new MaxEvaluationsExceededException(maxEvaluations),
                                                  evaluationPoint);
        }
        return function.value(evaluationPoint);
    }
View Full Code Here


     * @exception IllegalArgumentException if the start point dimension is wrong
     */
    protected double evaluate(final double[] x)
        throws FunctionEvaluationException, IllegalArgumentException {
        if (++evaluations > maxEvaluations) {
            throw new FunctionEvaluationException(new MaxEvaluationsExceededException(maxEvaluations),
                                                  x);
        }
        return f.value(x);
    }
View Full Code Here

            public double value(double x) throws FunctionEvaluationException {
                double ret = Double.NaN;
                try {
                    ret = cumulativeProbability(x) - p;
                } catch (MathException ex) {
                    throw new FunctionEvaluationException(ex, x, ex.getPattern(), ex.getArguments());
                }
                if (Double.isNaN(ret)) {
                    throw new FunctionEvaluationException(x,
                        "Cumulative probability function returned NaN for argument {0} p = {1}", x, p);
                }
                return ret;
            }
        };
View Full Code Here

     */
    public double value(double z) throws FunctionEvaluationException {
        try {
            return evaluate(x, y, z);
        } catch (DuplicateSampleAbscissaException e) {
            throw new FunctionEvaluationException(e, z, e.getPattern(), e.getArguments());
        }
    }
View Full Code Here

     */
    protected double computeObjectiveValue(final UnivariateRealFunction f,
                                           final double point)
        throws FunctionEvaluationException {
        if (++evaluations > maxEvaluations) {
            throw new FunctionEvaluationException(new MaxEvaluationsExceededException(maxEvaluations),
                                                  point);
        }
        return f.value(point);
    }
View Full Code Here

    private double checkedCumulativeProbability(int argument) throws FunctionEvaluationException {
        double result = Double.NaN;
        try {
            result = cumulativeProbability(argument);
        } catch (MathException ex) {
            throw new FunctionEvaluationException(ex, argument, ex.getPattern(), ex.getArguments());
        }
        if (Double.isNaN(result)) {
            throw new FunctionEvaluationException(argument,
                "Discrete cumulative probability function returned NaN for argument {0}", argument);
        }
        return result;
    }
View Full Code Here

        }
        public double g(double t, double[] y) throws FunctionEvaluationException {
          double middle = (pb.getInitialTime() + pb.getFinalTime()) / 2;
          double offset = t - middle;
          if (offset > 0) {
            throw new FunctionEvaluationException(t);
          }
          return offset;
        }
        public void resetState(double t, double[] y) {
        }
View Full Code Here

     */
    public double value(double z) throws FunctionEvaluationException {
        try {
            return evaluate(x, y, z);
        } catch (DuplicateSampleAbscissaException e) {
            throw new FunctionEvaluationException(z, e.getPattern(), e.getArguments(), e);
        }
    }
View Full Code Here

            public double value(double x) throws FunctionEvaluationException {
                try {
                    return cumulativeProbability(x) - p;
                } catch (MathException ex) {
                    throw new FunctionEvaluationException(x, ex.getPattern(), ex.getArguments(), ex);
                }
            }
        };
             
        // Try to bracket root, test domain endoints if this fails    
View Full Code Here

TOP

Related Classes of org.apache.commons.math.FunctionEvaluationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.