Package org.apache.commons.math

Examples of org.apache.commons.math.FunctionEvaluationException


     */
    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

    public double value(final double[] point) throws FunctionEvaluationException {

        // compute residuals
        final double[] residuals = function.value(point);
        if (residuals.length != observations.length) {
            throw new FunctionEvaluationException(point, "dimension mismatch {0} != {1}",
                                                  residuals.length, observations.length);
        }
        for (int i = 0; i < residuals.length; ++i) {
            residuals[i] -= observations[i];
        }
View Full Code Here

                        public double value(final double t) throws FunctionEvaluationException {
                            try {
                                interpolator.setInterpolatedTime(t);
                                return handler.g(t, interpolator.getInterpolatedState());
                            } catch (DerivativeException e) {
                                throw new FunctionEvaluationException(e, t);
                            } catch (EventException e) {
                                throw new FunctionEvaluationException(e, t);
                            }
                        }
                    };
                    final BrentSolver solver = new BrentSolver();
                    solver.setAbsoluteAccuracy(convergence);
View Full Code Here

            public double value(double x) throws FunctionEvaluationException {
                try {
                    return cumulativeProbability(x) - p;
                } catch (MathException ex) {
                    throw new FunctionEvaluationException
                        (x, "Error computing cdf", ex);
                }
            }
        };
             
View Full Code Here

     * of the spline function (less than the smallest knot point or greater
     * than or equal to the largest knot point)
     */
    public double value(double v) throws FunctionEvaluationException {
        if (v < knots[0] || v >= knots[n]) {
            throw new FunctionEvaluationException(v,"Argument outside domain");
        }
        int i = Arrays.binarySearch(knots, v);
        if (i < 0) {
            i = -i - 2;
        }
View Full Code Here

    public double value(final double[] point) throws FunctionEvaluationException {

        // compute residuals
        final double[] residuals = function.value(point);
        if (residuals.length != observations.length) {
            throw new FunctionEvaluationException(point, "dimension mismatch {0} != {1}",
                                                  residuals.length, observations.length);
        }
        for (int i = 0; i < residuals.length; ++i) {
            residuals[i] -= observations[i];
        }
View Full Code Here

                        public double value(final double t) throws FunctionEvaluationException {
                            try {
                                interpolator.setInterpolatedTime(t);
                                return handler.g(t, interpolator.getInterpolatedState());
                            } catch (DerivativeException e) {
                                throw new FunctionEvaluationException(e, t);
                            } catch (EventException e) {
                                throw new FunctionEvaluationException(e, t);
                            }
                        }
                    };
                    final BrentSolver solver = new BrentSolver();
                    solver.setAbsoluteAccuracy(convergence);
View Full Code Here

     */
    protected void updateJacobian() throws FunctionEvaluationException {
        ++jacobianEvaluations;
        jacobian = jF.value(point);
        if (jacobian.length != rows) {
            throw new FunctionEvaluationException(point, "dimension mismatch {0} != {1}",
                                                  jacobian.length, rows);
        }
        for (int i = 0; i < rows; i++) {
            final double[] ji = jacobian[i];
            final double factor = -Math.sqrt(residualsWeights[i]);
View Full Code Here

     */
    protected void updateResidualsAndCost()
        throws FunctionEvaluationException {

        if (++objectiveEvaluations > maxEvaluations) {
            throw new FunctionEvaluationException(new MaxEvaluationsExceededException(maxEvaluations),
                                                  point);
        }
        objective = function.value(point);
        if (objective.length != rows) {
            throw new FunctionEvaluationException(point, "dimension mismatch {0} != {1}",
                                                  objective.length, rows);
        }
        cost = 0;
        int index = 0;
        for (int i = 0; i < rows; i++) {
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.