Use move constructor
parent
08167d08cc
commit
8d4233587c
|
@ -110,15 +110,15 @@ struct HybridGaussianConditional::Helper {
|
|||
|
||||
/* *******************************************************************************/
|
||||
HybridGaussianConditional::HybridGaussianConditional(
|
||||
const DiscreteKeys &discreteParents, const Helper &helper)
|
||||
const DiscreteKeys &discreteParents, Helper &&helper)
|
||||
: BaseFactor(discreteParents,
|
||||
FactorValuePairs(helper.pairs,
|
||||
[&](const GaussianFactorValuePair &
|
||||
pair) { // subtract minNegLogConstant
|
||||
return GaussianFactorValuePair{
|
||||
pair.first,
|
||||
pair.second - helper.minNegLogConstant};
|
||||
})),
|
||||
FactorValuePairs(
|
||||
[&](const GaussianFactorValuePair
|
||||
&pair) { // subtract minNegLogConstant
|
||||
return GaussianFactorValuePair{
|
||||
pair.first, pair.second - helper.minNegLogConstant};
|
||||
},
|
||||
std::move(helper.pairs))),
|
||||
BaseConditional(*helper.nrFrontals),
|
||||
negLogConstant_(helper.minNegLogConstant) {}
|
||||
|
||||
|
|
|
@ -241,7 +241,7 @@ class GTSAM_EXPORT HybridGaussianConditional
|
|||
|
||||
/// Private constructor that uses helper struct above.
|
||||
HybridGaussianConditional(const DiscreteKeys &discreteParents,
|
||||
const Helper &helper);
|
||||
Helper &&helper);
|
||||
|
||||
/// Check whether `given` has values for all frontal keys.
|
||||
bool allFrontalsGiven(const VectorValues &given) const;
|
||||
|
|
Loading…
Reference in New Issue