Skip to content

Commit 0200562

Browse files
committed
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
1 parent b592e63 commit 0200562

25 files changed

Lines changed: 152 additions & 214 deletions

stan/math/fwd/fun/inv_inc_beta.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ inline fvar<partials_return_t<T1, T2, T3>> inv_inc_beta(const T1& a,
8080
}
8181

8282
if constexpr (is_fvar<T3>::value) {
83-
inv_d_ += p.d_
84-
* exp(one_m_b * log1m_w + one_m_a * log_w + lbeta_ab);
83+
inv_d_ += p.d_ * exp(one_m_b * log1m_w + one_m_a * log_w + lbeta_ab);
8584
}
8685

8786
return fvar<T_return>(w, inv_d_);

stan/math/opencl/prim/bernoulli_logit_glm_lpmf.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ return_type_t<T_x_cl, T_alpha_cl, T_beta_cl> bernoulli_logit_glm_lpmf(
144144
if constexpr (is_alpha_vector) {
145145
partials<1>(ops_partials) = theta_derivative_cl;
146146
} else {
147-
partials<1>(ops_partials)[0] = sum(from_matrix_cl(theta_derivative_sum_cl));
147+
partials<1>(ops_partials)[0]
148+
= sum(from_matrix_cl(theta_derivative_sum_cl));
148149
}
149150
}
150151
if constexpr (is_autodiff_v<T_beta_cl>) {

stan/math/opencl/prim/categorical_logit_glm_lpmf.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ return_type_t<T_x, T_alpha, T_beta> categorical_logit_glm_lpmf(
132132
rowwise_broadcast(inv_sum_exp_lin_cl));
133133
} else {
134134
partials<0>(ops_partials)
135-
= indexing(beta_val, col_index(x.rows(), x.cols()),
136-
y_val - 1)
135+
= indexing(beta_val, col_index(x.rows(), x.cols()), y_val - 1)
137136
- elt_multiply(exp_lin_cl * transpose(beta_val),
138137
rowwise_broadcast(inv_sum_exp_lin_cl));
139138
}
@@ -152,9 +151,8 @@ return_type_t<T_x, T_alpha, T_beta> categorical_logit_glm_lpmf(
152151
try {
153152
opencl_kernels::categorical_logit_glm_beta_derivative(
154153
cl::NDRange(local_size * N_attributes), cl::NDRange(local_size),
155-
partials<2>(ops_partials),
156-
temp, y_val_cl, x_val, N_instances, N_attributes, N_classes,
157-
is_y_vector);
154+
partials<2>(ops_partials), temp, y_val_cl, x_val, N_instances,
155+
N_attributes, N_classes, is_y_vector);
158156
} catch (const cl::Error& e) {
159157
check_opencl_error(function, e);
160158
}

stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,7 @@ neg_binomial_2_log_glm_lpmf(const T_y_cl& y, const T_x_cl& x,
168168
}
169169

