Skip to content

Commit b1af49d

Browse files
authored
Merge pull request QMCPACK#5558 from ye-luo/more-const
More const reference to ParticleSet in DT.
2 parents 2903dc4 + 15de72c commit b1af49d

9 files changed

Lines changed: 18 additions & 14 deletions

src/Particle/SoaDistanceTableAA.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct SoaDistanceTableAA : public DTD_BConds<T, D, SC>, public DistanceTableAA
2727
/// actual memory for dist and displacements_
2828
aligned_vector<RealType> memory_pool_;
2929

30-
SoaDistanceTableAA(ParticleSet& target)
30+
SoaDistanceTableAA(const ParticleSet& target)
3131
: DTD_BConds<T, D, SC>(target.getLattice()),
3232
DistanceTableAA(target, DTModes::ALL_OFF),
3333
num_targets_padded_(getAlignedSize<T>(num_targets_)),

src/Particle/SoaDistanceTableAAOMPTarget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct SoaDistanceTableAAOMPTarget : public DTD_BConds<T, D, SC>, public Distanc
6565

6666
ResourceHandle<DTAAMultiWalkerMem> mw_mem_handle_;
6767

68-
SoaDistanceTableAAOMPTarget(ParticleSet& target)
68+
SoaDistanceTableAAOMPTarget(const ParticleSet& target)
6969
: DTD_BConds<T, D, SC>(target.getLattice()),
7070
DistanceTableAA(target, DTModes::ALL_OFF),
7171
num_targets_padded_(getAlignedSize<T>(num_targets_)),

src/Particle/SoaDistanceTableAB.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace qmcplusplus
2525
template<typename T, unsigned D, int SC>
2626
struct SoaDistanceTableAB : public DTD_BConds<T, D, SC>, public DistanceTableAB
2727
{
28-
SoaDistanceTableAB(const ParticleSet& source, ParticleSet& target)
28+
SoaDistanceTableAB(const ParticleSet& source, const ParticleSet& target)
2929
: DTD_BConds<T, D, SC>(source.getLattice()),
3030
DistanceTableAB(source, target, DTModes::ALL_OFF),
3131
evaluate_timer_(createGlobalTimer(std::string("DTAB::evaluate_") + target.getName() + "_" + source.getName(),

src/Particle/SoaDistanceTableABOMPTarget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class SoaDistanceTableABOMPTarget : public DTD_BConds<T, D, SC>, public Distance
117117
}
118118

119119
public:
120-
SoaDistanceTableABOMPTarget(const ParticleSet& source, ParticleSet& target)
120+
SoaDistanceTableABOMPTarget(const ParticleSet& source, const ParticleSet& target)
121121
: DTD_BConds<T, D, SC>(source.getLattice()),
122122
DistanceTableAB(source, target, DTModes::ALL_OFF),
123123
offload_timer_(createGlobalTimer(std::string("DTABOMPTarget::offload_") + name_, timer_level_fine)),

src/Particle/createDistanceTable.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ namespace qmcplusplus
3737
*/
3838

3939
///free function to create a distable table of s-s
40-
std::unique_ptr<DistanceTable> createDistanceTableAA(ParticleSet& s, std::ostream& description);
41-
std::unique_ptr<DistanceTable> createDistanceTableAAOMPTarget(ParticleSet& s, std::ostream& description);
40+
std::unique_ptr<DistanceTable> createDistanceTableAA(const ParticleSet& s, std::ostream& description);
41+
std::unique_ptr<DistanceTable> createDistanceTableAAOMPTarget(const ParticleSet& s, std::ostream& description);
4242

43-
inline std::unique_ptr<DistanceTable> createDistanceTable(ParticleSet& s, std::ostream& description)
43+
inline std::unique_ptr<DistanceTable> createDistanceTable(const ParticleSet& s, std::ostream& description)
4444
{
4545
// during P-by-P move, the cost of single particle evaluation of distance tables
4646
// is determined by the number of source particles.
@@ -52,13 +52,15 @@ inline std::unique_ptr<DistanceTable> createDistanceTable(ParticleSet& s, std::o
5252
}
5353

5454
///free function create a distable table of s-t
55-
std::unique_ptr<DistanceTable> createDistanceTableAB(const ParticleSet& s, ParticleSet& t, std::ostream& description);
55+
std::unique_ptr<DistanceTable> createDistanceTableAB(const ParticleSet& s,
56+
const ParticleSet& t,
57+
std::ostream& description);
5658
std::unique_ptr<DistanceTable> createDistanceTableABOMPTarget(const ParticleSet& s,
57-
ParticleSet& t,
59+
const ParticleSet& t,
5860
std::ostream& description);
5961

6062
inline std::unique_ptr<DistanceTable> createDistanceTable(const ParticleSet& s,
61-
ParticleSet& t,
63+
const ParticleSet& t,
6264
std::ostream& description)
6365
{
6466
// during P-by-P move, the cost of single particle evaluation of distance tables

src/Particle/createDistanceTableAA.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace qmcplusplus
2424
*\param s source/target particle set
2525
*\return index of the distance table with the name
2626
*/
27-
std::unique_ptr<DistanceTable> createDistanceTableAA(ParticleSet& s, std::ostream& description)
27+
std::unique_ptr<DistanceTable> createDistanceTableAA(const ParticleSet& s, std::ostream& description)
2828
{
2929
using RealType = OHMMS_PRECISION;
3030
enum

src/Particle/createDistanceTableAAOMPTarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace qmcplusplus
2424
*\param s source/target particle set
2525
*\return index of the distance table with the name
2626
*/
27-
std::unique_ptr<DistanceTable> createDistanceTableAAOMPTarget(ParticleSet& s, std::ostream& description)
27+
std::unique_ptr<DistanceTable> createDistanceTableAAOMPTarget(const ParticleSet& s, std::ostream& description)
2828
{
2929
using RealType = OHMMS_PRECISION;
3030
enum

src/Particle/createDistanceTableAB.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ namespace qmcplusplus
2424
*\param s source/target particle set
2525
*\return index of the distance table with the name
2626
*/
27-
std::unique_ptr<DistanceTable> createDistanceTableAB(const ParticleSet& s, ParticleSet& t, std::ostream& description)
27+
std::unique_ptr<DistanceTable> createDistanceTableAB(const ParticleSet& s,
28+
const ParticleSet& t,
29+
std::ostream& description)
2830
{
2931
using RealType = ParticleSet::RealType;
3032
enum

src/Particle/createDistanceTableABOMPTarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace qmcplusplus
2525
*\return index of the distance table with the name
2626
*/
2727
std::unique_ptr<DistanceTable> createDistanceTableABOMPTarget(const ParticleSet& s,
28-
ParticleSet& t,
28+
const ParticleSet& t,
2929
std::ostream& description)
3030
{
3131
using RealType = ParticleSet::RealType;

0 commit comments

Comments
 (0)