Use move constructor
parent
08167d08cc
commit
8d4233587c
|
@ -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) {}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue