18
18
19
19
#pragma once
20
20
21
- #include < gtsam/inference/Conditional-inst.h>
22
21
#include < gtsam/discrete/DecisionTreeFactor.h>
23
22
#include < gtsam/discrete/Signature.h>
23
+ #include < gtsam/inference/Conditional-inst.h>
24
24
25
25
#include < memory>
26
26
#include < string>
@@ -39,7 +39,7 @@ class GTSAM_EXPORT DiscreteConditional
39
39
public Conditional<DecisionTreeFactor, DiscreteConditional> {
40
40
public:
41
41
// typedefs needed to play nice with gtsam
42
- typedef DiscreteConditional This; // /< Typedef to this class
42
+ typedef DiscreteConditional This; // /< Typedef to this class
43
43
typedef std::shared_ptr<This> shared_ptr; // /< shared_ptr to this class
44
44
typedef DecisionTreeFactor BaseFactor; // /< Typedef to our factor base class
45
45
typedef Conditional<BaseFactor, This>
@@ -159,9 +159,7 @@ class GTSAM_EXPORT DiscreteConditional
159
159
// / @{
160
160
161
161
// / Log-probability is just -error(x).
162
- double logProbability (const DiscreteValues& x) const {
163
- return -error (x);
164
- }
162
+ double logProbability (const DiscreteValues& x) const { return -error (x); }
165
163
166
164
// / print index signature only
167
165
void printSignature (
@@ -214,10 +212,11 @@ class GTSAM_EXPORT DiscreteConditional
214
212
size_t sample () const ;
215
213
216
214
/* *
217
- * @brief Return assignment that maximizes distribution.
218
- * @return Optimal assignment (1 frontal variable).
215
+ * @brief Return assignment for single frontal variable that maximizes value.
216
+ * @param parentsValues Known assignments for the parents.
217
+ * @return maximizing assignment for the frontal variable.
219
218
*/
220
- size_t argmax () const ;
219
+ size_t argmax (const DiscreteValues& parentsValues = DiscreteValues() ) const ;
221
220
222
221
// / @}
223
222
// / @name Advanced Interface
@@ -244,7 +243,6 @@ class GTSAM_EXPORT DiscreteConditional
244
243
std::string html (const KeyFormatter& keyFormatter = DefaultKeyFormatter,
245
244
const Names& names = {}) const override ;
246
245
247
-
248
246
// / @}
249
247
// / @name HybridValues methods.
250
248
// / @{
0 commit comments