Package org.apache.commons.math

Examples of org.apache.commons.math.ConvergenceException


public class ConvergenceExceptionTest extends TestCase {
    /**
     *
     */
    public void testConstructor(){
        ConvergenceException ex = new ConvergenceException();
        assertNull(ex.getCause());
        assertNull(ex.getMessage());
    }
View Full Code Here


    /**
     *
     */
    public void testConstructorMessage(){
        String msg = "message";
        ConvergenceException ex = new ConvergenceException(msg);
        assertNull(ex.getCause());
        assertEquals(msg, ex.getMessage());
    }
View Full Code Here

     */
    public void testConstructorMessageCause(){
        String outMsg = "outer message";
        String inMsg = "inner message";
        Exception cause = new Exception(inMsg);
        ConvergenceException ex = new ConvergenceException(outMsg, cause);
        assertEquals(outMsg, ex.getMessage());
        assertEquals(cause, ex.getCause());
    }
View Full Code Here

     *
     */
    public void testConstructorCause(){
        String inMsg = "inner message";
        Exception cause = new Exception(inMsg);
        ConvergenceException ex = new ConvergenceException(cause);
        assertEquals(cause, ex.getCause());
    }
View Full Code Here

           
            x0 = x1;
            ++i;
        }
       
        throw new ConvergenceException
            ("Maximum number of iterations exceeded " + i);
    }
View Full Code Here

            numIterations++ ;
        } while ((fa * fb > 0.0) && (numIterations < maximumIterations) &&
                ((a > lowerBound) || (b < upperBound)));
  
        if (fa * fb >= 0.0 ) {
            throw new ConvergenceException
            ("Number of iterations= " + numIterations +
              " maximum iterations= "  + maximumIterations +
              " initial= " + initial + " lowerBound=" + lowerBound +
              " upperBound=" + upperBound + " final a value=" + a +
              " final b value=" + b + " f(a)=" + fa + " f(b)=" + fb);
View Full Code Here

                delta = x1 - x0;
                oldDelta = delta;
            }
            i++;
        }
        throw new ConvergenceException("Maximum number of iterations exceeded.");
    }
View Full Code Here

                y2 = y0;
            }
            oldDelta = x2 - x1;
            i++;
        }
        throw new ConvergenceException("Maximal iteration number exceeded" + i);
    }
View Full Code Here

                return m;
            }
            ++i;
        }
       
        throw new ConvergenceException
            ("Maximum number of iterations exceeded: "  + maximalIterationCount);
    }
View Full Code Here

                // update partial sum
                sum = sum + an;
            }
            if (n >= maxIterations) {
                throw new ConvergenceException(
                    "maximum number of iterations reached");
            } else {
                ret = Math.exp(-x + (a * Math.log(x)) - logGamma(a)) * sum;
            }
        }
View Full Code Here

TOP

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

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.