initial stub for metis ordering

release/4.3a0
Andrew Melim 2014-10-03 12:18:42 -04:00
parent 9bb6beed92
commit f447481844
3 changed files with 20 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#include <gtsam/inference/Ordering.h>
#include <gtsam/3rdparty/CCOLAMD/Include/ccolamd.h>
#include <gtsam/3rdparty/metis-5.1.0/include/metis.h>
using namespace std;
@ -196,6 +197,12 @@ namespace gtsam {
return Ordering::COLAMDConstrained(variableIndex, cmember);
}
/* ************************************************************************* */
Ordering Ordering::METIS(const VariableIndex& variableIndex)
{
gttic(Ordering_METIS);
}
/* ************************************************************************* */
void Ordering::print(const std::string& str, const KeyFormatter& keyFormatter) const
{

View File

@ -146,6 +146,14 @@ namespace gtsam {
return Ordering(keys);
}
/// Compute an ordering determined by METIS from a VariableIndex
static GTSAM_EXPORT Ordering METIS(const VariableIndex& variableIndex);
template<class FACTOR>
static Ordering METIS(const FactorGraph<FACTOR>& graph){
return METIS(VariableIndex(graph)); }
/// @}
/// @name Testable @{

View File

@ -77,6 +77,11 @@ TEST(Ordering, grouped_constrained_ordering) {
EXPECT(assert_equal(expConstrained, actConstrained));
}
/* ************************************************************************* */
TEST(Ordering, metis_ordering) {
}
/* ************************************************************************* */
int main() { TestResult tr; return TestRegistry::runAllTests(tr); }
/* ************************************************************************* */