@@ -44,13 +44,13 @@ inline void cvodes_check(int flag, const char* func_name) {
4444 * @param func_name calling function name
4545 * @throw <code>std::runtime_error</code> if the flag is negative.
4646 */
47- inline void kinsol_check (int flag, const char * func_name) {
48- std::ostringstream ss;
49- if (flag < 0 ) {
50- ss << " algebra_solver failed with error flag " << flag << " ." ;
51- throw std::runtime_error (ss.str ());
52- }
47+ inline void kinsol_check (int flag, const char * func_name) {
48+ std::ostringstream ss;
49+ if (flag < 0 ) {
50+ ss << " algebra_solver failed with error flag " << flag << " ." ;
51+ throw std::runtime_error (ss.str ());
5352 }
53+ }
5454
5555/* *
5656 * Throws an exception message when the KINSol() call fails.
@@ -65,19 +65,21 @@ inline void cvodes_check(int flag, const char* func_name) {
6565 * @throw <code>std::domain_error</code> if the flag indicates max
6666 * number of steps is exceeded..
6767 */
68- inline void kinsol_check (int flag, const char * func_name, long int max_num_steps) { // NOLINT(runtime/int)
69- std::ostringstream ss;
70- if (flag == -6 ) {
71- domain_error (" algebra_solver" , " maximum number of iterations" ,
72- max_num_steps, " (" , " ) was exceeded in the solve." );
73- } else if (flag == -11 ) {
74- ss << " The linear solver’s setup function failed in an unrecoverable manner." ;
75- throw std::runtime_error (ss.str ());
76- } else if (flag < 0 ) {
77- ss << " algebra_solver failed with error flag " << flag << " ." ;
78- throw std::runtime_error (ss.str ());
79- }
68+ inline void kinsol_check (int flag, const char * func_name,
69+ long int max_num_steps) { // NOLINT(runtime/int)
70+ std::ostringstream ss;
71+ if (flag == -6 ) {
72+ domain_error (" algebra_solver" , " maximum number of iterations" ,
73+ max_num_steps, " (" , " ) was exceeded in the solve." );
74+ } else if (flag == -11 ) {
75+ ss << " The linear solver’s setup function failed in an unrecoverable "
76+ " manner." ;
77+ throw std::runtime_error (ss.str ());
78+ } else if (flag < 0 ) {
79+ ss << " algebra_solver failed with error flag " << flag << " ." ;
80+ throw std::runtime_error (ss.str ());
8081 }
82+ }
8183
8284} // namespace math
8385} // namespace stan
0 commit comments