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 4c2873033ad..9152cc47280 100644 --- a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp @@ -417,7 +417,9 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, evolve_9) { z.q(0) = 1.27097196280777; z.p(0) = -0.159996782671291; z.g(0) = 1.27097196280777; - z.get_inv_metric()(0) = 0.733184698671436; + Eigen::VectorXd inv_metric(1); + inv_metric << 0.733184698671436; + z.set_inv_metric(inv_metric); EXPECT_NEAR(z.V, 0.807684865121721, 1e-15); EXPECT_NEAR(z.q(0), 1.27097196280777, 1e-15); EXPECT_NEAR(z.p(0), -0.159996782671291, 1e-15);