QMCPACK
GenerateRandomParticleSets.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2024 QMCPACK developers.
6 //
7 // File developed by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Lab
8 //
9 // File created by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Lab
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 /** \file
13  * Some ParticleSet functions use the global Random so we need some helper functions to
14  * avoid interminant test state when multiple tests are run from a single test program.
15  */
16 
17 #ifndef QMCPLUSPLUS_TESTING_GENERATE_RANDOM_PARTICLE_SETS_H
18 #define QMCPLUSPLUS_TESTING_GENERATE_RANDOM_PARTICLE_SETS_H
19 
20 #include <vector>
21 #include <ParticleSet.h>
22 
23 namespace qmcplusplus
24 {
25 
26 namespace testing
27 {
28 /**
29  * This function sets particle set positions from a set of Rs or writes out a set of positions for test reproducibility.
30  */
31 template<bool GEN_TEST_DATA>
32 std::vector<ParticleSet> generateRandomParticleSets(ParticleSet& pset_target,
33  ParticleSet& pset_source,
34  std::vector<ParticleSet::ParticlePos>& deterministic_rs,
35  int num_psets);
36 
37 extern template std::vector<ParticleSet> generateRandomParticleSets<false>(
38  ParticleSet& pset_target,
39  ParticleSet& pset_source,
40  std::vector<ParticleSet::ParticlePos>& deterministic_rs,
41  int num_psets);
42 extern template std::vector<ParticleSet> generateRandomParticleSets<true>(
43  ParticleSet& pset_target,
44  ParticleSet& pset_source,
45  std::vector<ParticleSet::ParticlePos>& deterministic_rs,
46  int num_psets);
47 
48 } // namespace testing
49 } // namespace qmcplusplus
50 
51 #endif
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
std::vector< ParticleSet > generateRandomParticleSets(ParticleSet &pset_target, ParticleSet &pset_source, std::vector< ParticleSet::ParticlePos > &deterministic_rs, int num_psets)
This function sets particle set positions from a set of Rs or writes out a set of positions for test ...
template std::vector< ParticleSet > generateRandomParticleSets< false >(ParticleSet &pset_target, ParticleSet &pset_source, std::vector< ParticleSet::ParticlePos > &deterministic_rs, int num_psets)
template std::vector< ParticleSet > generateRandomParticleSets< true >(ParticleSet &pset_target, ParticleSet &pset_source, std::vector< ParticleSet::ParticlePos > &deterministic_rs, int num_psets)