commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dimitri Pourbaix <pourb...@astro.ulb.ac.be>
Subject Re: [math] adding absolute accuracy threshold to integrators
Date Sun, 18 Jan 2009 19:19:02 GMT
On Sun, 18 Jan 2009, Luc Maisonobe wrote:

> The UnivariateRealIntegrator interface shares most of the convergence
> settings that have been put in the new ConvergenceAlgorithm
> super-interface. The only missing part is absolute accuracy settings.
>
> It seems interesting for consistency to follow the same pattern as
> UnivariateRealSolver and UnivariateRealMinimizer and to have
> UnivariateRealIntegrator implement the ConvergenceAlgorithm interface.
>
> The main change would be that in the Romberg, Simpson and Trapezoid
> integrators, the check:
>
>  if (Math.abs(s - olds) <= Math.abs(relativeAccuracy * olds)) {
>   ...
>  }
>
> would be changed to:
>
>  final double error = Math.abs(s - olds);
>  if (error <= Math.abs(relativeAccuracy * olds) &&
>      error < absoluteAccuracy) {
>   ...
>  }

Well, using your notation, it should be changed to

   if (Math.abs(s - olds) <= 2.0 * relativeAccuracy
                                  * (Math.abs(s)+Math.abs(olds)) {
    ...
   }

Dim.
----------------------------------------------------------------------------
Dimitri Pourbaix                         *
Institut d'Astronomie et d'Astrophysique *      Don't worry, be happy
CP 226, office 2.N4.211, building NO     *         and CARPE DIEM.
Universite Libre de Bruxelles            *
Boulevard du Triomphe                    *      Tel : +32-2-650.35.71
  B-1050 Bruxelles                        *      Fax : +32-2-650.42.26
http://sb9.astro.ulb.ac.be/~pourbaix     * mailto:pourbaix@astro.ulb.ac.be

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message