Skip to content

Commit 84319ae

Browse files
committed
Apply clang-format to geometric distribution files
1 parent 88d6b53 commit 84319ae

4 files changed

Lines changed: 12 additions & 16 deletions

File tree

stan/math/prim/prob/geometric_cdf.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ namespace math {
3333
* @throw std::invalid_argument if container sizes mismatch
3434
*/
3535
template <typename T_n, typename T_prob>
36-
inline return_type_t<T_prob> geometric_cdf(const T_n& n,
37-
const T_prob& theta) {
36+
inline return_type_t<T_prob> geometric_cdf(const T_n& n, const T_prob& theta) {
3837
using T_n_ref = ref_type_t<T_n>;
3938
using T_prob_ref = ref_type_t<T_prob>;
4039
static constexpr const char* function = "geometric_cdf";
@@ -47,8 +46,8 @@ inline return_type_t<T_prob> geometric_cdf(const T_n& n,
4746

4847
T_n_ref n_ref = n;
4948
T_prob_ref theta_ref = theta;
50-
check_bounded(function, "Success probability parameter",
51-
value_of(theta_ref), 0.0, 1.0);
49+
check_bounded(function, "Success probability parameter", value_of(theta_ref),
50+
0.0, 1.0);
5251

5352
scalar_seq_view<T_n_ref> n_vec(n_ref);
5453
for (int i = 0; i < stan::math::size(n); i++) {

stan/math/prim/prob/geometric_lccdf.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ inline return_type_t<T_prob> geometric_lccdf(const T_n& n,
4747

4848
T_n_ref n_ref = n;
4949
T_prob_ref theta_ref = theta;
50-
check_bounded(function, "Success probability parameter",
51-
value_of(theta_ref), 0.0, 1.0);
50+
check_bounded(function, "Success probability parameter", value_of(theta_ref),
51+
0.0, 1.0);
5252

5353
scalar_seq_view<T_n_ref> n_vec(n_ref);
5454
for (int i = 0; i < stan::math::size(n); i++) {

stan/math/prim/prob/geometric_lcdf.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ namespace math {
3333
* @throw std::invalid_argument if container sizes mismatch
3434
*/
3535
template <typename T_n, typename T_prob>
36-
inline return_type_t<T_prob> geometric_lcdf(const T_n& n,
37-
const T_prob& theta) {
36+
inline return_type_t<T_prob> geometric_lcdf(const T_n& n, const T_prob& theta) {
3837
using T_n_ref = ref_type_t<T_n>;
3938
using T_prob_ref = ref_type_t<T_prob>;
4039
static constexpr const char* function = "geometric_lcdf";
@@ -47,8 +46,8 @@ inline return_type_t<T_prob> geometric_lcdf(const T_n& n,
4746

4847
T_n_ref n_ref = n;
4948
T_prob_ref theta_ref = theta;
50-
check_bounded(function, "Success probability parameter",
51-
value_of(theta_ref), 0.0, 1.0);
49+
check_bounded(function, "Success probability parameter", value_of(theta_ref),
50+
0.0, 1.0);
5251

5352
scalar_seq_view<T_n_ref> n_vec(n_ref);
5453
for (int i = 0; i < stan::math::size(n); i++) {

stan/math/prim/prob/geometric_lpmf.hpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ namespace math {
3636
template <bool propto, typename T_n, typename T_prob,
3737
require_all_not_nonscalar_prim_or_rev_kernel_expression_t<
3838
T_n, T_prob>* = nullptr>
39-
inline return_type_t<T_prob> geometric_lpmf(const T_n& n,
40-
const T_prob& theta) {
39+
inline return_type_t<T_prob> geometric_lpmf(const T_n& n, const T_prob& theta) {
4140
using T_n_ref = ref_type_t<T_n>;
4241
using T_prob_ref = ref_type_t<T_prob>;
4342
static constexpr const char* function = "geometric_lpmf";
@@ -50,8 +49,8 @@ inline return_type_t<T_prob> geometric_lpmf(const T_n& n,
5049
T_n_ref n_ref = n;
5150
T_prob_ref theta_ref = theta;
5251
check_nonnegative(function, "Outcome variable", n_ref);
53-
check_bounded(function, "Success probability parameter",
54-
value_of(theta_ref), 0.0, 1.0);
52+
check_bounded(function, "Success probability parameter", value_of(theta_ref),
53+
0.0, 1.0);
5554

5655
// theta = 1 => deterministic: P(0) = 1, P(n>0) = 0
5756
// Cannot delegate since beta = theta / (1 - theta) diverges
@@ -90,8 +89,7 @@ inline return_type_t<T_prob> geometric_lpmf(const T_n& n,
9089
}
9190

9291
template <typename T_n, typename T_prob>
93-
inline return_type_t<T_prob> geometric_lpmf(const T_n& n,
94-
const T_prob& theta) {
92+
inline return_type_t<T_prob> geometric_lpmf(const T_n& n, const T_prob& theta) {
9593
return geometric_lpmf<false>(n, theta);
9694
}
9795

0 commit comments

Comments
 (0)