From 539ebb032a0888596d7a0048d817651e7ecd5570 Mon Sep 17 00:00:00 2001 From: akrishnan86 Date: Sat, 12 Sep 2020 14:28:47 -0700 Subject: [PATCH] fixes2 --- gtsam/sfm/MFAS.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtsam/sfm/MFAS.cpp b/gtsam/sfm/MFAS.cpp index a48482768..d4b7ad0a7 100644 --- a/gtsam/sfm/MFAS.cpp +++ b/gtsam/sfm/MFAS.cpp @@ -28,7 +28,7 @@ struct GraphNode { unordered_set outNeighbors; // Nodes to which there is an outgoing edge // Heuristic for the node that is to select nodes in MFAS. - double heuristic() { return (outWeightSum + 1) / (inWeightSum + 1); } + double heuristic() const { return (outWeightSum + 1) / (inWeightSum + 1); } }; // A graph is a map from key to GraphNode. This function returns the graph from @@ -42,8 +42,8 @@ unordered_map graphFromEdges( // is the direction of positive weight. This means that the edges is from // edge.first -> edge.second if weight is positive and edge.second -> // edge.first if weight is negative. - MFAS::KeyPair& edge = edgeWeight.first; - double& weight = edgeWeight.second; + const MFAS::KeyPair& edge = edgeWeight.first; + const double& weight = edgeWeight.second; Key edgeSource = weight >= 0 ? edge.first : edge.second; Key edgeDest = weight >= 0 ? edge.second : edge.first; @@ -140,7 +140,7 @@ vector MFAS::computeOrdering() const { return ordering; } -std::map MFAS::computeOutlierWeights() const { +map MFAS::computeOutlierWeights() const { // Find the ordering. vector ordering = computeOrdering();