Skip to content

Commit 22bf8f9

Browse files
committed
graph_base: add final keyword
1 parent 83d80a6 commit 22bf8f9

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

ortools/graph_base/flow_graph.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ namespace util {
5050
// TODO(user): Currently only max-flow handles this graph, but not
5151
// min-cost-flow.
5252
template <typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
53-
class FlowGraph : public BaseGraph<FlowGraph<NodeIndexType, ArcIndexType>,
54-
NodeIndexType, ArcIndexType, false> {
53+
class FlowGraph final : public BaseGraph<FlowGraph<NodeIndexType, ArcIndexType>,
54+
NodeIndexType, ArcIndexType, false> {
5555
// Note that we do NOT use negated indices for reverse arc. So we use false
5656
// for the last template argument here HasNegativeReverseArcs.
5757
typedef BaseGraph<FlowGraph<NodeIndexType, ArcIndexType>, NodeIndexType,

ortools/graph_base/graph.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
// store them.
3737
//
3838
// Provided implementations:
39-
// - ListGraph<> for the simplest api. Also aliased to util::Graph.
39+
// - ListGraph<> for the simplest api.
4040
// - StaticGraph<> for performance, but requires building before usage, see
4141
// below
4242
// - CompleteGraph<> if you need a fully connected graph
@@ -945,7 +945,7 @@ class ListGraph : public MutableGraph<ListGraph<NodeIndexType, ArcIndexType>,
945945
// StaticGraphWithoutTail<>. This almost corresponds to a past implementation
946946
// of StaticGraph<> @CL 116144340.
947947
template <typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
948-
class StaticGraph
948+
class StaticGraph final
949949
: public MutableGraph<StaticGraph<NodeIndexType, ArcIndexType>,
950950
NodeIndexType, ArcIndexType, false> {
951951
typedef MutableGraph<StaticGraph<NodeIndexType, ArcIndexType>, NodeIndexType,
@@ -1172,7 +1172,7 @@ class ReverseArcListGraph
11721172
// - The reverse arcs from a node are sorted by head (so we could add a log()
11731173
// time lookup function).
11741174
template <typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
1175-
class ReverseArcStaticGraph
1175+
class ReverseArcStaticGraph final
11761176
: public MutableGraph<ReverseArcStaticGraph<NodeIndexType, ArcIndexType>,
11771177
NodeIndexType, ArcIndexType, true> {
11781178
static_assert(internal::IsSigned<ArcIndexType>(),

ortools/graph_base/topologicalsorter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ namespace graph {
5656

5757
// This is the recommended API when performance matters. It's also very simple.
5858
// AdjacencyList is any type that lets you iterate over the neighbors of
59-
// node with the [] operator, for example vector<vector<int>> or util::Graph.
59+
// node with the [] operator, for example vector<vector<int>> or
60+
// util::ListGraph.
6061
//
6162
// If you don't already have an adjacency list representation, build one using
6263
// StaticGraph<> in ./graph.h: FastTopologicalSort() can take any such graph as

0 commit comments

Comments
 (0)