Class: RGL::ImplicitGraph

### Home Classes Methods

### In Files

- lib/rgl/implicit.rb

### Parent

Object

### Methods

- ::new
- #adjacent_iterator
- #directed?
- #edge_iterator
- #vertex_iterator

### Included Modules

- RGL::Graph

### Class/Module Index

Quicksearch

- RGL
- RGL::AdjacencyGraph
- RGL::BFSIterator
- RGL::BellmanFordAlgorithm
- RGL::BellmanFordVisitor
- RGL::BidirectionalGraph
- RGL::BipartiteBFSIterator
- RGL::DFSIterator
- RGL::DFSVisitor
- RGL::DOT
- RGL::DOT::Digraph
- RGL::DOT::DirectedEdge
- RGL::DOT::Edge
- RGL::DOT::Element
- RGL::DOT::Graph
- RGL::DOT::Node
- RGL::DOT::Port
- RGL::DOT::Subgraph
- RGL::DijkstraAlgorithm
- RGL::DijkstraVisitor
- RGL::DirectedAdjacencyGraph
- RGL::Edge
- RGL::Edge::DirectedEdge
- RGL::Edge::UnDirectedEdge
- RGL::EdgePropertiesMap
- RGL::EdmondsKarpAlgorithm
- RGL::EdmondsKarpAlgorithm::EdmondsKarpBFSIterator
- RGL::Graph
- RGL::Graph::TarjanSccVisitor
- RGL::GraphIterator
- RGL::GraphVisitor
- RGL::GraphVisitor::ClassMethods
- RGL::GraphVisitor::DistanceMapSupport
- RGL::ImplicitGraph
- RGL::MutableGraph
- RGL::MutableGraph::MutableGraphParser
- RGL::NoEdgeError
- RGL::NoVertexError
- RGL::NonNegativeEdgePropertiesMap
- RGL::NotDirectedError
- RGL::NotUndirectedError
- RGL::PrimAlgorithm
- RGL::TopsortIterator
- Enumerable
- Object

No matching classes.

# RGL::ImplicitGraph

### Constants

EMPTY_NEIGHBOR_ITERATOR
EMPTY_VERTEX_ITERATOR

### Attributes

directed[W]

### Public Class Methods

new() click to toggle source

Create a new ImplicitGraph, which is empty by default. The caller should configure the graph using vertex and neighbor iterators. If the graph is directed, the client should set directed to true. The default value for directed is false.

    # File lib/rgl/implicit.rb, line 39
    def initialize
      @directed          = false
      @vertex_iterator   = EMPTY_VERTEX_ITERATOR
      @adjacent_iterator = EMPTY_NEIGHBOR_ITERATOR
      yield self if block_given? # Let client overwrite defaults.
    end

### Public Instance Methods

adjacent_iterator(&block) click to toggle source

Sets the adjacent_iterator to block, which must be a block of two parameters:

    The first parameter is the vertex the neighbors of which are to be
    traversed.

    The second is the block which will be called for each neighbor
    of this vertex.

    # File lib/rgl/implicit.rb, line 85
    def adjacent_iterator(&block)
      @adjacent_iterator = block
    end

directed?() click to toggle source

Returns the value of @directed.

    # File lib/rgl/implicit.rb, line 48
    def directed?
      @directed
    end

edge_iterator(&block) click to toggle source

Sets the edge_iterator to block, which must be a block of two parameters: The first parameter is the source of the edges; the second is the target of the edge.

    # File lib/rgl/implicit.rb, line 93
    def edge_iterator(&block)
      @edge_iterator = block
    end

vertex_iterator(&block) click to toggle source

Sets the vertex_iterator to block, which must be a block of one parameter which again is the block called by each_vertex.

    # File lib/rgl/implicit.rb, line 72
    def vertex_iterator(&block)
      @vertex_iterator = block
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.