Skip to content

Commit 5b3362a

Browse files
committed
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.04.1 (tags/RELEASE_600/final)
1 parent 0952a2d commit 5b3362a

5 files changed

Lines changed: 26 additions & 23 deletions

File tree

stan/math/prim/err/check_flag_sundials.hpp

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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

stan/math/rev/functor/algebra_solver_fp.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ struct FixedPointSolver<KinsolFixedPointEnv<F>, fp_jac_type> {
247247
kinsol_check(KINSol(mem, env.nv_x_, KIN_FP, env.nv_u_scal_, env.nv_f_scal_),
248248
"KINSol", max_num_steps);
249249

250-
251250
for (int i = 0; i < N; ++i) {
252251
x(i) = NV_Ith_S(env.nv_x_, i);
253252
}

stan/math/rev/functor/kinsol_solve.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ Eigen::VectorXd kinsol_solve(const F1& f, const Eigen::VectorXd& x,
109109
for (int i = 0; i < N; i++)
110110
NV_Ith_S(nv_x, i) = x(i);
111111

112-
kinsol_check(KINSol(kinsol_data.kinsol_memory_, nv_x,
113-
global_line_search, scaling, scaling),
112+
kinsol_check(KINSol(kinsol_data.kinsol_memory_, nv_x, global_line_search,
113+
scaling, scaling),
114114
"KINSol", max_num_steps);
115115

116116
for (int i = 0; i < N; i++)

test/unit/math/rev/functor/algebra_solver_newton_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ TEST_F(degenerate_eq_test, newton_guess_saddle_point_dbl) {
9999
// a saddle point.
100100
using stan::math::algebra_solver_newton;
101101
std::stringstream err_msg;
102-
err_msg << "The linear solver’s setup function failed in an unrecoverable manner";
102+
err_msg
103+
<< "The linear solver’s setup function failed in an unrecoverable manner";
103104
std::string msg = err_msg.str();
104105

105106
EXPECT_THROW_MSG(algebra_solver_newton(degenerate_eq_functor(), x_guess_3,

test/unit/math/rev/functor/util_algebra_solver.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,8 @@ void inline unsolvable_flag_test(Eigen::Matrix<T, Eigen::Dynamic, 1>& y,
426426
std::vector<double> dat;
427427
std::vector<int> dat_int;
428428
std::stringstream err_msg;
429-
err_msg << "The linear solver’s setup function failed in an unrecoverable manner.";
429+
err_msg << "The linear solver’s setup function failed in an unrecoverable "
430+
"manner.";
430431
std::string msg = err_msg.str();
431432
EXPECT_THROW_MSG(general_algebra_solver(is_newton, unsolvable_eq_functor(), x,
432433
y, dat, dat_int),

0 commit comments

Comments
 (0)