56 GTSAM_EXPORT
static const size_t Empty;
75 GTSAM_EXPORT
void print(
const std::string& str =
"VariableSlots: ")
const;
90 gttic(VariableSlots_constructor);
91 static const bool debug =
false;
99 size_t jointFactorPos = 0;
100 for(
const typename FG::sharedFactor& factor: factorGraph) {
104 size_t factorVarSlot = 0;
105 for(
const Key involvedVariable: *factor) {
112 auto [thisVarSlots, inserted] = this->insert({involvedVariable,
FastVector<size_t>()});
114 thisVarSlots->second.resize(factorGraph.nrFactors(), Empty);
115 thisVarSlots->second[jointFactorPos] = factorVarSlot;
116 if(debug) std::cout <<
" var " << involvedVariable <<
" rowblock " << jointFactorPos <<
" comes from factor's slot " << factorVarSlot << std::endl;
Concept check for values that can be used in unit tests.
Definition: Testable.h:152
GTSAM_EXPORT bool equals(const VariableSlots &rhs, double tol=0.0) const
std::vector< T, typename internal::FastDefaultVectorAllocator< T >::type > FastVector
Definition: FastVector.h:34
GTSAM_EXPORT void print(const std::string &str="VariableSlots: ") const
Included from all GTSAM files.
Definition: VariableSlots.h:51
VariableSlots(const FG &factorGraph)
Definition: VariableSlots.h:88
A thin wrapper around std::vector that uses a custom allocator.
Definition: chartTesting.h:28
A thin wrapper around std::map that uses boost's fast_pool_allocator.
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102