-
-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2269 from stan-dev/bugfix/issue-2268_fix_nuts_cla…
…ssic_comp_err Bugfix/issue 2268 fix nuts classic comp err
- Loading branch information
Showing
12 changed files
with
114 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include <test/test-models/good/mcmc/hmc/common/gauss3D.hpp> | ||
#include <stan/callbacks/stream_writer.hpp> | ||
#include <stan/mcmc/hmc/nuts/unit_e_nuts.hpp> | ||
#include <stan/mcmc/hmc/nuts/diag_e_nuts.hpp> | ||
#include <stan/mcmc/hmc/nuts/dense_e_nuts.hpp> | ||
#include <stan/mcmc/hmc/nuts/adapt_unit_e_nuts.hpp> | ||
#include <stan/mcmc/hmc/nuts/adapt_diag_e_nuts.hpp> | ||
#include <stan/mcmc/hmc/nuts/adapt_dense_e_nuts.hpp> | ||
#include <boost/random/additive_combine.hpp> | ||
#include <stan/io/dump.hpp> | ||
#include <fstream> | ||
|
||
#include <gtest/gtest.h> | ||
|
||
typedef boost::ecuyer1988 rng_t; | ||
|
||
TEST(McmcNuts, instantiaton_test) { | ||
rng_t base_rng(4839294); | ||
|
||
std::stringstream output; | ||
stan::callbacks::stream_writer writer(output); | ||
std::stringstream error_stream; | ||
stan::callbacks::stream_writer error_writer(error_stream); | ||
|
||
std::fstream empty_stream("", std::fstream::in); | ||
stan::io::dump data_var_context(empty_stream); | ||
gauss3D_model_namespace::gauss3D_model model(data_var_context); | ||
|
||
stan::mcmc::unit_e_nuts<gauss3D_model_namespace::gauss3D_model, rng_t> | ||
unit_e_sampler(model, base_rng); | ||
|
||
stan::mcmc::diag_e_nuts<gauss3D_model_namespace::gauss3D_model, rng_t> | ||
diag_e_sampler(model, base_rng); | ||
|
||
stan::mcmc::dense_e_nuts<gauss3D_model_namespace::gauss3D_model, rng_t> | ||
dense_e_sampler(model, base_rng); | ||
|
||
stan::mcmc::adapt_unit_e_nuts<gauss3D_model_namespace::gauss3D_model, rng_t> | ||
adapt_unit_e_sampler(model, base_rng); | ||
|
||
stan::mcmc::adapt_diag_e_nuts<gauss3D_model_namespace::gauss3D_model, rng_t> | ||
adapt_diag_e_sampler(model, base_rng); | ||
|
||
stan::mcmc::adapt_dense_e_nuts<gauss3D_model_namespace::gauss3D_model, rng_t> | ||
adapt_dense_e_sampler(model, base_rng); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/test/unit/mcmc/hmc/nuts_classic/instantiation_test.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include <test/test-models/good/mcmc/hmc/common/gauss3D.hpp> | ||
#include <stan/callbacks/stream_writer.hpp> | ||
#include <stan/mcmc/hmc/nuts_classic/unit_e_nuts_classic.hpp> | ||
#include <stan/mcmc/hmc/nuts_classic/diag_e_nuts_classic.hpp> | ||
#include <stan/mcmc/hmc/nuts_classic/dense_e_nuts_classic.hpp> | ||
#include <stan/mcmc/hmc/nuts_classic/adapt_unit_e_nuts_classic.hpp> | ||
#include <stan/mcmc/hmc/nuts_classic/adapt_diag_e_nuts_classic.hpp> | ||
#include <stan/mcmc/hmc/nuts_classic/adapt_dense_e_nuts_classic.hpp> | ||
#include <boost/random/additive_combine.hpp> | ||
#include <stan/io/dump.hpp> | ||
#include <fstream> | ||
|
||
#include <gtest/gtest.h> | ||
|
||
typedef boost::ecuyer1988 rng_t; | ||
|
||
TEST(McmcNutsClassic, instantiaton_test) { | ||
rng_t base_rng(4839294); | ||
|
||
std::stringstream output; | ||
stan::callbacks::stream_writer writer(output); | ||
std::stringstream error_stream; | ||
stan::callbacks::stream_writer error_writer(error_stream); | ||
|
||
std::fstream empty_stream("", std::fstream::in); | ||
stan::io::dump data_var_context(empty_stream); | ||
gauss3D_model_namespace::gauss3D_model model(data_var_context); | ||
|
||
stan::mcmc::unit_e_nuts_classic<gauss3D_model_namespace::gauss3D_model, rng_t> | ||
unit_e_sampler(model, base_rng); | ||
|
||
stan::mcmc::diag_e_nuts_classic<gauss3D_model_namespace::gauss3D_model, rng_t> | ||
diag_e_sampler(model, base_rng); | ||
|
||
stan::mcmc::dense_e_nuts_classic<gauss3D_model_namespace::gauss3D_model, rng_t> | ||
dense_e_sampler(model, base_rng); | ||
|
||
stan::mcmc::adapt_unit_e_nuts_classic<gauss3D_model_namespace::gauss3D_model, rng_t> | ||
adapt_unit_e_sampler(model, base_rng); | ||
|
||
stan::mcmc::adapt_diag_e_nuts_classic<gauss3D_model_namespace::gauss3D_model, rng_t> | ||
adapt_diag_e_sampler(model, base_rng); | ||
|
||
stan::mcmc::adapt_dense_e_nuts_classic<gauss3D_model_namespace::gauss3D_model, rng_t> | ||
adapt_dense_e_sampler(model, base_rng); | ||
} |