From d7a51c896bcf407f7e53f6daf9a2d06ac8f8dcb3 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Wed, 3 Nov 2010 21:47:49 +0000 Subject: [PATCH] Moved template and inline functions to header file --- gtsam/inference/inference-inl.h | 26 -------------------------- gtsam/inference/inference.h | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/gtsam/inference/inference-inl.h b/gtsam/inference/inference-inl.h index 0f4bfb356..859fd9797 100644 --- a/gtsam/inference/inference-inl.h +++ b/gtsam/inference/inference-inl.h @@ -17,36 +17,10 @@ #pragma once -#include - #include using namespace std; namespace gtsam { -/* ************************************************************************* */ -template -Permutation::shared_ptr Inference::PermutationCOLAMD(const VariableIndex& variableIndex, const CONSTRAINED& constrainLast) { - - vector cmember(variableIndex.size(), 0); - - // If at least some variables are not constrained to be last, constrain the - // ones that should be constrained. - if(constrainLast.size() < variableIndex.size()) { - BOOST_FOREACH(Index var, constrainLast) { - assert(var < variableIndex.size()); - cmember[var] = 1; - } - } - - return PermutationCOLAMD_(variableIndex, cmember); -} - -/* ************************************************************************* */ -inline Permutation::shared_ptr Inference::PermutationCOLAMD(const VariableIndex& variableIndex) { - vector cmember(variableIndex.size(), 0); - return PermutationCOLAMD_(variableIndex, cmember); -} - } // namespace gtsam diff --git a/gtsam/inference/inference.h b/gtsam/inference/inference.h index 7c8d63936..1eab0c276 100644 --- a/gtsam/inference/inference.h +++ b/gtsam/inference/inference.h @@ -24,6 +24,8 @@ #include #include +#include + #include #include @@ -52,4 +54,28 @@ namespace gtsam { }; + /* ************************************************************************* */ + template + Permutation::shared_ptr Inference::PermutationCOLAMD(const VariableIndex& variableIndex, const CONSTRAINED& constrainLast) { + + std::vector cmember(variableIndex.size(), 0); + + // If at least some variables are not constrained to be last, constrain the + // ones that should be constrained. + if(constrainLast.size() < variableIndex.size()) { + BOOST_FOREACH(Index var, constrainLast) { + assert(var < variableIndex.size()); + cmember[var] = 1; + } + } + + return PermutationCOLAMD_(variableIndex, cmember); + } + + /* ************************************************************************* */ + inline Permutation::shared_ptr Inference::PermutationCOLAMD(const VariableIndex& variableIndex) { + std::vector cmember(variableIndex.size(), 0); + return PermutationCOLAMD_(variableIndex, cmember); + } + } /// namespace gtsam