Skip to content

Commit 089ee51

Browse files
committed
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.04.1 (tags/RELEASE_600/final)
1 parent 616a597 commit 089ee51

5 files changed

Lines changed: 36 additions & 31 deletions

File tree

stan/math/opencl/prim/frechet_cdf.hpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ return_type_t<T_y_cl, T_shape_cl, T_scale_cl> frechet_cdf(
5555

5656
auto check_y_positive
5757
= check_cl(function, "Random variable", y_val, "positive");
58-
auto y_positive = y_val>0;
58+
auto y_positive = y_val > 0;
5959
auto check_alpha_positive_finite
6060
= check_cl(function, "Shape parameter", alpha_val, "positive finite");
61-
auto alpha_positive_finite_expr = alpha_val>0 && isfinite(alpha_val);
61+
auto alpha_positive_finite_expr = alpha_val > 0 && isfinite(alpha_val);
6262
auto check_sigma_positive_finite
6363
= check_cl(function, "Scale parameter", sigma_val, "positive finite");
6464
auto sigma_positive_finite_expr = 0 < sigma_val && isfinite(sigma_val);
@@ -67,8 +67,8 @@ return_type_t<T_y_cl, T_shape_cl, T_scale_cl> frechet_cdf(
6767
auto cdf_n = exp(-pow_n);
6868
auto cdf_expr = colwise_prod(cdf_n);
6969

70-
auto pow_n_alpha =elt_multiply(pow_n, alpha_val);
71-
auto y_deriv_tmp =elt_divide(pow_n_alpha, y_val);
70+
auto pow_n_alpha = elt_multiply(pow_n, alpha_val);
71+
auto y_deriv_tmp = elt_divide(pow_n_alpha, y_val);
7272
auto alpha_deriv_tmp = elt_multiply(pow_n, log(elt_divide(y_val, sigma_val)));
7373
auto sigma_deriv_tmp = elt_divide(pow_n_alpha, -sigma_val);
7474

@@ -77,14 +77,14 @@ return_type_t<T_y_cl, T_shape_cl, T_scale_cl> frechet_cdf(
7777
matrix_cl<double> alpha_deriv_cl;
7878
matrix_cl<double> sigma_deriv_cl;
7979

80-
results(check_y_positive, check_alpha_positive_finite, check_sigma_positive_finite,
81-
cdf_cl, y_deriv_cl, alpha_deriv_cl, sigma_deriv_cl)
82-
= expressions(
83-
y_positive, alpha_positive_finite_expr, sigma_positive_finite_expr,
84-
cdf_expr,
85-
calc_if<!is_constant<T_y_cl>::value>(y_deriv_tmp),
86-
calc_if<!is_constant<T_shape_cl>::value>(alpha_deriv_tmp),
87-
calc_if<!is_constant<T_scale_cl>::value>(sigma_deriv_tmp));
80+
results(check_y_positive, check_alpha_positive_finite,
81+
check_sigma_positive_finite, cdf_cl, y_deriv_cl, alpha_deriv_cl,
82+
sigma_deriv_cl)
83+
= expressions(y_positive, alpha_positive_finite_expr,
84+
sigma_positive_finite_expr, cdf_expr,
85+
calc_if<!is_constant<T_y_cl>::value>(y_deriv_tmp),
86+
calc_if<!is_constant<T_shape_cl>::value>(alpha_deriv_tmp),
87+
calc_if<!is_constant<T_scale_cl>::value>(sigma_deriv_tmp));
8888

8989
T_partials_return cdf = (from_matrix_cl(cdf_cl)).prod();
9090

@@ -97,7 +97,8 @@ return_type_t<T_y_cl, T_shape_cl, T_scale_cl> frechet_cdf(
9797
calc_if<!is_constant<T_y_cl>::value>(y_deriv),
9898
calc_if<!is_constant<T_scale_cl>::value>(sigma_deriv));
9999

100-
operands_and_partials<decltype(y_col), decltype(alpha_col), decltype(sigma_col)>
100+
operands_and_partials<decltype(y_col), decltype(alpha_col),
101+
decltype(sigma_col)>
101102
ops_partials(y_col, alpha_col, sigma_col);
102103

103104
if (!is_constant<T_y_cl>::value) {

stan/math/opencl/prim/frechet_lccdf.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ return_type_t<T_y_cl, T_shape_cl, T_scale_cl> frechet_lccdf(
6969

7070
auto rep_deriv = elt_divide(pow_n, elt_divide(1.0, exp_n - 1.0));
7171
auto y_deriv = elt_multiply(elt_divide(-alpha_val, y_val), rep_deriv);
72-
auto alpha_deriv = elt_multiply(-log(elt_divide(y_val, sigma_val)), rep_deriv);
72+
auto alpha_deriv
73+
= elt_multiply(-log(elt_divide(y_val, sigma_val)), rep_deriv);
7374
auto sigma_deriv = elt_multiply(elt_divide(alpha_val, sigma_val), rep_deriv);
7475

7576
matrix_cl<double> lccdf_cl;

test/unit/math/opencl/rev/frechet_cdf_test.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ TEST(ProbDistributionsFrechetCdf, error_checking) {
5656
std::domain_error);
5757
}
5858

59-
auto frechet_cdf_functor = [](const auto& y, const auto& alpha, const auto& sigma) {
60-
return stan::math::frechet_cdf(y, alpha, sigma);
61-
};
59+
auto frechet_cdf_functor
60+
= [](const auto& y, const auto& alpha, const auto& sigma) {
61+
return stan::math::frechet_cdf(y, alpha, sigma);
62+
};
6263

6364
TEST(ProbDistributionsFrechetCdf, opencl_matches_cpu_small) {
6465
int N = 3;

test/unit/math/opencl/rev/frechet_lccdf_test.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ TEST(ProbDistributionsFrechetLccdf, error_checking) {
5656
std::domain_error);
5757
}
5858

59-
auto frechet_lccdf_functor = [](const auto& y, const auto& alpha, const auto& sigma) {
60-
return stan::math::frechet_lccdf(y, alpha, sigma);
61-
};
59+
auto frechet_lccdf_functor
60+
= [](const auto& y, const auto& alpha, const auto& sigma) {
61+
return stan::math::frechet_lccdf(y, alpha, sigma);
62+
};
6263

6364
TEST(ProbDistributionsFrechetLccdf, opencl_matches_cpu_small) {
6465
int N = 3;
@@ -102,8 +103,8 @@ TEST(ProbDistributionsFrechetLccdf, opencl_broadcast_alpha) {
102103
Eigen::VectorXd sigma(N);
103104
sigma << 0.3, 0.8, 1.0;
104105

105-
stan::math::test::test_opencl_broadcasting_prim_rev<1>(frechet_lccdf_functor, y,
106-
alpha_scal, sigma);
106+
stan::math::test::test_opencl_broadcasting_prim_rev<1>(frechet_lccdf_functor,
107+
y, alpha_scal, sigma);
107108
stan::math::test::test_opencl_broadcasting_prim_rev<1>(
108109
frechet_lccdf_functor, y.transpose().eval(), alpha_scal, sigma);
109110
}
@@ -117,8 +118,8 @@ TEST(ProbDistributionsFrechetLccdf, opencl_broadcast_sigma) {
117118
alpha << 0.3, 0.8, 1.0;
118119
double sigma_scal = 12.3;
119120

120-
stan::math::test::test_opencl_broadcasting_prim_rev<2>(frechet_lccdf_functor, y,
121-
alpha, sigma_scal);
121+
stan::math::test::test_opencl_broadcasting_prim_rev<2>(frechet_lccdf_functor,
122+
y, alpha, sigma_scal);
122123
stan::math::test::test_opencl_broadcasting_prim_rev<2>(
123124
frechet_lccdf_functor, y.transpose().eval(), alpha, sigma_scal);
124125
}

test/unit/math/opencl/rev/frechet_lcdf_test.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ TEST(ProbDistributionsFrechetLcdf, error_checking) {
5656
std::domain_error);
5757
}
5858

59-
auto frechet_lcdf_functor = [](const auto& y, const auto& alpha, const auto& sigma) {
60-
return stan::math::frechet_lcdf(y, alpha, sigma);
61-
};
59+
auto frechet_lcdf_functor
60+
= [](const auto& y, const auto& alpha, const auto& sigma) {
61+
return stan::math::frechet_lcdf(y, alpha, sigma);
62+
};
6263

6364
TEST(ProbDistributionsFrechetLcdf, opencl_matches_cpu_small) {
6465
int N = 3;
@@ -102,8 +103,8 @@ TEST(ProbDistributionsFrechetLcdf, opencl_broadcast_alpha) {
102103
Eigen::VectorXd sigma(N);
103104
sigma << 0.3, 0.8, 1.0;
104105

105-
stan::math::test::test_opencl_broadcasting_prim_rev<1>(frechet_lcdf_functor, y,
106-
alpha_scal, sigma);
106+
stan::math::test::test_opencl_broadcasting_prim_rev<1>(frechet_lcdf_functor,
107+
y, alpha_scal, sigma);
107108
stan::math::test::test_opencl_broadcasting_prim_rev<1>(
108109
frechet_lcdf_functor, y.transpose().eval(), alpha_scal, sigma);
109110
}
@@ -117,8 +118,8 @@ TEST(ProbDistributionsFrechetLcdf, opencl_broadcast_sigma) {
117118
alpha << 0.3, 0.8, 1.0;
118119
double sigma_scal = 12.3;
119120

120-
stan::math::test::test_opencl_broadcasting_prim_rev<2>(frechet_lcdf_functor, y,
121-
alpha, sigma_scal);
121+
stan::math::test::test_opencl_broadcasting_prim_rev<2>(frechet_lcdf_functor,
122+
y, alpha, sigma_scal);
122123
stan::math::test::test_opencl_broadcasting_prim_rev<2>(
123124
frechet_lcdf_functor, y.transpose().eval(), alpha, sigma_scal);
124125
}

0 commit comments

Comments
 (0)