From ca90f8cab6ed5fe0df8696713b0edad468e785af Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Thu, 19 Aug 2021 04:34:40 +0000 Subject: [PATCH] [Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.04.1 (tags/RELEASE_600/final) --- stan/math/prim/fun/cholesky_factor_constrain.hpp | 3 ++- stan/math/prim/fun/corr_constrain.hpp | 2 -- stan/math/prim/fun/corr_matrix_constrain.hpp | 3 ++- stan/math/prim/fun/cov_matrix_constrain.hpp | 5 ++--- stan/math/prim/fun/cov_matrix_constrain_lkj.hpp | 8 ++++---- stan/math/prim/fun/lb_constrain.hpp | 7 ++++--- stan/math/prim/fun/lub_constrain.hpp | 9 ++++++--- stan/math/prim/fun/offset_multiplier_constrain.hpp | 14 +++++++------- stan/math/prim/fun/positive_constrain.hpp | 3 ++- stan/math/prim/fun/positive_ordered_constrain.hpp | 4 ++-- stan/math/prim/fun/ub_constrain.hpp | 6 ++++-- .../math/mix/fun/cholesky_corr_constrain_test.cpp | 2 +- test/unit/math/mix/fun/corr_constrain_test.cpp | 4 ++-- .../math/mix/fun/cov_matrix_constrain_test.cpp | 12 +++++------- 14 files changed, 43 insertions(+), 39 deletions(-) diff --git a/stan/math/prim/fun/cholesky_factor_constrain.hpp b/stan/math/prim/fun/cholesky_factor_constrain.hpp index 1ea2fb0261d..9242f6568e3 100644 --- a/stan/math/prim/fun/cholesky_factor_constrain.hpp +++ b/stan/math/prim/fun/cholesky_factor_constrain.hpp @@ -103,7 +103,8 @@ cholesky_factor_constrain(const T& x, int M, int N, scalar_type_t& lp) { * @return Cholesky factor */ template -inline auto cholesky_factor_constrain(const T& x, int M, int N, scalar_type_t& lp) { +inline auto cholesky_factor_constrain(const T& x, int M, int N, + scalar_type_t& lp) { if (Jacobian) { return cholesky_factor_constrain(x, M, N, lp); } else { diff --git a/stan/math/prim/fun/corr_constrain.hpp b/stan/math/prim/fun/corr_constrain.hpp index 686e4271e65..a0e11320480 100644 --- a/stan/math/prim/fun/corr_constrain.hpp +++ b/stan/math/prim/fun/corr_constrain.hpp @@ -74,8 +74,6 @@ inline auto corr_constrain(const T_x& x, T_lp& lp) { } } - - } // namespace math } // namespace stan #endif diff --git a/stan/math/prim/fun/corr_matrix_constrain.hpp b/stan/math/prim/fun/corr_matrix_constrain.hpp index 6b807e67069..a866cd45090 100644 --- a/stan/math/prim/fun/corr_matrix_constrain.hpp +++ b/stan/math/prim/fun/corr_matrix_constrain.hpp @@ -97,7 +97,8 @@ corr_matrix_constrain(const T& x, Eigen::Index k, scalar_type_t& lp) { * @param lp Log probability reference to increment. */ template -inline auto corr_matrix_constrain(const T& x, Eigen::Index k, scalar_type_t& lp) { +inline auto corr_matrix_constrain(const T& x, Eigen::Index k, + scalar_type_t& lp) { if (Jacobian) { return corr_matrix_constrain(x, k, lp); } else { diff --git a/stan/math/prim/fun/cov_matrix_constrain.hpp b/stan/math/prim/fun/cov_matrix_constrain.hpp index a9453b6d3e5..ecedd333735 100644 --- a/stan/math/prim/fun/cov_matrix_constrain.hpp +++ b/stan/math/prim/fun/cov_matrix_constrain.hpp @@ -105,8 +105,8 @@ cov_matrix_constrain(const T& x, Eigen::Index K, scalar_type_t& lp) { * @throws std::domain_error if (x.size() != K + (K choose 2)). */ template -inline auto -cov_matrix_constrain(const T& x, Eigen::Index K, scalar_type_t& lp) { +inline auto cov_matrix_constrain(const T& x, Eigen::Index K, + scalar_type_t& lp) { if (Jacobian) { return cov_matrix_constrain(x, K, lp); } else { @@ -114,7 +114,6 @@ cov_matrix_constrain(const T& x, Eigen::Index K, scalar_type_t& lp) { } } - } // namespace math } // namespace stan diff --git a/stan/math/prim/fun/cov_matrix_constrain_lkj.hpp b/stan/math/prim/fun/cov_matrix_constrain_lkj.hpp index 82e44d064d1..c90f81f49f3 100644 --- a/stan/math/prim/fun/cov_matrix_constrain_lkj.hpp +++ b/stan/math/prim/fun/cov_matrix_constrain_lkj.hpp @@ -91,7 +91,8 @@ cov_matrix_constrain_lkj(const T& x, size_t k, scalar_type_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. @@ -100,8 +101,8 @@ cov_matrix_constrain_lkj(const T& x, size_t k, scalar_type_t& lp) { * correlations and deviations. */ template -inline auto -cov_matrix_constrain_lkj(const T& x, size_t k, scalar_type_t& lp) { +inline auto cov_matrix_constrain_lkj(const T& x, size_t k, + scalar_type_t& lp) { if (Jacobian) { return cov_matrix_constrain_lkj(x, k, lp); } else { @@ -109,7 +110,6 @@ cov_matrix_constrain_lkj(const T& x, size_t k, scalar_type_t& lp) { } } - } // namespace math } // namespace stan diff --git a/stan/math/prim/fun/lb_constrain.hpp b/stan/math/prim/fun/lb_constrain.hpp index 0b2f2cf4d54..fb645f685ba 100644 --- a/stan/math/prim/fun/lb_constrain.hpp +++ b/stan/math/prim/fun/lb_constrain.hpp @@ -226,8 +226,10 @@ inline auto lb_constrain(const std::vector& x, const std::vector& 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 @@ -242,7 +244,6 @@ inline auto lb_constrain(const T& x, const L& lb, return_type_t& lp) { } } - } // namespace math } // namespace stan diff --git a/stan/math/prim/fun/lub_constrain.hpp b/stan/math/prim/fun/lub_constrain.hpp index 0565a542dd8..0b0233ff1ff 100644 --- a/stan/math/prim/fun/lub_constrain.hpp +++ b/stan/math/prim/fun/lub_constrain.hpp @@ -376,9 +376,12 @@ inline auto lub_constrain(const std::vector& x, const std::vector& lb, *

\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. diff --git a/stan/math/prim/fun/offset_multiplier_constrain.hpp b/stan/math/prim/fun/offset_multiplier_constrain.hpp index a0a1f659b61..31ae64dc646 100644 --- a/stan/math/prim/fun/offset_multiplier_constrain.hpp +++ b/stan/math/prim/fun/offset_multiplier_constrain.hpp @@ -286,9 +286,12 @@ inline auto offset_multiplier_constrain(const std::vector& x, * reduces to identity_constrain(x). * * @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 @@ -297,9 +300,7 @@ inline auto offset_multiplier_constrain(const std::vector& x, * @throw std::domain_error if mu is not finite */ template -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& lp) { if (Jacobian) { return offset_multiplier_constrain(x, mu, sigma, lp); @@ -308,7 +309,6 @@ inline auto offset_multiplier_constrain(const T& x, } } - } // namespace math } // namespace stan diff --git a/stan/math/prim/fun/positive_constrain.hpp b/stan/math/prim/fun/positive_constrain.hpp index 51e6fc13fdc..2e1b6b69196 100644 --- a/stan/math/prim/fun/positive_constrain.hpp +++ b/stan/math/prim/fun/positive_constrain.hpp @@ -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) diff --git a/stan/math/prim/fun/positive_ordered_constrain.hpp b/stan/math/prim/fun/positive_ordered_constrain.hpp index cf47dbc700d..4493b01f460 100644 --- a/stan/math/prim/fun/positive_ordered_constrain.hpp +++ b/stan/math/prim/fun/positive_ordered_constrain.hpp @@ -63,7 +63,8 @@ inline auto positive_ordered_constrain(const Vec& x, scalar_type_t& 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. @@ -77,7 +78,6 @@ inline auto positive_ordered_constrain(const Vec& x, scalar_type_t& lp) { } } - } // namespace math } // namespace stan diff --git a/stan/math/prim/fun/ub_constrain.hpp b/stan/math/prim/fun/ub_constrain.hpp index 17e4f166953..3899aa05e66 100644 --- a/stan/math/prim/fun/ub_constrain.hpp +++ b/stan/math/prim/fun/ub_constrain.hpp @@ -236,8 +236,10 @@ inline auto ub_constrain(const std::vector& x, const std::vector& 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 diff --git a/test/unit/math/mix/fun/cholesky_corr_constrain_test.cpp b/test/unit/math/mix/fun/cholesky_corr_constrain_test.cpp index 79a3c244905..afdfd0cac7f 100644 --- a/test/unit/math/mix/fun/cholesky_corr_constrain_test.cpp +++ b/test/unit/math/mix/fun/cholesky_corr_constrain_test.cpp @@ -14,7 +14,7 @@ int inv_size(const T& x) { } template -auto g1( const T& x) { +auto g1(const T& x) { stan::scalar_type_t lp = 0; return stan::math::cholesky_corr_constrain(x, inv_size(x), lp); } diff --git a/test/unit/math/mix/fun/corr_constrain_test.cpp b/test/unit/math/mix/fun/corr_constrain_test.cpp index 22af875d1f2..696316e769e 100644 --- a/test/unit/math/mix/fun/corr_constrain_test.cpp +++ b/test/unit/math/mix/fun/corr_constrain_test.cpp @@ -2,8 +2,8 @@ TEST(mathMixMatFun, corr_constrain) { auto f = [](const auto& x1) { - stan::scalar_type_t> lp = 0.0; - return stan::math::corr_constrain(x1, lp); + stan::scalar_type_t> lp = 0.0; + return stan::math::corr_constrain(x1, lp); }; std::vector x0 = {-1.0, 2.0, 3.0}; diff --git a/test/unit/math/mix/fun/cov_matrix_constrain_test.cpp b/test/unit/math/mix/fun/cov_matrix_constrain_test.cpp index cb63bfa0131..c0ccd7cd15b 100644 --- a/test/unit/math/mix/fun/cov_matrix_constrain_test.cpp +++ b/test/unit/math/mix/fun/cov_matrix_constrain_test.cpp @@ -19,8 +19,7 @@ auto g1(const T& x) { return stan::math::cov_matrix_constrain(x, inv_size(x), lp); } template -auto g2( - const T& x) { +auto g2(const T& x) { typename stan::scalar_type::type lp = 0; auto a = stan::math::cov_matrix_constrain(x, inv_size(x), lp); return a; @@ -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> lp = 0.0; - return stan::math::cov_matrix_constrain(x1, K, lp); - }; + return [K](const auto& x1) { + stan::scalar_type_t> lp = 0.0; + return stan::math::cov_matrix_constrain(x1, K, lp); + }; }; Eigen::VectorXd x1(10);