38 auto fake_est_uptr = std::make_unique<FakeEstimator>();
39 auto fake_est = fake_est_uptr.get();
41 em.
add(std::move(fake_est_uptr),
"fake");
60 TEST_CASE(
"Estimator adhoc addVector operator",
"[estimators]")
63 std::vector<double> vec_a{1.0, 2.0, 3.0};
64 std::vector<double> vec_b{2.0, 3.0, 4.0};
65 std::vector<std::vector<double>> est{vec_a, vec_b};
66 auto addVectors = [](
const auto& vec_a,
const auto& vec_b) {
67 std::vector<ScalarEstimatorBase::RealType> result_vector(vec_a.size(), 0.0);
68 for (
int i = 0; i < vec_a.size(); ++i)
69 result_vector[i] = vec_a[i] + vec_b[i];
73 std::vector<double> reduced_scalars(num_scalars);
74 reduced_scalars = std::accumulate(est.begin(), est.end(), std::vector<double>(num_scalars, 0.0), addVectors);
75 std::vector<double> correct{3.0, 5.0, 7.0};
76 REQUIRE(reduced_scalars == correct);
int add(std::unique_ptr< EstimatorType > newestimator, const std::string &aname)
add an Estimator
EstimatorType * getEstimator(const std::string &a)
return a pointer to the estimator aname
helper functions for EinsplineSetBuilder
TEST_CASE("complex_helper", "[type_traits]")
Communicate * Controller
Global Communicator for a process.
void stop()
stop a qmc run
int size() const
return the number of ScalarEstimators
Wrapping information on parallelism.
REQUIRE(std::filesystem::exists(filename))
Manager class of scalar estimators.
Class to manage a set of ScalarEstimators.
void reset()
reset the estimator
Abstract class for an estimator of a scalar operator.
void start(int blocks, bool record=true)
start a run
Declaration of a MCWalkerConfiguration.
Declaration of QMCHamiltonian.