Skip to content

Commit

Permalink
fix bug with integer
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Reep authored and Jeffrey Reep committed Jul 18, 2024
1 parent 66462fd commit 7c2b120
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ int main(int argc, char *argv[])
{
//Declarations
int num_steps;
int fail = 1;
state_type state;
char config[256];
LOOP loop;
Expand Down Expand Up @@ -75,6 +74,7 @@ int main(int argc, char *argv[])
// Start integration loop
while(t<loop->parameters.total_time)
{
int fail = 1;
int num_failures = 0;
while(fail>0)
{
Expand Down Expand Up @@ -106,8 +106,7 @@ int main(int argc, char *argv[])
{
// Constant timestep integration
num_steps = boost::numeric::odeint::integrate_const( controlled_stepper, loop->CalculateDerivs, state, loop->parameters.tau, loop->parameters.total_time, loop->parameters.tau, obs->Observe);
fail = obs->CheckNan(state);
if(fail)
if(obs->CheckNan(state))
{
throw std::runtime_error("NaNs were detected in the output. Check the input configuration.");
}
Expand Down

0 comments on commit 7c2b120

Please sign in to comment.