Created
July 12, 2020 21:49
-
-
Save smrfeld/3140f3a3d34af3feb9b1f4f819172297 to your computer and use it in GitHub Desktop.
Second Carma method
This file contains hidden or 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
py::array_t<double> sample(const py::array_t<double> &state_init, int no_steps) const { | |
// Convert to arma | |
arma::imat state_init_arma = carma::arr_to_mat<arma::sword>(state_init); | |
// Call | |
arma::imat state_arma = GibbsSampler::sample(state_init_arma, no_steps); | |
// Convert back to NumPy | |
py::array_t<double> state = carma::mat_to_arr<arma::sword>(state_arma); | |
return state; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment