QMCPACK
MCCoords.hpp
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) 2022 QMCPACK developers.
6 //
7 // File developed by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
8 // Cody A. Melton, cmelton@sandia.gov, Sandia National Laboratories
9 //
10 // File created by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
11 //////////////////////////////////////////////////////////////////////////////////////
12 
13 #ifndef QMCPLUSPLUS_MCCOORDS_HPP
14 #define QMCPLUSPLUS_MCCOORDS_HPP
15 
16 #include "Configuration.h"
18 #include <algorithm>
19 
20 #include <vector>
21 
22 namespace qmcplusplus
23 {
24 enum class CoordsType
25 {
26  POS,
27  POS_SPIN
28 };
29 
30 template<CoordsType MCT>
31 struct MCCoords;
32 
33 template<>
35 {
36  MCCoords(const std::size_t size) : positions(size) {}
37 
38  MCCoords& operator+=(const MCCoords& rhs);
39 
40  /** get subset of MCCoords
41  * [param,out] out
42  */
43  void getSubset(const std::size_t offset, const std::size_t size, MCCoords<CoordsType::POS>& out) const;
44 
45  std::vector<QMCTraits::PosType> positions;
46 };
47 
48 template<>
50 {
51  MCCoords(const std::size_t size) : positions(size), spins(size) {}
52 
53  MCCoords& operator+=(const MCCoords& rhs);
54 
55  /** get subset of MCCoords
56  * [param,out] out
57  */
58  void getSubset(const std::size_t offset, const std::size_t size, MCCoords<CoordsType::POS_SPIN>& out) const;
59 
60  std::vector<QMCTraits::PosType> positions;
61  std::vector<QMCTraits::FullPrecRealType> spins;
62 };
63 
64 extern template struct MCCoords<CoordsType::POS>;
65 extern template struct MCCoords<CoordsType::POS_SPIN>;
66 } // namespace qmcplusplus
67 
68 #endif
std::vector< QMCTraits::PosType > positions
Definition: MCCoords.hpp:60
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
Matrix< T1, C1 > & operator+=(Matrix< T1, C1 > &lhs, const RHS &rhs)
std::vector< QMCTraits::FullPrecRealType > spins
Definition: MCCoords.hpp:61
std::vector< QMCTraits::PosType > positions
Definition: MCCoords.hpp:45
MCCoords(const std::size_t size)
Definition: MCCoords.hpp:36