From 0eec6fbeec7e1568b564dbfcd2cffa6c0a001a7d Mon Sep 17 00:00:00 2001 From: akrishnan86 Date: Mon, 20 Jul 2020 23:45:45 -0700 Subject: [PATCH] minor comments change --- gtsam/sfm/MFAS.cpp | 2 +- gtsam/sfm/MFAS.h | 17 +++++++++-------- gtsam/sfm/tests/testMFAS.cpp | 6 ++++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/gtsam/sfm/MFAS.cpp b/gtsam/sfm/MFAS.cpp index 76b7f532a..8c3e3596a 100644 --- a/gtsam/sfm/MFAS.cpp +++ b/gtsam/sfm/MFAS.cpp @@ -120,7 +120,7 @@ std::map MFAS::computeOutlierWeights() { for (auto it = start; it != end; it++) { // relativeTranslations may have negative weight edges, we make sure all edges - // are along the postive direction by flipping them if they are not. + // are along the positive direction by flipping them if they are not. KeyPair edge = it->first; if (positiveEdgeWeights_.find(edge) == positiveEdgeWeights_.end()) { std::swap(edge.first, edge.second); diff --git a/gtsam/sfm/MFAS.h b/gtsam/sfm/MFAS.h index 20213a168..10052548b 100644 --- a/gtsam/sfm/MFAS.h +++ b/gtsam/sfm/MFAS.h @@ -25,7 +25,7 @@ namespace gtsam { using KeyPair = std::pair; using TranslationEdges = std::map; -/* +/** The MFAS class to solve a Minimum feedback arc set (MFAS) problem. We implement the solution from: Kyle Wilson and Noah Snavely, "Robust Global Translations with 1DSfM", @@ -34,12 +34,13 @@ using TranslationEdges = std::map; Given a weighted directed graph, the objective in a Minimum feedback arc set problem is to obtain a graph that does not contain any cycles by removing edges such that the total weight of removed edges is minimum. + @addtogroup SFM */ class MFAS { public: - /* + /** * @brief Construct from the nodes in a graph (points in 3D), edges - * that are transation directions in 3D and the direction in + * that are translation directions in 3D and the direction in * which edges are to be projected. * @param nodes Nodes in the graph * @param relativeTranslations translation directions between nodes @@ -49,8 +50,8 @@ class MFAS { const std::shared_ptr &relativeTranslations, const Unit3 &projectionDirection); - /* - * Construct from the nodes in a graph and weighted directed edges + /** + * @brief Construct from the nodes in a graph and weighted directed edges * between the graph. Not recommended for any purpose other than unit testing. * The computeOutlierWeights method will return an empty output if this constructor * is used. @@ -62,7 +63,7 @@ class MFAS { MFAS(const std::shared_ptr> &nodes, const std::map &edgeWeights); - /* + /** * @brief Computes the "outlier weights" of the graph. We define the outlier weight * of a edge to be zero if the edge in an inlier and the magnitude of its edgeWeight * if it is an outlier. This function can only be used when constructing the @@ -70,8 +71,8 @@ class MFAS { */ std::map computeOutlierWeights(); - /* - * Computes the 1D MFAS ordering of nodes in the graph + /** + * @brief Computes the 1D MFAS ordering of nodes in the graph * @return orderedNodes: vector of nodes in the obtained order */ std::vector computeOrdering(); diff --git a/gtsam/sfm/tests/testMFAS.cpp b/gtsam/sfm/tests/testMFAS.cpp index 8b0192ade..345b3a5d4 100644 --- a/gtsam/sfm/tests/testMFAS.cpp +++ b/gtsam/sfm/tests/testMFAS.cpp @@ -5,12 +5,14 @@ using namespace std; using namespace gtsam; -/* We (partially) use the example from the paper on 1dsfm +/** + * We (partially) use the example from the paper on 1dsfm * (https://research.cs.cornell.edu/1dsfm/docs/1DSfM_ECCV14.pdf, Fig 1, Page 5) * for the unit tests here. The only change is that we leave out node 4 and use * only nodes 0-3. This makes the test easier to understand and also * avoids an ambiguity in the ground truth ordering that arises due to - * insufficient edges in the geaph when using the 4th node. */ + * insufficient edges in the geaph when using the 4th node. + */ // edges in the graph - last edge from node 3 to 0 is an outlier vector graph = {make_pair(3, 2), make_pair(0, 1), make_pair(3, 1),