Go to the documentation of this file.
24 #include <gtsam/dllexport.h>
78 size_t size()
const {
return index_.size(); }
102 void print(
const std::string&
str =
"VariableIndex: ",
109 void outputMetisFormat(std::ostream&
os)
const;
129 augment(
factor, &newFactorIndices);
137 void augmentExistingFactor(
const FactorIndex factorIndex,
const KeySet & newKeys);
149 template<
typename ITERATOR,
class FG>
150 void remove(ITERATOR firstFactor, ITERATOR lastFactor,
const FG&
factors);
153 template<
typename ITERATOR>
154 void removeUnusedVariables(ITERATOR firstKey, ITERATOR lastKey);
174 const KeyMap::const_iterator item = index_.find(variable);
175 assert(item != index_.end());
181 const KeyMap::iterator item = index_.find(variable);
182 assert(item != index_.end());
187 #if GTSAM_ENABLE_BOOST_SERIALIZATION
189 friend class boost::serialization::access;
190 template<
class ARCHIVE>
191 void serialize(ARCHIVE & ar,
const unsigned int ) {
192 ar & BOOST_SERIALIZATION_NVP(index_);
193 ar & BOOST_SERIALIZATION_NVP(nFactors_);
194 ar & BOOST_SERIALIZATION_NVP(nEntries_);
const_iterator find(Key key) const
Find the iterator for the requested variable entry.
KeyMap::const_iterator const_iterator
A thin wrapper around std::vector that uses a custom allocator.
const GaussianFactorGraph factors
Factor_iterator factorsBegin(Key variable)
Factor_const_iterator factorsBegin(Key variable) const
size_t nEntries() const
The number of nonzero blocks, i.e. the number of variable-factor entries.
KeyMap::const_iterator iterator
FactorIndices::const_iterator Factor_const_iterator
ofstream os("timeSchurFactors.csv")
The base class for all factors.
void augment(const FG &factor, const FactorIndices &newFactorIndices)
static const DiscreteFactorGraph factorGraph(bayesNet)
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
DecisionTreeFactor factor(D &C &B &A, "0.0 0.0 0.0 0.60658897 0.61241912 0.61241969 0.61247685 0.61247742 0.0 " "0.0 0.0 0.99995287 1.0 1.0 1.0 1.0")
const FactorIndices & internalAt(Key variable) const
Internal version of 'at' that asserts existence.
FactorIndices & internalAt(Key variable)
Internal version of 'at' that asserts existence.
void print(const Matrix &A, const string &s, ostream &stream)
KeyMap::value_type value_type
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
std::uint64_t FactorIndex
Integer nonlinear factor index type.
Factor_const_iterator factorsEnd(Key variable) const
const_iterator begin() const
Iterator to the first variable entry.
VariableIndex(const FG &factorGraph)
size_t nFactors() const
The number of factors in the original factor graph.
const gtsam::Symbol key('X', 0)
const_iterator end() const
Iterator to the first variable entry.
std::shared_ptr< VariableIndex > shared_ptr
size_t size() const
The number of variable entries. This is equal to the number of unique variable Keys.
VariableIndex()
Default constructor, creates an empty VariableIndex.
Factor_iterator factorsEnd(Key variable)
FastMap< Key, FactorIndices > KeyMap
FactorIndices::iterator Factor_iterator
std::uint64_t Key
Integer nonlinear key type.
A thin wrapper around std::map that uses boost's fast_pool_allocator.
FastVector< FactorIndex > FactorIndices
Define collection types:
gtsam
Author(s):
autogenerated on Wed May 28 2025 03:08:41