commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <>
Subject [jira] [Commented] (MATH-655) General framework for iterative algorithms
Date Fri, 02 Sep 2011 12:52:10 GMT


Gilles commented on MATH-655:

There are many families of algorithms that have iterative implementations but also share _other_
basic functionality (like the "solvers" family or the "optimizers" family). But there is no
multiple inheritance in Java; so, an implementation that would benefit from the boiler-plate
code of {{IterativeAlgorithm}} cannot inherit from it and also from something else (like a
solver base class).
A solution would be that all these families have {{IterativeAlgorithm}} as their common ancestor;
but it would have major (IMHO) drawbacks:
* An implementation detail (e.g. the fact that some root solver performs iterations) becomes
most prominent.
* Some specific implementations that could in fact be "non-iterative" would nevertheless look
like they are.

So, how did you intend to plug {{IterativeAlgorithm}} into the design?
The presence of a "protected" method like {{resetIterationCount}} means that it is to be inherited
from (i.e. the above "solution").

> General framework for iterative algorithms
> ------------------------------------------
>                 Key: MATH-655
>                 URL:
>             Project: Commons Math
>          Issue Type: New Feature
>    Affects Versions: 3.0
>            Reporter: S├ębastien Brisard
>            Priority: Minor
>              Labels: algorithm, events
>         Attachments:
> Following the thread [Monitoring iterative algorithms|],
here is a first attempt at defining a general enough framework for iterative algorithms at
large. At the moment, the classes provide support for
> * maximum number of iterations
> * events handling
> ** initialization event (prior to entering the main loop),
> ** iteration event (after completion of one iteration),
> ** termination event (after termination of the main loop).
> These classes do not yet provide support for a stopping criterion.
> Some points worth to note
> * For the time being, the classes are part of the o.a.c.m.linear package.
> * For the time being, {{IterativeAlgorithm.incrementIterationCount()}} throws a {{TooManyEvaluationsException}}.
If the proposed new feature is integrated into CM, then a proper {{TooManyIterationsException}}
should be created, from which the former could derive.

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message