Skip to content

Commit

Permalink
fix error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
helske committed Nov 24, 2024
1 parent 23d6679 commit 12efc72
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/mnhmm_EM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void mnhmm_base::mstep_omega(const double xtol_abs, const double ftol_abs,
" after "<<mstep_iter<<" iterations."<<std::endl;
}
if (status < 0) {
mstep_error_code = -status - 400;
mstep_error_code = status - 400;
nlopt_destroy(opt_omega);
return;
}
Expand Down Expand Up @@ -187,7 +187,7 @@ void mnhmm_base::mstep_pi(const double xtol_abs, const double ftol_abs,
" after "<<mstep_iter<<" iterations."<<std::endl;
}
if (status < 0) {
mstep_error_code = -status - 100;
mstep_error_code = status - 100;
nlopt_destroy(opt_pi);
return;
}
Expand Down Expand Up @@ -308,7 +308,7 @@ void mnhmm_base::mstep_A(const double ftol_abs, const double ftol_rel,
" iterations."<<std::endl;
}
if (status < 0) {
mstep_error_code = -status - 200;
mstep_error_code = status - 200;
nlopt_destroy(opt_A);
return;
}
Expand Down Expand Up @@ -435,7 +435,7 @@ void mnhmm_sc::mstep_B(const double ftol_abs, const double ftol_rel,
" iterations."<<std::endl;
}
if (status < 0) {
mstep_error_code = -status - 300;
mstep_error_code = status - 300;
nlopt_destroy(opt_B);
return;
}
Expand Down Expand Up @@ -566,7 +566,7 @@ void mnhmm_mc::mstep_B(const double ftol_abs, const double ftol_rel,
" iterations."<<std::endl;
}
if (status < 0) {
mstep_error_code = -status - 300;
mstep_error_code = status - 300;
nlopt_destroy(opt_B);
return;
}
Expand Down
8 changes: 4 additions & 4 deletions src/nhmm_EM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void nhmm_base::mstep_pi(const double xtol_abs, const double ftol_abs,
" after "<<mstep_iter<<" iterations."<<std::endl;
}
if (status < 0) {
mstep_error_code = -status - 100;
mstep_error_code = status - 100;
nlopt_destroy(opt_pi);
return;
}
Expand Down Expand Up @@ -208,7 +208,7 @@ void nhmm_base::mstep_A(const double ftol_abs, const double ftol_rel,
" iterations."<<std::endl;
}
if (status < 0) {
mstep_error_code = -status - 200;
mstep_error_code = status - 200;
nlopt_destroy(opt_A);
return;
}
Expand Down Expand Up @@ -329,7 +329,7 @@ void nhmm_sc::mstep_B(const double ftol_abs, const double ftol_rel,
" iterations."<<std::endl;
}
if (status < 0) {
mstep_error_code = -status - 300;
mstep_error_code = status - 300;
nlopt_destroy(opt_B);
return;
}
Expand Down Expand Up @@ -456,7 +456,7 @@ void nhmm_mc::mstep_B(const double ftol_abs, const double ftol_rel,
" iterations."<<std::endl;
}
if (status < 0) {
mstep_error_code = -status - 300;
mstep_error_code = status - 300;
nlopt_destroy(opt_B);
return;
}
Expand Down

0 comments on commit 12efc72

Please sign in to comment.