removes unused argument 'ordering' from 'kruskal'

release/4.3a0
Ankur Roy Chowdhury 2023-02-04 19:58:58 -08:00
parent e29a0d35ed
commit 3f65cfb218
5 changed files with 4 additions and 10 deletions

View File

@ -52,7 +52,6 @@ inline std::vector<size_t> sortedIndices(const std::vector<double> &src) {
/****************************************************************/
template <class Graph>
std::vector<size_t> kruskal(const Graph &fg,
const FastMap<Key, size_t> &ordering,
const std::vector<double> &weights) {
// Create an index from variables to factor indices.
const VariableIndex variableIndex(fg);
@ -66,7 +65,7 @@ std::vector<size_t> kruskal(const Graph &fg,
std::vector<size_t> treeIndices;
treeIndices.reserve(n - 1);
// Initialize disjoint-set forest to keep track of merged 'blah'.
// Initialize disjoint-set forest to keep track of merged Keys.
DSFMap<Key> dsf;
// Loop over all edges in order of increasing weight.

View File

@ -24,7 +24,6 @@
namespace gtsam::utils {
template <class FactorGraph>
std::vector<size_t> kruskal(const FactorGraph &fg,
const FastMap<Key, size_t> &ordering,
const std::vector<double> &weights);
}

View File

@ -230,7 +230,7 @@ vector<size_t> SubgraphBuilder::buildTree(const GaussianFactorGraph &gfg,
return bfs(gfg);
break;
case SubgraphBuilderParameters::KRUSKAL:
return kruskal(gfg, ordering, weights);
return kruskal(gfg, weights);
break;
default:
std::cerr << "SubgraphBuilder::buildTree undefined skeleton type" << endl;
@ -306,9 +306,8 @@ vector<size_t> SubgraphBuilder::bfs(const GaussianFactorGraph &gfg) const {
/****************************************************************/
vector<size_t> SubgraphBuilder::kruskal(const GaussianFactorGraph &gfg,
const FastMap<Key, size_t> &ordering,
const vector<double> &weights) const {
return utils::kruskal(gfg, ordering, weights);
return utils::kruskal(gfg, weights);
}
/****************************************************************/

View File

@ -171,7 +171,6 @@ class GTSAM_EXPORT SubgraphBuilder {
std::vector<size_t> sample(const std::vector<double> &weights,
const size_t t) const;
std::vector<size_t> kruskal(const GaussianFactorGraph &gfg,
const FastMap<Key, size_t> &ordering,
const std::vector<double> &weights) const;
Weights weights(const GaussianFactorGraph &gfg) const ;

View File

@ -230,11 +230,9 @@ static PredecessorMap findOdometricPath(
PredecessorMap findMinimumSpanningTree(
const NonlinearFactorGraph& pose2Graph) {
// Compute the minimum spanning tree
const FastMap<Key, size_t> forwardOrdering =
Ordering::Natural(pose2Graph).invert();
const auto edgeWeights = std::vector<double>(pose2Graph.size(), 1.0);
const auto mstEdgeIndices =
utils::kruskal(pose2Graph, forwardOrdering, edgeWeights);
utils::kruskal(pose2Graph, edgeWeights);
// Create a PredecessorMap 'predecessorMap' such that:
// predecessorMap[key2] = key1, where key1 is the 'parent' node for key2 in