Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 70831 invoked from network); 18 Jan 2010 16:31:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Jan 2010 16:31:43 -0000 Received: (qmail 79310 invoked by uid 500); 18 Jan 2010 16:31:43 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 79227 invoked by uid 500); 18 Jan 2010 16:31:43 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 79218 invoked by uid 99); 18 Jan 2010 16:31:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jan 2010 16:31:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jan 2010 16:31:40 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 51A5823888EC; Mon, 18 Jan 2010 16:31:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r900451 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/events/EventHandler.java Date: Mon, 18 Jan 2010 16:31:19 -0000 To: commits@commons.apache.org From: luc@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100118163119.51A5823888EC@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: luc Date: Mon Jan 18 16:31:18 2010 New Revision: 900451 URL: http://svn.apache.org/viewvc?rev=900451&view=rev Log: improved javadoc Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/events/EventHandler.java Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/events/EventHandler.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/events/EventHandler.java?rev=900451&r1=900450&r2=900451&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/events/EventHandler.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/events/EventHandler.java Mon Jan 18 16:31:18 2010 @@ -21,7 +21,7 @@ * during ODE integration. * *

Some events can be triggered at discrete times as an ODE problem - * is solved. These occurs for example when the integration process + * is solved. This occurs for example when the integration process * should be stopped as some state is reached (G-stop facility) when the * precise date is unknown a priori, or when the derivatives have * discontinuities, or simply when the user wants to monitor some @@ -101,10 +101,10 @@ /** Handle an event and choose what to do next. *

This method is called when the integrator has accepted a step - * ending exactly on a sign change of the function, just before the - * step handler itself is called. It allows the user to update his - * internal data to acknowledge the fact the event has been handled - * (for example setting a flag in the {@link + * ending exactly on a sign change of the function, just before + * the step handler itself is called (see below for scheduling). It + * allows the user to update his internal data to acknowledge the fact + * the event has been handled (for example setting a flag in the {@link * org.apache.commons.math.ode.FirstOrderDifferentialEquations * differential equations} to switch the derivatives computation in * case of discontinuity), or to direct the integrator to either stop @@ -126,6 +126,30 @@ * will continue. * + *

The scheduling between this method and the {@link + * org.apache.commons.math.ode.sampling.StepHandler StepHandler} method {@link + * org.apache.commons.math.ode.sampling.StepNormalizerStepHandler#handleStep( + * org.apache.commons.math.ode.sampling.StepInterpolator, boolean) + * handleStep(interpolator, isLast)} is to call this method first and + * handleStep afterwards. This scheduling allows the integrator to + * pass true as the isLast parameter to the step + * handler to make it aware the step will be the last one if this method + * returns {@link #STOP}. As the interpolator may be used to navigate back + * throughout the last step (as {@link + * org.apache.commons.math.ode.sampling.StepNormalizerStepNormalizer + * StepNormalizer} does for example), user code called by this method and user + * code called by step handlers may experience apparently out of order values + * of the independent time variable. As an example, if the same user object + * implements both this {@link EventHandler EventHandler} interface and the + * {@link org.apache.commons.math.ode.sampling.FixedStepHandler FixedStepHandler} + * interface, a forward integration may call its + * eventOccurred method with t = 10 first and call its + * handleStep method with t = 9 afterwards. Such out of order + * calls are limited to the size of the integration step for {@link + * org.apache.commons.math.ode.sampling.StepHandler variable step handlers} and + * to the size of the fixed step for {@link + * org.apache.commons.math.ode.sampling.FixedStepHandler fixed step handlers}.

+ * @param t current value of the independent time variable * @param y array containing the current value of the state vector * @param increasing if true, the value of the switching function increases