You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Luc Maisonobe <Lu...@free.fr> on 2009/01/18 19:05:01 UTC
[math] adding absolute accuracy threshold to integrators
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) {
...
}
If nobody complains, I will do this change soon.
Luc
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [math] adding absolute accuracy threshold to integrators
Posted by Phil Steitz <ph...@gmail.com>.
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) {
> ...
> }
>
> If nobody complains, I will do this change soon.
>
+1
Phil
> Luc
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [math] adding absolute accuracy threshold to integrators
Posted by Dimitri Pourbaix <po...@astro.ulb.ac.be>.
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