Skip to content

Commit

Permalink
Merge pull request #48 from bjodah/atol-length-check
Browse files Browse the repository at this point in the history
Check atol vector length
  • Loading branch information
bjodah authored Jan 31, 2018
2 parents 75b5492 + c503879 commit 8f1eab7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pycvodes/include/cvodes_anyode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ namespace cvodes_anyode {
integr.root_init(nroots, roots_cb<OdeSys>);
if (atol.size() == 1){
integr.set_tol(rtol, atol[0]);
}else{
} else if (atol.size() != (size_t)ny) {
throw std::runtime_error("atol of incorrect length");
} else {
integr.set_tol(rtol, atol);
}
integr.set_init_step(dx0);
Expand Down

0 comments on commit 8f1eab7

Please sign in to comment.