From 6dd31fd8c3e6d7fc3506beeb07a36959fcc6456f Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Sun, 23 Aug 2009 06:56:54 +0000 Subject: [PATCH] getOrdering is const !!!! It matters ! --- cpp/LinearFactorGraph.cpp | 3 +++ cpp/NonlinearFactorGraph.cpp | 3 ++- cpp/NonlinearFactorGraph.h | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cpp/LinearFactorGraph.cpp b/cpp/LinearFactorGraph.cpp index cc8eb2b87..f7733e772 100644 --- a/cpp/LinearFactorGraph.cpp +++ b/cpp/LinearFactorGraph.cpp @@ -230,6 +230,9 @@ pair LinearFactorGraph::matrix(const Ordering& ordering) const { /* ************************************************************************* */ Ordering LinearFactorGraph::getOrdering() const { + + // FD: no comments whatsoever, must be totally obvious ! + int * _symbolicMatrix; int * _symbolicColumns; int _symbolicLength; diff --git a/cpp/NonlinearFactorGraph.cpp b/cpp/NonlinearFactorGraph.cpp index f7bb91e97..c0db8471c 100644 --- a/cpp/NonlinearFactorGraph.cpp +++ b/cpp/NonlinearFactorGraph.cpp @@ -88,8 +88,9 @@ double NonlinearFactorGraph::iterate } /* ************************************************************************* */ -Ordering NonlinearFactorGraph::getOrdering(FGConfig& config) +Ordering NonlinearFactorGraph::getOrdering(FGConfig& config) const { + // TODO: FD: Whoa! This is crazy !!!!! re-linearizing just to get ordering ? LinearFactorGraph lfg = linearize(config); return lfg.getOrdering(); } diff --git a/cpp/NonlinearFactorGraph.h b/cpp/NonlinearFactorGraph.h index af55339d1..996e698ce 100644 --- a/cpp/NonlinearFactorGraph.h +++ b/cpp/NonlinearFactorGraph.h @@ -35,7 +35,7 @@ public: // internal, exposed for testing only, doc in .cpp file double& lambda, double lambdaFactor, const Ordering& ordering, int verbosity) const; - Ordering getOrdering(FGConfig& config); + Ordering getOrdering(FGConfig& config) const; public: // these you will probably want to use /**