Skip to content

Commit

Permalink
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
Browse files Browse the repository at this point in the history
…4.1 (tags/RELEASE_600/final)
  • Loading branch information
stan-buildbot committed Aug 19, 2021
1 parent dfa27aa commit ca90f8c
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 39 deletions.
3 changes: 2 additions & 1 deletion stan/math/prim/fun/cholesky_factor_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ cholesky_factor_constrain(const T& x, int M, int N, scalar_type_t<T>& lp) {
* @return Cholesky factor
*/
template <bool Jacobian, typename T>
inline auto cholesky_factor_constrain(const T& x, int M, int N, scalar_type_t<T>& lp) {
inline auto cholesky_factor_constrain(const T& x, int M, int N,
scalar_type_t<T>& lp) {
if (Jacobian) {
return cholesky_factor_constrain(x, M, N, lp);
} else {
Expand Down
2 changes: 0 additions & 2 deletions stan/math/prim/fun/corr_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ inline auto corr_constrain(const T_x& x, T_lp& lp) {
}
}



} // namespace math
} // namespace stan
#endif
3 changes: 2 additions & 1 deletion stan/math/prim/fun/corr_matrix_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ corr_matrix_constrain(const T& x, Eigen::Index k, scalar_type_t<T>& lp) {
* @param lp Log probability reference to increment.
*/
template <bool Jacobian, typename T>
inline auto corr_matrix_constrain(const T& x, Eigen::Index k, scalar_type_t<T>& lp) {
inline auto corr_matrix_constrain(const T& x, Eigen::Index k,
scalar_type_t<T>& lp) {
if (Jacobian) {
return corr_matrix_constrain(x, k, lp);
} else {
Expand Down
5 changes: 2 additions & 3 deletions stan/math/prim/fun/cov_matrix_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,15 @@ cov_matrix_constrain(const T& x, Eigen::Index K, scalar_type_t<T>& lp) {
* @throws std::domain_error if (x.size() != K + (K choose 2)).
*/
template <bool Jacobian, typename T>
inline auto
cov_matrix_constrain(const T& x, Eigen::Index K, scalar_type_t<T>& lp) {
inline auto cov_matrix_constrain(const T& x, Eigen::Index K,
scalar_type_t<T>& lp) {
if (Jacobian) {
return cov_matrix_constrain(x, K, lp);
} else {
return cov_matrix_constrain(x, K);
}
}


} // namespace math
} // namespace stan

Expand Down
8 changes: 4 additions & 4 deletions stan/math/prim/fun/cov_matrix_constrain_lkj.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ cov_matrix_constrain_lkj(const T& x, size_t k, scalar_type_t<T>& lp) {
*
* @tparam Jacobian If true, incremented `lp` with the log Jacobian
* @tparam T A type inheriting from `Eigen::DenseBase` or a `var_value` with
* inner type inheriting from `Eigen::DenseBase` with compile time rows or columns equal to 1.
* inner type inheriting from `Eigen::DenseBase` with compile time rows or
* columns equal to 1.
* @param x Input vector of unconstrained partial correlations and
* standard deviations.
* @param k Dimensionality of returned covariance matrix.
Expand All @@ -100,16 +101,15 @@ cov_matrix_constrain_lkj(const T& x, size_t k, scalar_type_t<T>& lp) {
* correlations and deviations.
*/
template <bool Jacobian, typename T>
inline auto
cov_matrix_constrain_lkj(const T& x, size_t k, scalar_type_t<T>& lp) {
inline auto cov_matrix_constrain_lkj(const T& x, size_t k,
scalar_type_t<T>& lp) {
if (Jacobian) {
return cov_matrix_constrain_lkj(x, k, lp);
} else {
return cov_matrix_constrain_lkj(x, k);
}
}


} // namespace math
} // namespace stan

Expand Down
7 changes: 4 additions & 3 deletions stan/math/prim/fun/lb_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,10 @@ inline auto lb_constrain(const std::vector<T>& x, const std::vector<L>& lb,
* elementwise to each input element.
*
* @tparam Jacobian If true, incremented `lp` with the log Jacobian
* @tparam T A type inheriting from `Eigen::EigenBase`, a `var_value` with inner type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam L A type inheriting from `Eigen::EigenBase`, a `var_value` with inner type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam T A type inheriting from `Eigen::EigenBase`, a `var_value` with inner
* type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam L A type inheriting from `Eigen::EigenBase`, a `var_value` with inner
* type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @param[in] x unconstrained input
* @param[in] lb lower bound on output
* @param[in,out] lp reference to log probability to increment
Expand All @@ -242,7 +244,6 @@ inline auto lb_constrain(const T& x, const L& lb, return_type_t<T, L>& lp) {
}
}


} // namespace math
} // namespace stan

Expand Down
9 changes: 6 additions & 3 deletions stan/math/prim/fun/lub_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,12 @@ inline auto lub_constrain(const std::vector<T>& x, const std::vector<L>& lb,
* <p>\f$f(x) = L + (U - L) \mbox{logit}^{-1}(x)\f$
*
* @tparam Jacobian If true, incremented `lp` with the log Jacobian
* @tparam T A type inheriting from `Eigen::EigenBase`, a `var_value` with inner type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam L A type inheriting from `Eigen::EigenBase`, a `var_value` with inner type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam U A type inheriting from `Eigen::EigenBase`, a `var_value` with inner type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam T A type inheriting from `Eigen::EigenBase`, a `var_value` with inner
* type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam L A type inheriting from `Eigen::EigenBase`, a `var_value` with inner
* type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam U A type inheriting from `Eigen::EigenBase`, a `var_value` with inner
* type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @param[in] x Free scalar to transform.
* @param[in] lb Lower bound.
* @param[in] ub Upper bound.
Expand Down
14 changes: 7 additions & 7 deletions stan/math/prim/fun/offset_multiplier_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,12 @@ inline auto offset_multiplier_constrain(const std::vector<T>& x,
* reduces to <code>identity_constrain(x)</code>.
*
* @tparam Jacobian If true, incremented `lp` with the log Jacobian
* @tparam T A type inheriting from `Eigen::EigenBase`, a `var_value` with inner type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam M A type inheriting from `Eigen::EigenBase`, a `var_value` with inner type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam S A type inheriting from `Eigen::EigenBase`, a `var_value` with inner type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam T A type inheriting from `Eigen::EigenBase`, a `var_value` with inner
* type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam M A type inheriting from `Eigen::EigenBase`, a `var_value` with inner
* type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam S A type inheriting from `Eigen::EigenBase`, a `var_value` with inner
* type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @param[in] x Unconstrained scalar input
* @param[in] mu offset of constrained output
* @param[in] sigma multiplier of constrained output
Expand All @@ -297,9 +300,7 @@ inline auto offset_multiplier_constrain(const std::vector<T>& x,
* @throw std::domain_error if mu is not finite
*/
template <bool Jacobian, typename T, typename M, typename S>
inline auto offset_multiplier_constrain(const T& x,
const M& mu,
const S& sigma,
inline auto offset_multiplier_constrain(const T& x, const M& mu, const S& sigma,
return_type_t<T, M, S>& lp) {
if (Jacobian) {
return offset_multiplier_constrain(x, mu, sigma, lp);
Expand All @@ -308,7 +309,6 @@ inline auto offset_multiplier_constrain(const T& x,
}
}


} // namespace math
} // namespace stan

Expand Down
3 changes: 2 additions & 1 deletion stan/math/prim/fun/positive_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ inline auto positive_constrain(const T& x, S& lp) {
* = \log | \mbox{exp}(x) | = x\f$.
*
* @tparam Jacobian If true, incremented `lp` with the log Jacobian
* @tparam T A type inheriting from `Eigen::EigenBase`, a `var_value` with inner type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam T A type inheriting from `Eigen::EigenBase`, a `var_value` with inner
* type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @param x unconstrained value or container
* @param lp log density reference.
* @return positive constrained version of unconstrained value(s)
Expand Down
4 changes: 2 additions & 2 deletions stan/math/prim/fun/positive_ordered_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ inline auto positive_ordered_constrain(const Vec& x, scalar_type_t<Vec>& lp) {
* will have the same dimensionality as the specified free vector.
*
* @tparam Jacobian If true, incremented `lp` with the log Jacobian
* @tparam Vec A type inheriting from `Eigen::EigenBase`, a `var_value` with inner type inheriting from `Eigen::EigenBase`.
* @tparam Vec A type inheriting from `Eigen::EigenBase`, a `var_value` with
* inner type inheriting from `Eigen::EigenBase`.
* @param x Free vector of scalars.
* @param lp Log probability reference.
* @return Positive, increasing ordered vector.
Expand All @@ -77,7 +78,6 @@ inline auto positive_ordered_constrain(const Vec& x, scalar_type_t<Vec>& lp) {
}
}


} // namespace math
} // namespace stan

Expand Down
6 changes: 4 additions & 2 deletions stan/math/prim/fun/ub_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ inline auto ub_constrain(const std::vector<T>& x, const std::vector<U>& ub,
* elementwise to each input element.
*
* @tparam Jacobian If true, incremented `lp` with the log Jacobian
* @tparam T A type inheriting from `Eigen::EigenBase`, a `var_value` with inner type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam U A type inheriting from `Eigen::EigenBase`, a `var_value` with inner type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam T A type inheriting from `Eigen::EigenBase`, a `var_value` with inner
* type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @tparam U A type inheriting from `Eigen::EigenBase`, a `var_value` with inner
* type inheriting from `Eigen::EigenBase`, a standard vector, or a scalar
* @param[in] x unconstrained input
* @param[in] ub upper bound on output
* @param[in,out] lp reference to log probability to increment
Expand Down
2 changes: 1 addition & 1 deletion test/unit/math/mix/fun/cholesky_corr_constrain_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ int inv_size(const T& x) {
}

template <typename T>
auto g1( const T& x) {
auto g1(const T& x) {
stan::scalar_type_t<T> lp = 0;
return stan::math::cholesky_corr_constrain<false>(x, inv_size(x), lp);
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/math/mix/fun/corr_constrain_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

TEST(mathMixMatFun, corr_constrain) {
auto f = [](const auto& x1) {
stan::scalar_type_t<std::decay_t<decltype(x1)>> lp = 0.0;
return stan::math::corr_constrain<false>(x1, lp);
stan::scalar_type_t<std::decay_t<decltype(x1)>> lp = 0.0;
return stan::math::corr_constrain<false>(x1, lp);
};

std::vector<double> x0 = {-1.0, 2.0, 3.0};
Expand Down
12 changes: 5 additions & 7 deletions test/unit/math/mix/fun/cov_matrix_constrain_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ auto g1(const T& x) {
return stan::math::cov_matrix_constrain<false>(x, inv_size(x), lp);
}
template <typename T>
auto g2(
const T& x) {
auto g2(const T& x) {
typename stan::scalar_type<T>::type lp = 0;
auto a = stan::math::cov_matrix_constrain<true>(x, inv_size(x), lp);
return a;
Expand Down Expand Up @@ -77,11 +76,10 @@ TEST(MathMixMatFun, cov_matrixTransform) {

TEST(mathMixMatFun, cov_matrix_constrain) {
auto f = [](int K) {
return
[K](const auto& x1) {
stan::scalar_type_t<std::decay_t<decltype(x1)>> lp = 0.0;
return stan::math::cov_matrix_constrain<false>(x1, K, lp);
};
return [K](const auto& x1) {
stan::scalar_type_t<std::decay_t<decltype(x1)>> lp = 0.0;
return stan::math::cov_matrix_constrain<false>(x1, K, lp);
};
};

Eigen::VectorXd x1(10);
Expand Down

0 comments on commit ca90f8c

Please sign in to comment.