Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C59557FAB for ; Wed, 7 Sep 2011 01:28:34 +0000 (UTC) Received: (qmail 78784 invoked by uid 500); 7 Sep 2011 01:28:34 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 78623 invoked by uid 500); 7 Sep 2011 01:28:33 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 78615 invoked by uid 99); 7 Sep 2011 01:28:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Sep 2011 01:28:33 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Sep 2011 01:28:31 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 4DAE8844DC for ; Wed, 7 Sep 2011 01:28:10 +0000 (UTC) Date: Wed, 7 Sep 2011 01:28:10 +0000 (UTC) From: =?utf-8?Q?S=C3=A9bastien_Brisard_=28JIRA=29?= To: issues@commons.apache.org Message-ID: <1070610709.23092.1315358890314.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1101647173.9045.1314926770159.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (MATH-655) General framework for iterative algorithms MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MATH-655?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D130985= 20#comment-13098520 ]=20 S=C3=A9bastien Brisard commented on MATH-655: ---------------------------------------- In the attached file {{iteration-manager.zip}} is a new version which follo= ws Phil's suggestion to use composition instead of inheritance. We now have= three classes * {{IterationManager}}: besides the methods to add/remove listeners, fire e= vents and manage the iteration count, I've added {{shouldStop()}}, which re= turns {{true}} if the iterations should be stopped. This method should be c= alled by the iterative algorithm at the end of each iteration; it allows th= e implementation of a custom stopping criterion. What do you think of this = option (?) * {{IterationListener}} * {{IterationEvent}} I should also add that I took Greg's suggestion into account, and replaced = {{ArrayList}} by {{CopyOnWriteArrayList}}. Finally, you will see that {{Too= ManyEvaluationsException}} is potentially thrown. In the final version of t= hese classes, I'll define a proper {{TooManyIterationsException}}, with loc= alized message and so on. > General framework for iterative algorithms > ------------------------------------------ > > Key: MATH-655 > URL: https://issues.apache.org/jira/browse/MATH-655 > Project: Commons Math > Issue Type: New Feature > Affects Versions: 3.0 > Reporter: S=C3=A9bastien Brisard > Priority: Minor > Labels: algorithm, events > Attachments: iteration-manager.zip, iterative-algorithm.zip > > > Following the thread [Monitoring iterative algorithms|http://mail-archive= s.apache.org/mod_mbox/commons-dev/201108.mbox/%3CCAGRH7HrgcgoBA=3DjcoKovjiQ= U=3DTjpQHnspBkOGNCu7oDdKk=3DK4w@mail.gmail.com%3E], 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()}} th= rows a {{TooManyEvaluationsException}}. If the proposed new feature is inte= grated into CM, then a proper {{TooManyIterationsException}} should be crea= ted, from which the former could derive. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira