Class UnivariateRealIntegratorImpl

    • Field Detail

      • minimalIterationCount

        protected int minimalIterationCount
        minimum number of iterations
      • defaultMinimalIterationCount

        protected int defaultMinimalIterationCount
        default minimum number of iterations
      • resultComputed

        protected boolean resultComputed
        indicates whether an integral has been computed
      • result

        protected double result
        the last computed integral
    • Constructor Detail

      • UnivariateRealIntegratorImpl

        @Deprecated
        protected UnivariateRealIntegratorImpl​(UnivariateRealFunction f,
                                               int defaultMaximalIterationCount)
                                        throws java.lang.IllegalArgumentException
        Deprecated.
        as of 2.0 the integrand function is passed as an argument to the UnivariateRealIntegrator.integrate(UnivariateRealFunction, double, double)method.
        Construct an integrator with given iteration count and accuracy.
        Parameters:
        f - the integrand function
        defaultMaximalIterationCount - maximum number of iterations
        Throws:
        java.lang.IllegalArgumentException - if f is null or the iteration limits are not valid
      • UnivariateRealIntegratorImpl

        protected UnivariateRealIntegratorImpl​(int defaultMaximalIterationCount)
                                        throws java.lang.IllegalArgumentException
        Construct an integrator with given iteration count and accuracy.
        Parameters:
        defaultMaximalIterationCount - maximum number of iterations
        Throws:
        java.lang.IllegalArgumentException - if f is null or the iteration limits are not valid
    • Method Detail

      • getResult

        public double getResult()
                         throws java.lang.IllegalStateException
        Access the last computed integral.
        Specified by:
        getResult in interface UnivariateRealIntegrator
        Returns:
        the last computed integral
        Throws:
        java.lang.IllegalStateException - if no integral has been computed
      • setResult

        protected final void setResult​(double newResult,
                                       int iterationCount)
        Convenience function for implementations.
        Parameters:
        newResult - the result to set
        iterationCount - the iteration count to set
      • clearResult

        protected final void clearResult()
        Convenience function for implementations.
      • setMinimalIterationCount

        public void setMinimalIterationCount​(int count)
        Set the lower limit for the number of iterations.

        Minimal iteration is needed to avoid false early convergence, e.g. the sample points happen to be zeroes of the function. Users can use the default value or choose one that they see as appropriate.

        A ConvergenceException will be thrown if this number is not met.

        Specified by:
        setMinimalIterationCount in interface UnivariateRealIntegrator
        Parameters:
        count - minimum number of iterations
      • verifyInterval

        protected void verifyInterval​(double lower,
                                      double upper)
                               throws java.lang.IllegalArgumentException
        Verifies that the endpoints specify an interval.
        Parameters:
        lower - lower endpoint
        upper - upper endpoint
        Throws:
        java.lang.IllegalArgumentException - if not interval
      • verifyIterationCount

        protected void verifyIterationCount()
                                     throws java.lang.IllegalArgumentException
        Verifies that the upper and lower limits of iterations are valid.
        Throws:
        java.lang.IllegalArgumentException - if not valid