Skip to content

Commit

Permalink
fix(doc): #79 class comments in generated doc
Browse files Browse the repository at this point in the history
  • Loading branch information
monora committed Feb 16, 2023
1 parent 5fba98f commit b7f3758
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/rgl/adjacency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def basic_add_edge(u, v)

end # class AdjacencyGraph


module Graph

# Convert a general graph to an AdjacencyGraph. If the graph is directed,
Expand Down
2 changes: 2 additions & 0 deletions lib/rgl/bellman_ford.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def initialize(graph)

end

# This class implements {Graph#bellman_ford_shortest_paths}.
class BellmanFordAlgorithm

# Initializes Bellman-Ford algorithm for a _graph_ with provided edges weights map.
Expand Down Expand Up @@ -89,6 +90,7 @@ def relax_edge(u, v)

end # class BellmanFordAlgorithm


module Graph

# Finds the shortest paths from the _source_ to each vertex of the graph.
Expand Down
1 change: 1 addition & 0 deletions lib/rgl/bipartite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def bipartite?

end # module Graph


class BipartiteBFSIterator < BFSIterator

attr_reader :bipartite_sets_map, :found_odd_cycle
Expand Down
2 changes: 2 additions & 0 deletions lib/rgl/dijkstra.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

module RGL

# This class implements {Graph#dijkstra_shortest_path} and {Graph#dijkstra_shortest_paths}
class DijkstraAlgorithm

# Distance combinator is a lambda that accepts the distance (usually from the source) to vertex _u_ and the weight
Expand Down Expand Up @@ -103,6 +104,7 @@ def build_edge_weights_map(edge_weights_map)

end # class DijkstraAlgorithm


module Graph

# Finds the shortest path from the _source_ to the _target_ in the graph.
Expand Down
3 changes: 2 additions & 1 deletion lib/rgl/edge_properties_map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def report_missing_property(property, u, v)

end # EdgePropertiesMap


class NonNegativeEdgePropertiesMap < EdgePropertiesMap

private
Expand All @@ -52,4 +53,4 @@ def report_negative_property(property, u, v)

end

end
end
1 change: 1 addition & 0 deletions lib/rgl/edmonds_karp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def handle_tree_edge(u, v)

end # class EdmondsKarpAlgorithm


module Graph

# Finds the maximum flow from the _source_ to the _sink_ in the graph.
Expand Down
1 change: 1 addition & 0 deletions lib/rgl/implicit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def edge_iterator(&block)

end # class ImplicitGraph


module Graph

# Returns a new {ImplicitGraph} which has as vertices all vertices of the
Expand Down
1 change: 1 addition & 0 deletions lib/rgl/prim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def minimum_spanning_tree(start_vertex = nil)

end # class PrimAlgorithm


module Graph

# Finds the minimum spanning tree of the graph.
Expand Down
5 changes: 3 additions & 2 deletions lib/rgl/topsort.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ module RGL
#
# The topological sort algorithm creates a linear ordering of the vertices
# such that if edge (u,v) appears in the graph, then u comes before v in
# the ordering. The graph must be a directed acyclic graph (DAG).
# the ordering. The graph must be a directed acyclic graph.
#
# The iterator can also be applied to an undirected graph or to a directed graph
# which contains a cycle. In this case, the Iterator does not reach all
# which contains a cycle. In this case, the iterator does not reach all
# vertices. The implementation of {Graph#acyclic?} uses this fact.
#
# @see Graph#topsort_iterator
Expand Down Expand Up @@ -60,6 +60,7 @@ def at_end?

end # class TopsortIterator


module Graph

# @return [TopsortIterator] for the graph.
Expand Down
2 changes: 2 additions & 0 deletions lib/rgl/traversal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def next_vertex

end # class BFSIterator


module Graph

# @return [BFSIterator] starting at vertex _v_.
Expand Down Expand Up @@ -161,6 +162,7 @@ class DFSVisitor

end # class DFSVisitor


module Graph

# @return [DFSIterator] staring at vertex _v_.
Expand Down

0 comments on commit b7f3758

Please sign in to comment.