Go to the documentation of this file.
27 return index_.find(variable)->second;
31 KeyMap::const_iterator item = index_.find(variable);
32 if(item == index_.end())
33 throw std::invalid_argument(
"Requested non-existent variable '" +
35 "' from VariableIndex");
41 return (*
this)[variable].empty();
46 return this->nEntries_ ==
other.nEntries_ && this->nFactors_ ==
other.nFactors_
47 && this->index_ ==
other.index_;
53 cout <<
"nEntries = " << nEntries() <<
", nFactors = " << nFactors() <<
"\n";
54 for(KeyMap::value_type key_factors: index_) {
55 cout <<
"var " << keyFormatter(key_factors.first) <<
":";
56 for(
const auto index: key_factors.second)
65 os <<
size() <<
" " << nFactors() <<
"\n";
67 for(KeyMap::value_type key_factors: index_) {
69 for(
const auto index: key_factors.second)
70 os << (index+1) <<
" ";
79 gttic(VariableIndex_augmentExistingFactor);
81 for(
const Key key: newKeys) {
82 index_[
key].push_back(factorIndex);
86 gttoc(VariableIndex_augmentExistingFactor);
const FactorIndices & operator[](Key variable) const
Access a list of factors by variable without checking for existence.
ofstream os("timeSchurFactors.csv")
void outputMetisFormat(std::ostream &os) const
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
void augmentExistingFactor(const FactorIndex factorIndex, const KeySet &newKeys)
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.
const gtsam::Symbol key('X', 0)
const FactorIndices & at(Key variable) const
Access a list of factors by variable.
bool equals(const VariableIndex &other, double tol=0.0) const
Test for equality (for unit tests and debug assertions).
bool empty(Key variable) const
Return true if no factors associated with a variable.
void print(const std::string &str="VariableIndex: ", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
Print the variable index (for unit tests and debugging).
std::uint64_t Key
Integer nonlinear key type.
FastVector< FactorIndex > FactorIndices
Define collection types:
gtsam
Author(s):
autogenerated on Wed May 28 2025 03:08:41