[ 
https://issues.apache.org/jira/browse/MATH-811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462565#comment-13462565
 ] 

Yannick TANGUY edited comment on MATH-811 at 9/25/12 7:40 PM:
--------------------------------------------------------------

Hi Thomas and Dennis,

Ok, I'll redo the patch. Before, I can explain the main changes : 
In the interface EventHandler :
- we added a {noformat}int getSlopeSelection(){noformat} method, which returns 
{noformat}EventHandler.INCREASING,EventHandler.DECREASING, 
EventHandler.INCREASING_DECREASING{noformat} wether we want to trigger events 
related to increasing "zero" events (resp. decreasing, or both).
- the {noformat}boolean EventState.evaluateState(StepInterpolator){noformat} 
method has been modified (in the main conditinnal, when we expect an event) to 
add the following code (a new conditionnal structure) : 
{noformat}
                   // slope selection
                   int slope = handler.getSlopeSelection();
                   if (slope == EventHandler.INCREASING_DECREASING
                            || ((forward ^ !increasing) ^ slope == 
EventHandler.DECREASING)) {
// ... an event is expected -> this calls the solver
}
{noformat}

This modification needs to adapt implementations of EventHandler (mainly in 
ode.events & ode.stiff test packages)
                
      was (Author: ytanguy):
    Hi Thomas and Dennis,

Ok, I'll redo the patch. Before, I can explain the main changes : 
In the interface EventHandler :
- we added a {noformat}int getSlopeSelection(){noformat} method, which returns 
{noformat}EventHandler.INCREASING,{noformat}EventHandler.DECREASING, 
EventHandler.INCREASING_DECREASING{noformat} wether we want to trigger events 
related to increasing "zero" events (resp. decreasing, or both).
- the {noformat}boolean EventState.evaluateState(StepInterpolator){noformat} 
method has been modified (in the main conditinnal, when we expect an event) to 
add the following code (a new conditionnal structure) : 
{noformat}
                   // slope selection
                   int slope = handler.getSlopeSelection();
                   if (slope == EventHandler.INCREASING_DECREASING
                            || ((forward ^ !increasing) ^ slope == 
EventHandler.DECREASING)) {
// ... an event is expected -> this calls the solver
}
{noformat}

This modification needs to adapt implementations of EventHandler (mainly in 
ode.events & ode.stiff test packages)
                  
> Improve event detection by selecting g function slope
> -----------------------------------------------------
>
>                 Key: MATH-811
>                 URL: https://issues.apache.org/jira/browse/MATH-811
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.1
>            Reporter: Yannick TANGUY
>         Attachments: JIRA-811_slope_selection.patch, 
> JIRA-811_slope_selection_with_spaces.patch
>
>
> We would like to select g function slope in CommonsMath event detection 
> feature.
> This would improve event detection for the final user (the possibility to 
> ignore some events, and less computation time) and also correct a bug found 
> while using OREKIT (see https://www.orekit.org/forge/issues/104) in our 
> applications. 
> The modification consists in adding a method (getSlopeSelection() : int) in 
> EventHandler, and modifying one conditionnal in the method evaluateStep 
> (class EventState). 
> We can provide modified code and unitary tests for this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to