From ebe8da206e0bdb3c6b62afdb8d47fd5e58f7610e Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Tue, 30 Jan 2024 12:35:31 -0500 Subject: [PATCH] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- .../hamiltonians/base_hamiltonian_test.cpp | 3 ++- .../hmc/hamiltonians/dense_e_metric_test.cpp | 2 -- .../hmc/hamiltonians/diag_e_metric_test.cpp | 2 -- .../hmc/hamiltonians/softabs_metric_test.cpp | 1 - .../hmc/hamiltonians/unit_e_metric_test.cpp | 1 - .../hmc/integrators/expl_leapfrog2_test.cpp | 2 -- .../hmc/integrators/expl_leapfrog_test.cpp | 13 +++++----- .../hmc/integrators/impl_leapfrog2_test.cpp | 4 --- .../hmc/integrators/impl_leapfrog_test.cpp | 25 +++++++++++-------- .../unit/variational/advi_messages_test.cpp | 5 ++-- .../advi_multivar_no_constraint_test.cpp | 6 +++-- .../unit/variational/eta_adapt_big_test.cpp | 4 +-- .../unit/variational/eta_adapt_fail_test.cpp | 4 +-- .../unit/variational/eta_adapt_small_test.cpp | 4 +-- .../unit/variational/gradient_warn_test.cpp | 5 ++-- .../unit/variational/hier_logistic_test.cpp | 4 +-- 16 files changed, 38 insertions(+), 47 deletions(-) diff --git a/src/test/unit/mcmc/hmc/hamiltonians/base_hamiltonian_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/base_hamiltonian_test.cpp index 41537c282c..1e70c18259 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/base_hamiltonian_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/base_hamiltonian_test.cpp @@ -14,7 +14,8 @@ TEST(BaseHamiltonian, update_potential_gradient) { funnel_model_namespace::funnel_model model(data_var_context, 0, &model_output); - stan::mcmc::mock_hamiltonian + stan::mcmc::mock_hamiltonian metric(model); stan::mcmc::ps_point z(11); z.q.setOnes(); diff --git a/src/test/unit/mcmc/hmc/hamiltonians/dense_e_metric_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/dense_e_metric_test.cpp index 9f78a43024..fc351755f3 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/dense_e_metric_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/dense_e_metric_test.cpp @@ -60,7 +60,6 @@ TEST(McmcDenseEMetric, sample_p) { } TEST(McmcDenseEMetric, gradients) { - Eigen::VectorXd q = Eigen::VectorXd::Ones(11); stan::mcmc::dense_e_point z(q.size()); @@ -153,7 +152,6 @@ TEST(McmcDenseEMetric, gradients) { TEST(McmcDenseEMetric, streams) { stan::test::capture_std_streams(); - Eigen::VectorXd q(2); q(0) = 5; q(1) = 1; diff --git a/src/test/unit/mcmc/hmc/hamiltonians/diag_e_metric_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/diag_e_metric_test.cpp index 475afbf56d..1e56a41b46 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/diag_e_metric_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/diag_e_metric_test.cpp @@ -42,7 +42,6 @@ TEST(McmcDiagEMetric, sample_p) { } TEST(McmcDiagEMetric, gradients) { - Eigen::VectorXd q = Eigen::VectorXd::Ones(11); stan::mcmc::diag_e_point z(q.size()); @@ -134,7 +133,6 @@ TEST(McmcDiagEMetric, gradients) { TEST(McmcDiagEMetric, streams) { stan::test::capture_std_streams(); - Eigen::VectorXd q(2); q(0) = 5; q(1) = 1; diff --git a/src/test/unit/mcmc/hmc/hamiltonians/softabs_metric_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/softabs_metric_test.cpp index 0804105101..194abacc0f 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/softabs_metric_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/softabs_metric_test.cpp @@ -57,7 +57,6 @@ TEST(McmcSoftAbs, sample_p) { } TEST(McmcSoftAbs, gradients) { - Eigen::VectorXd q = Eigen::VectorXd::Ones(11); stan::mcmc::softabs_point z(q.size()); diff --git a/src/test/unit/mcmc/hmc/hamiltonians/unit_e_metric_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/unit_e_metric_test.cpp index 177c8905aa..51262a16dd 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/unit_e_metric_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/unit_e_metric_test.cpp @@ -42,7 +42,6 @@ TEST(McmcUnitEMetric, sample_p) { } TEST(McmcUnitEMetric, gradients) { - Eigen::VectorXd q = Eigen::VectorXd::Ones(11); stan::mcmc::unit_e_point z(q.size()); diff --git a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog2_test.cpp b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog2_test.cpp index dee3dc18cf..175a4b2e0b 100644 --- a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog2_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog2_test.cpp @@ -10,7 +10,6 @@ #include TEST(McmcHmcIntegratorsExplLeapfrog, energy_conservation) { - stan::io::empty_var_context data_var_context; std::stringstream model_output; @@ -58,7 +57,6 @@ TEST(McmcHmcIntegratorsExplLeapfrog, energy_conservation) { } TEST(McmcHmcIntegratorsExplLeapfrog, symplecticness) { - stan::io::empty_var_context data_var_context; std::stringstream model_output; diff --git a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp index 24a8b388e5..629ff3ac5a 100644 --- a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp @@ -15,7 +15,6 @@ // namespace //************************************************************ - class McmcHmcIntegratorsExplLeapfrogF : public testing::Test { public: McmcHmcIntegratorsExplLeapfrogF() @@ -43,12 +42,12 @@ class McmcHmcIntegratorsExplLeapfrogF : public testing::Test { stan::callbacks::stream_logger logger; // integrator under test - stan::mcmc::expl_leapfrog< - stan::mcmc::unit_e_metric > + stan::mcmc::expl_leapfrog > unit_e_integrator; - stan::mcmc::expl_leapfrog< - stan::mcmc::diag_e_metric > + stan::mcmc::expl_leapfrog > diag_e_integrator; // model @@ -445,8 +444,8 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, evolve_9) { TEST_F(McmcHmcIntegratorsExplLeapfrogF, streams) { stan::test::capture_std_streams(); - typedef stan::mcmc::expl_leapfrog< - stan::mcmc::unit_e_metric > + typedef stan::mcmc::expl_leapfrog > integrator; EXPECT_NO_THROW(integrator i); diff --git a/src/test/unit/mcmc/hmc/integrators/impl_leapfrog2_test.cpp b/src/test/unit/mcmc/hmc/integrators/impl_leapfrog2_test.cpp index 088de2066e..23f72a40fa 100644 --- a/src/test/unit/mcmc/hmc/integrators/impl_leapfrog2_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/impl_leapfrog2_test.cpp @@ -12,7 +12,6 @@ #include TEST(McmcHmcIntegratorsImplLeapfrog, unit_e_energy_conservation) { - stan::io::empty_var_context data_var_context; std::stringstream model_output; @@ -60,7 +59,6 @@ TEST(McmcHmcIntegratorsImplLeapfrog, unit_e_energy_conservation) { } TEST(McmcHmcIntegratorsImplLeapfrog, unit_e_symplecticness) { - stan::io::empty_var_context data_var_context; std::stringstream model_output; @@ -146,7 +144,6 @@ TEST(McmcHmcIntegratorsImplLeapfrog, unit_e_symplecticness) { } TEST(McmcHmcIntegratorsImplLeapfrog, softabs_energy_conservation) { - stan::io::empty_var_context data_var_context; std::stringstream model_output; @@ -194,7 +191,6 @@ TEST(McmcHmcIntegratorsImplLeapfrog, softabs_energy_conservation) { } TEST(McmcHmcIntegratorsImplLeapfrog, softabs_symplecticness) { - stan::io::empty_var_context data_var_context; std::stringstream model_output; diff --git a/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp b/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp index ce5a632528..3944f0d5e2 100644 --- a/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp @@ -9,7 +9,6 @@ #include #include - #include #include @@ -44,12 +43,12 @@ class McmcHmcIntegratorsImplLeapfrogF : public testing::Test { stan::callbacks::stream_logger logger; // integrator under test - stan::mcmc::impl_leapfrog< - stan::mcmc::unit_e_metric > + stan::mcmc::impl_leapfrog > unit_e_integrator; - stan::mcmc::impl_leapfrog< - stan::mcmc::diag_e_metric > + stan::mcmc::impl_leapfrog > diag_e_integrator; stan::mcmc::impl_leapfrog + stan::mcmc::softabs_metric hamiltonian(*model); // setup epsilon @@ -171,7 +171,8 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, softabs_update_q) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::softabs_metric + stan::mcmc::softabs_metric hamiltonian(*model); // setup epsilon @@ -237,7 +238,8 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, softabs_end_update_p) { EXPECT_NEAR(z.g(0), 1.67264975797776, 1e-15); // setup hamiltonian - stan::mcmc::softabs_metric + stan::mcmc::softabs_metric hamiltonian(*model); // setup epsilon @@ -559,7 +561,8 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, softabs_evolve) { EXPECT_NEAR(z.g(0), 1.27097196280777, 1e-15); // setup hamiltonian - stan::mcmc::softabs_metric + stan::mcmc::softabs_metric hamiltonian(*model); // setup epsilon @@ -583,8 +586,8 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, softabs_evolve) { TEST_F(McmcHmcIntegratorsImplLeapfrogF, streams) { stan::test::capture_std_streams(); - typedef stan::mcmc::impl_leapfrog< - stan::mcmc::unit_e_metric > + typedef stan::mcmc::impl_leapfrog > integrator; EXPECT_NO_THROW(integrator i); diff --git a/src/test/unit/variational/advi_messages_test.cpp b/src/test/unit/variational/advi_messages_test.cpp index 5441891dfd..3371186cba 100644 --- a/src/test/unit/variational/advi_messages_test.cpp +++ b/src/test/unit/variational/advi_messages_test.cpp @@ -8,7 +8,6 @@ #include #include - class advi_test : public ::testing::Test { public: advi_test() @@ -56,8 +55,8 @@ class advi_test : public ::testing::Test { stan::variational::advi *advi_meanfield_; - stan::variational::advi - *advi_fullrank_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream log_stream_; std::stringstream parameter_stream_; diff --git a/src/test/unit/variational/advi_multivar_no_constraint_test.cpp b/src/test/unit/variational/advi_multivar_no_constraint_test.cpp index 9c5fc96007..a0513690c7 100644 --- a/src/test/unit/variational/advi_multivar_no_constraint_test.cpp +++ b/src/test/unit/variational/advi_multivar_no_constraint_test.cpp @@ -35,7 +35,8 @@ TEST(advi_test, multivar_no_constraint_fullrank) { cont_params(1) = 0.75; // ADVI - stan::variational::advi + stan::variational::advi test_advi(my_model, cont_params, base_rng, n_monte_carlo_grad, n_grad_samples, 100, 1); @@ -152,7 +153,8 @@ TEST(advi_test, multivar_no_constraint_meanfield) { cont_params(1) = 0.75; // ADVI - stan::variational::advi + stan::variational::advi test_advi(my_model, cont_params, base_rng, n_monte_carlo_grad, 1e4, // absurdly high! 100, 1); diff --git a/src/test/unit/variational/eta_adapt_big_test.cpp b/src/test/unit/variational/eta_adapt_big_test.cpp index b07808b716..2d7f7a2ce5 100644 --- a/src/test/unit/variational/eta_adapt_big_test.cpp +++ b/src/test/unit/variational/eta_adapt_big_test.cpp @@ -42,8 +42,8 @@ class eta_adapt_big_test : public ::testing::Test { stan::variational::advi *advi_meanfield_; - stan::variational::advi - *advi_fullrank_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream log_stream_; stan::callbacks::stream_logger logger; diff --git a/src/test/unit/variational/eta_adapt_fail_test.cpp b/src/test/unit/variational/eta_adapt_fail_test.cpp index 36d770aa02..84229f839c 100644 --- a/src/test/unit/variational/eta_adapt_fail_test.cpp +++ b/src/test/unit/variational/eta_adapt_fail_test.cpp @@ -42,8 +42,8 @@ class eta_should_fail_test : public ::testing::Test { stan::variational::advi *advi_meanfield_; - stan::variational::advi - *advi_fullrank_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream log_stream_; stan::callbacks::stream_logger logger; diff --git a/src/test/unit/variational/eta_adapt_small_test.cpp b/src/test/unit/variational/eta_adapt_small_test.cpp index 4328e6ff6a..715d68c4c7 100644 --- a/src/test/unit/variational/eta_adapt_small_test.cpp +++ b/src/test/unit/variational/eta_adapt_small_test.cpp @@ -43,8 +43,8 @@ class eta_adapt_small_test : public ::testing::Test { stan::variational::advi *advi_meanfield_; - stan::variational::advi - *advi_fullrank_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream log_stream_; stan::callbacks::stream_logger logger; diff --git a/src/test/unit/variational/gradient_warn_test.cpp b/src/test/unit/variational/gradient_warn_test.cpp index c8ac490b88..de9b476b26 100644 --- a/src/test/unit/variational/gradient_warn_test.cpp +++ b/src/test/unit/variational/gradient_warn_test.cpp @@ -10,7 +10,6 @@ #include #include - class advi_test : public ::testing::Test { public: advi_test() @@ -50,8 +49,8 @@ class advi_test : public ::testing::Test { stan::variational::advi *advi_meanfield_; - stan::variational::advi - *advi_fullrank_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream message_stream_; std::stringstream parameter_stream_; diff --git a/src/test/unit/variational/hier_logistic_test.cpp b/src/test/unit/variational/hier_logistic_test.cpp index c7e8ada23d..a469fba98e 100644 --- a/src/test/unit/variational/hier_logistic_test.cpp +++ b/src/test/unit/variational/hier_logistic_test.cpp @@ -52,8 +52,8 @@ class advi_test : public ::testing::Test { stan::variational::advi *advi_; - stan::variational::advi - *advi_fullrank_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream message_stream_; std::stringstream parameter_stream_;