27#include <boost/tuple/tuple.hpp>
57 GTSAM_EXPORT
static const size_t Empty;
76 GTSAM_EXPORT
void print(
const std::string& str =
"VariableSlots: ")
const;
91 gttic(VariableSlots_constructor);
92 static const bool debug =
false;
100 size_t jointFactorPos = 0;
101 for(
const typename FG::sharedFactor& factor: factorGraph) {
105 size_t factorVarSlot = 0;
106 for(
const Key involvedVariable: *factor) {
113 iterator thisVarSlots;
bool inserted;
114 boost::tie(thisVarSlots, inserted) = this->insert(std::make_pair(involvedVariable,
FastVector<size_t>()));
116 thisVarSlots->second.resize(factorGraph.nrFactors(), Empty);
117 thisVarSlots->second[jointFactorPos] = factorVarSlot;
118 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.
A thin wrapper around std::map that uses boost's fast_pool_allocator.
A thin wrapper around std::vector that uses a custom allocator.
Included from all GTSAM files.
std::vector< T, typename internal::FastDefaultVectorAllocator< T >::type > FastVector
FastVector is a type alias to a std::vector with a custom memory allocator.
Definition FastVector.h:34
Global functions in a separate testing namespace.
Definition chartTesting.h:28
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:100
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition concepts.h:30
FastMap is a thin wrapper around std::map that uses the boost fast_pool_allocator instead of the defa...
Definition FastMap.h:38
Template to create a binary predicate.
Definition Testable.h:111
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:151
A combined factor is assembled as one block of rows for each component factor.
Definition VariableSlots.h:52
GTSAM_EXPORT void print(const std::string &str="VariableSlots: ") const
print
Definition VariableSlots.cpp:29
VariableSlots(const FG &factorGraph)
Constructor from a set of factors to be combined.
Definition VariableSlots.h:89