32 namespace linearAlgorithms
49 template<
class CLIQUE>
55 const std::shared_ptr<CLIQUE>& clique,
61 for(
Key parent: clique->conditional_->parents())
73 parentPointers.reserve(clique->conditional()->nrParents());
74 for(
Key parent: clique->conditional()->parents()) {
76 dim += parentPointers.back()->second.size();
83 const Vector& parentVector = parentPointer->second;
84 xS.block(vectorPos,0,parentVector.size(),1) = parentVector.block(0,0,parentVector.size(),1);
85 vectorPos += parentVector.size();
104 auto result = collectedResult.
emplace(*frontal, solution.segment(vectorPosition, c.
getDim(frontal)));
106 throw std::runtime_error(
107 "Internal error while optimizing clique. Trying to insert key '" +
DefaultKeyFormatter(*frontal)
112 vectorPosition += c.
getDim(frontal);
142 template<
class BAYESTREE>
145 gttic(linear_optimizeBayesTree);
151 treeTraversal::no_op postVisitor;
FACTOR::const_iterator endFrontals() const
std::vector< T, typename internal::FastDefaultVectorAllocator< T >::type > FastVector
static const KeyFormatter DefaultKeyFormatter
ptrdiff_t DenseIndex
The index type for Eigen objects.
FACTOR::const_iterator beginFrontals() const
std::pair< VectorValues::iterator, bool > emplace(Key j, Args &&... args)
void DepthFirstForestParallel(FOREST &forest, DATA &rootData, VISITOR_PRE &visitorPre, VISITOR_POST &visitorPost, int problemSizeThreshold=10)
VectorValues collectedResult
const constBVector getb() const
DenseIndex getDim(const_iterator variable) const override
Conditional Gaussian Base class.
VectorValues optimizeBayesTree(const BAYESTREE &bayesTree)
OptimizeData operator()(const std::shared_ptr< CLIQUE > &clique, OptimizeData &parentData)
Values::const_iterator const_iterator
Const iterator over vector values.
FastMap< Key, VectorValues::const_iterator > cliqueResults
const KeyVector & keys() const
Access the factor's involved variable keys.
OptimizeData * parentData
KeyVector::const_iterator const_iterator
Const iterator over keys.
std::uint64_t Key
Integer nonlinear key type.