33 struct EliminationData {
36 EliminationData(EliminationData* _parentData,
size_t nChildren) :
37 parentData(_parentData) { childFactors.reserve(nChildren); }
42 EliminationData<TREE> eliminationPreOrderVisitor(
47 return EliminationData<TREE>(&
parentData, node->children.size());
51 template<
class TREE,
class RESULT>
52 struct EliminationPostOrderVisitor
56 EliminationPostOrderVisitor(RESULT& result,
const typename TREE::Eliminate& eliminationFunction) :
57 result(result), eliminationFunction(eliminationFunction) {}
61 typename TREE::sharedFactor childFactor = node->eliminate(result, eliminationFunction, myData.childFactors);
62 if(childFactor && !childFactor->empty())
63 myData.parentData->childFactors.push_back(childFactor);
72 template<
class TREE,
class RESULT>
73 FastVector<typename TREE::sharedFactor>
82 EliminationData<TREE> rootData(0, tree.roots().size());
83 EliminationPostOrderVisitor<TREE,RESULT> visitorPost(result,
function);
87 return rootData.childFactors;
SymbolicEliminationTree::sharedNode sharedNode
void DepthFirstForest(FOREST &forest, DATA &rootData, VISITOR_PRE &visitorPre, VISITOR_POST &visitorPost)
FastVector< typename TREE::sharedFactor > EliminateTree(RESULT &result, const TREE &tree, const typename TREE::Eliminate &function)
EliminationData *const parentData
A thin wrapper around std::vector that uses a custom allocator.
const TREE::Eliminate & eliminationFunction
FastVector< typename TREE::sharedFactor > childFactors
internal::enable_if< internal::valid_indexed_view_overload< RowIndices, ColIndices >::value &&internal::traits< typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::ReturnAsIndexedView, typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::type operator()(const RowIndices &rowIndices, const ColIndices &colIndices) EIGEN_INDEXED_VIEW_METHOD_CONST