1dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond/*
2dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Licensed to the Apache Software Foundation (ASF) under one or more
3dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * contributor license agreements.  See the NOTICE file distributed with
4dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * this work for additional information regarding copyright ownership.
5dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * The ASF licenses this file to You under the Apache License, Version 2.0
6dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * (the "License"); you may not use this file except in compliance with
7dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * the License.  You may obtain a copy of the License at
8dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
9dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *      http://www.apache.org/licenses/LICENSE-2.0
10dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
11dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Unless required by applicable law or agreed to in writing, software
12dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * distributed under the License is distributed on an "AS IS" BASIS,
13dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * See the License for the specific language governing permissions and
15dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * limitations under the License.
16dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */
17dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
18dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondpackage org.apache.commons.math.ode.jacobians;
19dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
20dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondimport org.apache.commons.math.ode.events.EventException;
21dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
22dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond/** This interface represents a handler for discrete events triggered
23dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * during ODE integration.
24dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
25dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>Some events can be triggered at discrete times as an ODE problem
26dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * is solved. This occurs for example when the integration process
27dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * should be stopped as some state is reached (G-stop facility) when the
28dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * precise date is unknown a priori, or when the derivatives have
29dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * discontinuities, or simply when the user wants to monitor some
30dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * states boundaries crossings.
31dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * </p>
32dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
33dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>These events are defined as occurring when a <code>g</code>
34dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * switching function sign changes.</p>
35dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
36dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>Since events are only problem-dependent and are triggered by the
37dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * independent <i>time</i> variable and the state vector, they can
38dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * occur at virtually any time, unknown in advance. The integrators will
39dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * take care to avoid sign changes inside the steps, they will reduce
40dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * the step size when such an event is detected in order to put this
41dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * event exactly at the end of the current step. This guarantees that
42dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * step interpolation (which always has a one step scope) is relevant
43dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * even in presence of discontinuities. This is independent from the
44dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * stepsize control provided by integrators that monitor the local
45dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * error (this event handling feature is available for all integrators,
46dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * including fixed step ones).</p>
47dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
48dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>Note that is is possible to register a {@link
49dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * org.apache.commons.math.ode.events.EventHandler classical event handler}
50dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * in the low level integrator used to build a {@link FirstOrderIntegratorWithJacobians}
51dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * rather than implementing this class. The event handlers registered at low level
52dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * will see the big compound state whether the event handlers defined by this interface
53dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * see the original state, and its jacobians in separate arrays.</p>
54dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
55dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>The compound state is guaranteed to contain the original state in the first
56dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * elements, followed by the jacobian with respect to initial state (in row order),
57dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * followed by the jacobian with respect to parameters (in row order). If for example
58dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * the original state dimension is 6 and there are 3 parameters, the compound state will
59dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * be a 60 elements array. The first 6 elements will be the original state, the next 36
60dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * elements will be the jacobian with respect to initial state, and the remaining 18 elements
61dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * will be the jacobian with respect to parameters.</p>
62dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
63dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>Dealing with low level event handlers is cumbersome if one really needs the jacobians
64dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * in these methods, but it also prevents many data being copied back and forth between
65dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * state and jacobians on one side and compound state on the other side. So for performance
66dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * reasons, it is recommended to use this interface <em>only</em> if jacobians are really
67dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * needed and to use lower level handlers if only state is needed.</p>
68dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
69dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @version $Revision: 1037341 $ $Date: 2010-11-20 22:58:35 +0100 (sam. 20 nov. 2010) $
70dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @since 2.1
71dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @deprecated as of 2.2 the complete package is deprecated, it will be replaced
72dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * in 3.0 by a completely rewritten implementation
73dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */
74dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond@Deprecated
75dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondpublic interface EventHandlerWithJacobians  {
76dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
77dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /** Stop indicator.
78dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * <p>This value should be used as the return value of the {@link
79dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * #eventOccurred eventOccurred} method when the integration should be
80dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * stopped after the event ending the current step.</p>
81dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
82dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    int STOP = 0;
83dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
84dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /** Reset state indicator.
85dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * <p>This value should be used as the return value of the {@link
86dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * #eventOccurred eventOccurred} method when the integration should
87dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * go on after the event ending the current step, with a new state
88dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * vector (which will be retrieved thanks to the {@link #resetState
89dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * resetState} method).</p>
90dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
91dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    int RESET_STATE = 1;
92dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
93dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /** Reset derivatives indicator.
94dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * <p>This value should be used as the return value of the {@link
95dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * #eventOccurred eventOccurred} method when the integration should
96dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * go on after the event ending the current step, with a new derivatives
97dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * vector (which will be retrieved thanks to the {@link
98dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * org.apache.commons.math.ode.FirstOrderDifferentialEquations#computeDerivatives}
99dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * method).</p>
100dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
101dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    int RESET_DERIVATIVES = 2;
102dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
103dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /** Continue indicator.
104dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * <p>This value should be used as the return value of the {@link
105dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * #eventOccurred eventOccurred} method when the integration should go
106dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * on after the event ending the current step.</p>
107dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
108dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    int CONTINUE = 3;
109dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
110dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /** Compute the value of the switching function.
111dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
112dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * <p>The discrete events are generated when the sign of this
113dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * switching function changes. The integrator will take care to change
114dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * the stepsize in such a way these events occur exactly at step boundaries.
115dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * The switching function must be continuous in its roots neighborhood
116dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * (but not necessarily smooth), as the integrator will need to find its
117dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * roots to locate precisely the events.</p>
118dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
119dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param t current value of the independent <i>time</i> variable
120dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param y array containing the current value of the state vector
121dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param dydy0 array containing the current value of the jacobian of
122dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * the state vector with respect to initial state
123dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param dydp array containing the current value of the jacobian of
124dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * the state vector with respect to parameters
125dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @return value of the g switching function
126dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @exception EventException if the switching function cannot be evaluated
127dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
128dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    double g(double t, double[] y, double[][] dydy0, double[][] dydp)
129dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond        throws EventException;
130dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
131dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /** Handle an event and choose what to do next.
132dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
133dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * <p>This method is called when the integrator has accepted a step
134dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * ending exactly on a sign change of the function, just <em>before</em>
135dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * the step handler itself is called (see below for scheduling). It
136dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * allows the user to update his internal data to acknowledge the fact
137dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * the event has been handled (for example setting a flag in the {@link
138dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * org.apache.commons.math.ode.jacobians.ODEWithJacobians
139dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * differential equations} to switch the derivatives computation in
140dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * case of discontinuity), or to direct the integrator to either stop
141dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * or continue integration, possibly with a reset state or derivatives.</p>
142dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
143dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * <ul>
144dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     *   <li>if {@link #STOP} is returned, the step handler will be called
145dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     *   with the <code>isLast</code> flag of the {@link
146dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     *   org.apache.commons.math.ode.jacobians.StepHandlerWithJacobians#handleStep(
147dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     *   StepInterpolatorWithJacobians, boolean) handleStep} method set to true and
148dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     *   the integration will be stopped,</li>
149dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     *   <li>if {@link #RESET_STATE} is returned, the {@link #resetState
150dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     *   resetState} method will be called once the step handler has
151dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     *   finished its task, and the integrator will also recompute the
152dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     *   derivatives,</li>
153dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     *   <li>if {@link #RESET_DERIVATIVES} is returned, the integrator
154dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     *   will recompute the derivatives,
155dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     *   <li>if {@link #CONTINUE} is returned, no specific action will
156dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     *   be taken (apart from having called this method) and integration
157dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     *   will continue.</li>
158dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * </ul>
159dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
160dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * <p>The scheduling between this method and the {@link
161dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * org.apache.commons.math.ode.jacobians.StepHandlerWithJacobians
162dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * StepHandlerWithJacobians} method {@link
163dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * org.apache.commons.math.ode.jacobians.StepHandlerWithJacobians#handleStep(
164dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * StepInterpolatorWithJacobians, boolean) handleStep(interpolator, isLast)}
165dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * is to call this method first and <code>handleStep</code> afterwards. This
166dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * scheduling allows the integrator to pass <code>true</code> as the
167dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * <code>isLast</code> parameter to the step handler to make it aware the step
168dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * will be the last one if this method returns {@link #STOP}. As the
169dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * interpolator may be used to navigate back throughout the last step (as {@link
170dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * org.apache.commons.math.ode.sampling.StepNormalizer StepNormalizer}
171dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * does for example), user code called by this method and user
172dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * code called by step handlers may experience apparently out of order values
173dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * of the independent time variable. As an example, if the same user object
174dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * implements both this {@link EventHandlerWithJacobians EventHandler} interface and the
175dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * {@link org.apache.commons.math.ode.sampling.FixedStepHandler FixedStepHandler}
176dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * interface, a <em>forward</em> integration may call its
177dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * <code>eventOccurred</code> method with t = 10 first and call its
178dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * <code>handleStep</code> method with t = 9 afterwards. Such out of order
179dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * calls are limited to the size of the integration step for {@link
180dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * org.apache.commons.math.ode.sampling.StepHandler variable step handlers} and
181dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * to the size of the fixed step for {@link
182dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * org.apache.commons.math.ode.sampling.FixedStepHandler fixed step handlers}.</p>
183dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
184dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param t current value of the independent <i>time</i> variable
185dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param y array containing the current value of the state vector
186dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param dydy0 array containing the current value of the jacobian of
187dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * the state vector with respect to initial state
188dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param dydp array containing the current value of the jacobian of
189dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * the state vector with respect to parameters
190dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param increasing if true, the value of the switching function increases
191dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * when times increases around event (note that increase is measured with respect
192dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * to physical time, not with respect to integration which may go backward in time)
193dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @return indication of what the integrator should do next, this
194dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * value must be one of {@link #STOP}, {@link #RESET_STATE},
195dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * {@link #RESET_DERIVATIVES} or {@link #CONTINUE}
196dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @exception EventException if the event occurrence triggers an error
197dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
198dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    int eventOccurred(double t, double[] y, double[][] dydy0, double[][] dydp,
199dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond                      boolean increasing) throws EventException;
200dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
201dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /** Reset the state prior to continue the integration.
202dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
203dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * <p>This method is called after the step handler has returned and
204dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * before the next step is started, but only when {@link
205dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * #eventOccurred} has itself returned the {@link #RESET_STATE}
206dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * indicator. It allows the user to reset the state vector for the
207dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * next step, without perturbing the step handler of the finishing
208dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * step. If the {@link #eventOccurred} never returns the {@link
209dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * #RESET_STATE} indicator, this function will never be called, and it is
210dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * safe to leave its body empty.</p>
211dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
212dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param t current value of the independent <i>time</i> variable
213dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param y array containing the current value of the state vector
214dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * the new state should be put in the same array
215dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param dydy0 array containing the current value of the jacobian of
216dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * the state vector with respect to initial state, the new jacobian
217dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * should be put in the same array
218dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param dydp array containing the current value of the jacobian of
219dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * the state vector with respect to parameters, the new jacobian
220dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * should be put in the same array
221dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @exception EventException if the state cannot be reseted
222dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
223dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    void resetState(double t, double[] y, double[][] dydy0, double[][] dydp)
224dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    throws EventException;
225dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
226dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond}
227