diff --git a/ext/cvode/source/nvector.c b/ext/cvode/source/nvector.c index 44934cb28..78de4351e 100755 --- a/ext/cvode/source/nvector.c +++ b/ext/cvode/source/nvector.c @@ -450,20 +450,22 @@ boole N_VConstrMask(N_Vector c, N_Vector x, N_Vector m) for (i=0; i ONEPT5 || (*cd) < -ONEPT5) - if ( (*xd)*(*cd) <= ZERO) { - test = FALSE; - *md = ONE; - } - else - *md = ZERO; - else if ( (*cd) > HALF || (*cd) < -HALF) - if ( (*xd)*(*cd) < ZERO ) { + if ( *cd > ONEPT5 || (*cd) < -ONEPT5) { + if ( (*xd)*(*cd) <= ZERO) { test = FALSE; *md = ONE; } - else - *md = ZERO; + else { + *md = ZERO; + } + } else if ( (*cd) > HALF || (*cd) < -HALF) { + if ( (*xd)*(*cd) < ZERO ) { + test = FALSE; + *md = ONE; + } else { + *md = ZERO; + } + } } } return(test);