170170
if constexpr (include_summand<propto, T_phi_cl>::value && !is_phi_vector) {
171-
logp += N
172-
* (multiply_log(phi_val,
173-
phi_val)
174-
- lgamma(phi_val));
171+
logp += N * (multiply_log(phi_val, phi_val) - lgamma(phi_val));
175172
}
176173
if constexpr (include_summand<propto, T_phi_cl>::value && !is_y_vector
177174
&& !is_phi_vector) {
@@ -203,7 +200,8 @@ neg_binomial_2_log_glm_lpmf(const T_y_cl& y, const T_x_cl& x,
203200
if constexpr (is_alpha_vector) {
204201
partials<1>(ops_partials) = std::move(theta_derivative_cl);
205202
} else {
206-
partials<1>(ops_partials)[0] = sum(from_matrix_cl(theta_derivative_sum_cl));
203+
partials<1>(ops_partials)[0]
204+
= sum(from_matrix_cl(theta_derivative_sum_cl));
207205
}
208206
}
209207
if constexpr (is_autodiff_v<T_phi_cl>) {

stan/math/opencl/rev/add_diag.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ inline auto add_diag(const T_m& mat, const T_a& to_add) {
4040
}
4141
if constexpr (is_autodiff_v<T_a>) {
4242
if constexpr (!is_stan_scalar<T_a>::value) {
43-
auto& to_add_adj
44-
= to_add_arena.adj();
43+
auto& to_add_adj = to_add_arena.adj();
4544
to_add_adj += diagonal(res.adj());
4645
} else {
4746
auto& to_add_adj = to_add_arena.adj();

stan/math/prim/prob/bernoulli_logit_glm_lpmf.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ return_type_t<T_x, T_alpha, T_beta> bernoulli_logit_glm_lpmf(
107107

108108
Array<T_partials_return, Dynamic, 1> ytheta(N_instances);
109109
if constexpr (T_x_rows == 1) {
110-
T_ytheta_tmp ytheta_tmp
111-
= (x_val * beta_val_vec)(0, 0);
110+
T_ytheta_tmp ytheta_tmp = (x_val * beta_val_vec)(0, 0);
112111
ytheta = signs * (ytheta_tmp + as_array_or_scalar(alpha_val_vec));
113112
} else {
114113
ytheta = (x_val * beta_val_vec).array();
@@ -142,16 +141,14 @@ return_type_t<T_x, T_alpha, T_beta> bernoulli_logit_glm_lpmf(
142141
signs * exp_m_ytheta / (exp_m_ytheta + 1)));
143142
if constexpr (is_autodiff_v<T_beta>) {
144143
if constexpr (T_x_rows == 1) {
145-
edge<2>(ops_partials).partials_
146-
= theta_derivative.sum() * x_val;
144+
edge<2>(ops_partials).partials_ = theta_derivative.sum() * x_val;
147145
} else {
148146
partials<2>(ops_partials) = x_val.transpose() * theta_derivative;
149147
}
150148
}
151149
if constexpr (is_autodiff_v<T_x>) {
152150
if constexpr (T_x_rows == 1) {
153-
edge<0>(ops_partials).partials_
154-
= beta_val_vec * theta_derivative.sum();
151+
edge<0>(ops_partials).partials_ = beta_val_vec * theta_derivative.sum();
155152
} else {
156153
edge<0>(ops_partials).partials_
157154
= (beta_val_vec * theta_derivative.transpose()).transpose();

stan/math/prim/prob/bernoulli_logit_lpmf.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ return_type_t<T_prob> bernoulli_logit_lpmf(const T_n& n, const T_prob& theta) {
6565
if constexpr (is_vector<T_n>::value || is_vector<T_prob>::value) {
6666
ntheta = signs * theta_val;
6767
} else {
68-
T_partials_return ntheta_s
69-
= signs * theta_val;
68+
T_partials_return ntheta_s = signs * theta_val;
7069
ntheta = T_partials_array::Constant(1, 1, ntheta_s);
7170
}
7271
T_partials_array exp_m_ntheta = exp(-ntheta);

stan/math/prim/prob/binomial_logit_glm_lpmf.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,15 @@ return_type_t<T_x, T_alpha, T_beta> binomial_logit_glm_lpmf(
134134

135135
if constexpr (is_autodiff_v<T_beta>) {
136136
if constexpr (T_x_rows == 1) {
137-
edge<2>(ops_partials).partials_
138-
= theta_derivative.sum() * x_val;
137+
edge<2>(ops_partials).partials_ = theta_derivative.sum() * x_val;
139138
} else {
140139
partials<2>(ops_partials) = x_val.transpose() * theta_derivative;
141140
}
142141
}
143142

144143
if constexpr (is_autodiff_v<T_x>) {
145144
if constexpr (T_x_rows == 1) {
146-
edge<0>(ops_partials).partials_
147-
= beta_val * theta_derivative.sum();
145+
edge<0>(ops_partials).partials_ = beta_val * theta_derivative.sum();
148146
} else {
149147
edge<0>(ops_partials).partials_
150148
= (beta_val * theta_derivative.transpose()).transpose();

stan/math/prim/prob/chi_square_lpdf.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ return_type_t<T_y, T_dof> chi_square_lpdf(const T_y& y, const T_dof& nu) {
8888
}
8989
if constexpr (is_autodiff_v<T_dof>) {
9090
if constexpr (is_vector<T_dof>::value) {
91-
partials<1>(ops_partials) = (log_y - digamma(half_nu)) * 0.5 - HALF_LOG_TWO;
91+
partials<1>(ops_partials)
92+
= (log_y - digamma(half_nu)) * 0.5 - HALF_LOG_TWO;
9293
} else {
9394
partials<1>(ops_partials)[0]
9495
= sum(log_y - digamma(half_nu)) * 0.5 - HALF_LOG_TWO * N;

stan/math/prim/prob/double_exponential_cdf.hpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,18 @@ return_type_t<T_y, T_loc, T_scale> double_exponential_cdf(
7777
if constexpr (is_vector<T_y>::value || is_vector<T_loc>::value) {
7878
using array_bool = Eigen::Array<bool, Eigen::Dynamic, 1>;
7979
cdf = (y_val < mu_val)
80-
.select(exp_scaled_diff * 0.5,
81-
1.0 - 0.5 / exp_scaled_diff)
80+
.select(exp_scaled_diff * 0.5, 1.0 - 0.5 / exp_scaled_diff)
8281
.prod();
83-
rep_deriv =
84-
(y_val < mu_val)
85-
.select((cdf * inv_sigma),
86-
cdf * inv_sigma
87-
/ (2 * exp_scaled_diff - 1));
82+
rep_deriv = (y_val < mu_val)
83+
.select((cdf * inv_sigma),
84+
cdf * inv_sigma / (2 * exp_scaled_diff - 1));
8885
} else {
8986
if constexpr (is_vector<T_scale>::value) {
90-
cdf = (y_val < mu_val)
91-
? (exp_scaled_diff * 0.5).prod()
92-
: (1.0 - 0.5 / exp_scaled_diff).prod();
87+
cdf = (y_val < mu_val) ? (exp_scaled_diff * 0.5).prod()
88+
: (1.0 - 0.5 / exp_scaled_diff).prod();
9389
} else {
94-
cdf = (y_val < mu_val)
95-
? exp_scaled_diff * 0.5
96-
: 1.0 - 0.5 / exp_scaled_diff;
90+
cdf = (y_val < mu_val) ? exp_scaled_diff * 0.5
91+
: 1.0 - 0.5 / exp_scaled_diff;
9792
}
9893
if (y_val < mu_val) {
9994
rep_deriv = cdf * inv_sigma;

0 commit comments

Comments
 (0)