Skip to content

Commit df5e1d1

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

File tree

6 files changed

+21
-18
lines changed

6 files changed

+21
-18
lines changed

stan/math/prim/fun/stochastic_column_constrain.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ inline plain_type_t<Mat> stochastic_column_constrain(const Mat& y) {
5050
template <typename Mat, require_eigen_matrix_dynamic_t<Mat>* = nullptr,
5151
require_not_st_var<Mat>* = nullptr>
5252
inline plain_type_t<Mat> stochastic_column_constrain(const Mat& y,
53-
value_type_t<Mat>& lp) {
53+
value_type_t<Mat>& lp) {
5454
auto&& y_ref = to_ref(y);
5555
const Eigen::Index M = y_ref.cols();
5656
plain_type_t<Mat> ret(y_ref.rows() + 1, M);
@@ -76,7 +76,7 @@ inline plain_type_t<Mat> stochastic_column_constrain(const Mat& y,
7676
*/
7777
template <bool Jacobian, typename Mat, require_not_std_vector_t<Mat>* = nullptr>
7878
inline plain_type_t<Mat> stochastic_column_constrain(const Mat& y,
79-
return_type_t<Mat>& lp) {
79+
return_type_t<Mat>& lp) {
8080
if (Jacobian) {
8181
return stochastic_column_constrain(y, lp);
8282
} else {
@@ -103,8 +103,9 @@ inline plain_type_t<Mat> stochastic_column_constrain(const Mat& y,
103103
*/
104104
template <bool Jacobian, typename T, require_std_vector_t<T>* = nullptr>
105105
inline auto stochastic_column_constrain(const T& y, return_type_t<T>& lp) {
106-
return apply_vector_unary<T>::apply(
107-
y, [&lp](auto&& v) { return stochastic_column_constrain<Jacobian>(v, lp); });
106+
return apply_vector_unary<T>::apply(y, [&lp](auto&& v) {
107+
return stochastic_column_constrain<Jacobian>(v, lp);
108+
});
108109
}
109110

110111
} // namespace math

stan/math/prim/fun/stochastic_column_free.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ namespace math {
1010

1111
/**
1212
* Return an unconstrained matrix that when transformed produces
13-
* the specified columnwise stochastic matrix. It applies to a stochastic matrix of
14-
* dimensionality (N, K) and produces an unconstrained vector of dimensionality
15-
* (N - 1, K).
13+
* the specified columnwise stochastic matrix. It applies to a stochastic
14+
* matrix of dimensionality (N, K) and produces an unconstrained vector of
15+
* dimensionality (N - 1, K).
1616
*
1717
* @tparam Mat type of the Matrix
1818
* @param y Columnwise stochastic matrix input of dimensionality (N, K)

stan/math/prim/fun/stochastic_row_constrain.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ inline plain_type_t<Mat> stochastic_row_constrain(const Mat& y) {
5353
template <typename Mat, require_eigen_matrix_dynamic_t<Mat>* = nullptr,
5454
require_not_st_var<Mat>* = nullptr>
5555
inline plain_type_t<Mat> stochastic_row_constrain(const Mat& y,
56-
value_type_t<Mat>& lp) {
56+
value_type_t<Mat>& lp) {
5757
auto&& y_ref = to_ref(y);
5858
const Eigen::Index N = y_ref.rows();
5959
Eigen::Index Km1 = y_ref.cols();
@@ -91,7 +91,7 @@ inline plain_type_t<Mat> stochastic_row_constrain(const Mat& y,
9191
*/
9292
template <bool Jacobian, typename Mat, require_not_std_vector_t<Mat>* = nullptr>
9393
inline plain_type_t<Mat> stochastic_row_constrain(const Mat& y,
94-
return_type_t<Mat>& lp) {
94+
return_type_t<Mat>& lp) {
9595
if (Jacobian) {
9696
return stochastic_row_constrain(y, lp);
9797
} else {
@@ -100,11 +100,11 @@ inline plain_type_t<Mat> stochastic_row_constrain(const Mat& y,
100100
}
101101

102102
/**
103-
* Return a row stochastic matrix.
104-
* If the `Jacobian` parameter is `true`, the log density accumulator is incremented
105-
* with the log absolute Jacobian determinant of the transform. All of the
106-
* transforms are specified with their Jacobians in the *Stan Reference Manual*
107-
* chapter Constraint Transforms.
103+
* Return a row stochastic matrix.
104+
* If the `Jacobian` parameter is `true`, the log density accumulator is
105+
* incremented with the log absolute Jacobian determinant of the transform. All
106+
* of the transforms are specified with their Jacobians in the *Stan Reference
107+
* Manual* chapter Constraint Transforms.
108108
*
109109
* @tparam Jacobian if `true`, increment log density accumulator with log
110110
* absolute Jacobian determinant of constraining transform

stan/math/rev/fun/stochastic_column_constrain.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ inline plain_type_t<T> stochastic_column_constrain(const T& y) {
8181
*/
8282
template <typename T, require_rev_matrix_t<T>* = nullptr>
8383
inline plain_type_t<T> stochastic_column_constrain(const T& y,
84-
scalar_type_t<T>& lp) {
84+
scalar_type_t<T>& lp) {
8585
using ret_type = plain_type_t<T>;
8686
const Eigen::Index N = y.rows();
8787
const Eigen::Index M = y.cols();

stan/math/rev/fun/stochastic_row_constrain.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ inline plain_type_t<T> stochastic_row_constrain(const T& y) {
7676
* @return Matrix with simplexes along the rows of dimensionality (N, K + 1).
7777
*/
7878
template <typename T, require_rev_matrix_t<T>* = nullptr>
79-
inline plain_type_t<T> stochastic_row_constrain(const T& y, scalar_type_t<T>& lp) {
79+
inline plain_type_t<T> stochastic_row_constrain(const T& y,
80+
scalar_type_t<T>& lp) {
8081
using ret_type = plain_type_t<T>;
8182
const Eigen::Index N = y.rows();
8283
const Eigen::Index M = y.cols();

test/unit/math/prim/fun/stochastic_column_constrain_test.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ TEST(prob_transform, stochastic_column_constrain_and_free) {
4040
stan::math::stochastic_column_constrain<false>(x, lp));
4141
EXPECT_MATRIX_NEAR(x, x_test, 1e-9);
4242

43-
Matrix<double, Dynamic, Dynamic> x_lp_test = stan::math::stochastic_column_free(
44-
stan::math::stochastic_column_constrain<true>(x, lp));
43+
Matrix<double, Dynamic, Dynamic> x_lp_test
44+
= stan::math::stochastic_column_free(
45+
stan::math::stochastic_column_constrain<true>(x, lp));
4546
EXPECT_MATRIX_NEAR(x, x_lp_test, 1e-9);
4647
}

0 commit comments

Comments
 (0)