Package org.apache.commons.math.optimization

Examples of org.apache.commons.math.optimization.OptimizationException


                for (int i = 0; i < cols; ++i) {
                    point[i] += dX[i];
                }

            } catch(InvalidMatrixException e) {
                throw new OptimizationException("unable to solve: singular problem");
            }

            // check convergence
            if (previous != null) {
                converged = checker.converged(getIterations(), previous, current);
View Full Code Here


                }

                // tests for termination and stringent tolerances
                // (2.2204e-16 is the machine epsilon for IEEE754)
                if ((Math.abs(actRed) <= 2.2204e-16) && (preRed <= 2.2204e-16) && (ratio <= 2.0)) {
                    throw new OptimizationException("cost relative tolerance is too small ({0})," +
                            " no further reduction in the" +
                            " sum of squares is possible",
                            costRelativeTolerance);
                } else if (delta <= 2.2204e-16 * xNorm) {
                    throw new OptimizationException("parameters relative tolerance is too small" +
                            " ({0}), no further improvement in" +
                            " the approximate solution is possible",
                            parRelativeTolerance);
                } else if (maxCosine <= 2.2204e-16)  {
                    throw new OptimizationException("orthogonality tolerance is too small ({0})," +
                            " solution is orthogonal to the jacobian",
                            orthoTolerance);
                }

            }
View Full Code Here

     * of iterations is exceeded
     */
    protected void incrementIterationsCounter()
        throws OptimizationException {
        if (++iterations > maxIterations) {
            throw new OptimizationException(new MaxIterationsExceededException(maxIterations));
        }
    }
View Full Code Here

                }

                // tests for termination and stringent tolerances
                // (2.2204e-16 is the machine epsilon for IEEE754)
                if ((Math.abs(actRed) <= 2.2204e-16) && (preRed <= 2.2204e-16) && (ratio <= 2.0)) {
                    throw new OptimizationException("cost relative tolerance is too small ({0})," +
                            " no further reduction in the" +
                            " sum of squares is possible",
                            costRelativeTolerance);
                } else if (delta <= 2.2204e-16 * xNorm) {
                    throw new OptimizationException("parameters relative tolerance is too small" +
                            " ({0}), no further improvement in" +
                            " the approximate solution is possible",
                            parRelativeTolerance);
                } else if (maxCosine <= 2.2204e-16)  {
                    throw new OptimizationException("orthogonality tolerance is too small ({0})," +
                            " solution is orthogonal to the jacobian",
                            orthoTolerance);
                }

            }
View Full Code Here

                for (int j = k; j < jacobian.length; ++j) {
                    double aki = jacobian[j][permutation[i]];
                    norm2 += aki * aki;
                }
                if (Double.isInfinite(norm2) || Double.isNaN(norm2)) {
                    throw new OptimizationException(
                            "unable to perform Q.R decomposition on the {0}x{1} jacobian matrix",
                            rows, cols);
                }
                if (norm2 > ak2) {
                    nextColumn = i;
View Full Code Here

                }

            }

        } catch (ConvergenceException ce) {
            throw new OptimizationException(ce);
        }
    }
View Full Code Here

            yB = f.value(b);
            if (yA * yB <= 0) {
                return b;
            }
        }
        throw new OptimizationException("unable to bracket optimum in line search");
    }
View Full Code Here

     * of iterations is exceeded
     */
    protected void incrementIterationsCounter()
        throws OptimizationException {
        if (++iterations > maxIterations) {
            throw new OptimizationException(new MaxIterationsExceededException(maxIterations));
        }
    }
View Full Code Here

     * of iterations is exceeded
     */
    protected void incrementIterationsCounter()
        throws OptimizationException {
        if (++iterations > maxIterations) {
            throw new OptimizationException(new MaxIterationsExceededException(maxIterations));
        }
    }
View Full Code Here

            // compute the covariances matrix
            RealMatrix inverse =
                new LUDecompositionImpl(MatrixUtils.createRealMatrix(jTj)).getSolver().getInverse();
            return inverse.getData();
        } catch (InvalidMatrixException ime) {
            throw new OptimizationException("unable to compute covariances: singular problem");
        }

    }
View Full Code Here

TOP

Related Classes of org.apache.commons.math.optimization.OptimizationException

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.