Fixed build issue, added more detailed explanation of the TableFactor.

release/4.3a0
Yoonwoo Kim 2023-05-28 13:08:15 +09:00
parent 95834fc73d
commit c55772801f
2 changed files with 4 additions and 15 deletions

View File

@ -20,7 +20,6 @@
#include <gtsam/base/FastSet.h>
#include <gtsam/hybrid/HybridValues.h>
#include <gtsam/discrete/TableFactor.h>
#include <gtsam/discrete/SparseDiscreteConditional.h>
#include <boost/format.hpp>
#include <utility>
@ -58,16 +57,6 @@ namespace gtsam {
sort(sorted_dkeys_.begin(), sorted_dkeys_.end());
}
/* ************************************************************************ */
TableFactor::TableFactor(const SparseDiscreteConditional& c)
: DiscreteFactor(c.keys()),
sparse_table_(c.sparse_table_),
denominators_(c.denominators_) {
cardinalities_ = c.cardinalities_;
sorted_dkeys_ = discreteKeys();
sort(sorted_dkeys_.begin(), sorted_dkeys_.end());
}
/* ************************************************************************ */
Eigen::SparseVector<double> TableFactor::Convert(
const std::vector<double>& table) {

View File

@ -32,12 +32,14 @@
namespace gtsam {
class SparseDiscreteConditional;
class HybridValues;
/**
* A discrete probabilistic factor optimized for sparsity.
*
* Uses sparse_table_ to store only the non-zero probabilities.
* Computes the assigned value for the key using the ordering which the
* non-zero probabilties are stored in.
*
* @ingroup discrete
*/
class GTSAM_EXPORT TableFactor : public DiscreteFactor {
@ -129,8 +131,6 @@ namespace gtsam {
TableFactor(const DiscreteKey& key, const std::vector<double>& row)
: TableFactor(DiscreteKeys{key}, row) {}
/** Construct from a DiscreteTableConditional type */
explicit TableFactor(const SparseDiscreteConditional& c);
/// @}
/// @name Testable