mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Convert factory functions to return std::unique_ptrs.
https://github.com/ceres-solver/ceres-solver/issues/755 Change-Id: I8ff028ca6082a5f448f3891214af03971d565937
This commit is contained in:
@@ -257,11 +257,11 @@ Vertex FindConnectedComponent(const Vertex& vertex,
|
||||
// spanning forest, or a collection of linear paths that span the
|
||||
// graph G.
|
||||
template <typename Vertex>
|
||||
WeightedGraph<Vertex>* Degree2MaximumSpanningForest(
|
||||
std::unique_ptr<WeightedGraph<Vertex>> Degree2MaximumSpanningForest(
|
||||
const WeightedGraph<Vertex>& graph) {
|
||||
// Array of edges sorted in decreasing order of their weights.
|
||||
std::vector<std::pair<double, std::pair<Vertex, Vertex>>> weighted_edges;
|
||||
WeightedGraph<Vertex>* forest = new WeightedGraph<Vertex>();
|
||||
auto forest = std::make_unique<WeightedGraph<Vertex>>();
|
||||
|
||||
// Disjoint-set to keep track of the connected components in the
|
||||
// maximum spanning tree.
|
||||
|
||||
Reference in New Issue
Block a user