diff --git a/src/QMCWaveFunctions/TrialWaveFunction.h b/src/QMCWaveFunctions/TrialWaveFunction.h index 82dc265e2e..25d9328550 100644 --- a/src/QMCWaveFunctions/TrialWaveFunction.h +++ b/src/QMCWaveFunctions/TrialWaveFunction.h @@ -471,6 +471,7 @@ class TrialWaveFunction void evaluateRatiosAlltoOne(ParticleSet& P, std::vector& ratios); void setTwist(const std::vector& t) { myTwist = t; } + void setTwist(std::vector&& t) { myTwist = std::move(t); } const std::vector& twist() const { return myTwist; } inline void setMassTerm(ParticleSet& P) diff --git a/src/QMCWaveFunctions/WaveFunctionFactory.cpp b/src/QMCWaveFunctions/WaveFunctionFactory.cpp index 496bf76164..a6efb4378e 100644 --- a/src/QMCWaveFunctions/WaveFunctionFactory.cpp +++ b/src/QMCWaveFunctions/WaveFunctionFactory.cpp @@ -70,7 +70,6 @@ std::unique_ptr WaveFunctionFactory::buildTWF(xmlNodePtr cur, SPOSetBuilderFactory sposet_builder_factory(myComm, targetPtcl, ptclPool); std::string vp_file_to_load; - std::vector tsts(3, 0.); cur = cur->children; while (cur != NULL) { @@ -92,8 +91,9 @@ std::unique_ptr WaveFunctionFactory::buildTWF(xmlNodePtr cur, attribs.add(hdfName, "name"); if (hdfName == "twistAngle") { - putContent(tsts, kcur); - targetPsi->setTwist(tsts); + std::vector twists(3, 0); + putContent(twists, kcur); + targetPsi->setTwist(std::move(twists)); foundtwist = true; } } @@ -102,9 +102,7 @@ std::unique_ptr WaveFunctionFactory::buildTWF(xmlNodePtr cur, if (!foundtwist) { //default twist is [0 0 0] - tsts.resize(3); - std::fill(std::begin(tsts), std::end(tsts), 0.); - targetPsi->setTwist(tsts); + targetPsi->setTwist(std::vector(3, 0)); } } else if (cname == WaveFunctionComponentBuilder::jastrow_tag)