Use move constructor

release/4.3a0
Frank Dellaert 2024-10-16 14:45:41 -07:00
parent 08167d08cc
commit 8d4233587c
2 changed files with 9 additions and 9 deletions

View File

@ -110,15 +110,15 @@ struct HybridGaussianConditional::Helper {
/* *******************************************************************************/ /* *******************************************************************************/
HybridGaussianConditional::HybridGaussianConditional( HybridGaussianConditional::HybridGaussianConditional(
const DiscreteKeys &discreteParents, const Helper &helper) const DiscreteKeys &discreteParents, Helper &&helper)
: BaseFactor(discreteParents, : BaseFactor(discreteParents,
FactorValuePairs(helper.pairs, FactorValuePairs(
[&](const GaussianFactorValuePair & [&](const GaussianFactorValuePair
pair) { // subtract minNegLogConstant &pair) { // subtract minNegLogConstant
return GaussianFactorValuePair{ return GaussianFactorValuePair{
pair.first, pair.first, pair.second - helper.minNegLogConstant};
pair.second - helper.minNegLogConstant}; },
})), std::move(helper.pairs))),
BaseConditional(*helper.nrFrontals), BaseConditional(*helper.nrFrontals),
negLogConstant_(helper.minNegLogConstant) {} negLogConstant_(helper.minNegLogConstant) {}

View File

@ -241,7 +241,7 @@ class GTSAM_EXPORT HybridGaussianConditional
/// Private constructor that uses helper struct above. /// Private constructor that uses helper struct above.
HybridGaussianConditional(const DiscreteKeys &discreteParents, HybridGaussianConditional(const DiscreteKeys &discreteParents,
const Helper &helper); Helper &&helper);
/// Check whether `given` has values for all frontal keys. /// Check whether `given` has values for all frontal keys.
bool allFrontalsGiven(const VectorValues &given) const; bool allFrontalsGiven(const VectorValues &given) const;