pgRouting
pgRouting extends the PostGIS / PostgreSQL geospatial database to provide geospatial routing functionality.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Pgr_contract< G > Class Template Reference

#include "pgr_contract.hpp"

Public Member Functions

bool is_dead_end (G &graph, int64_t vertex_id) const
 Checks whether a vertex is a dead end vertex. More...
 
void getDeadEndSet (G &graph)
 Stores ids of dead end vertices of the graph in a set Stores them in the set dead_end_vertices More...
 
void print_dead_end_vertices (std::ostringstream &stream)
 Writes the string form of dead end vertices to the stream More...
 

Private Attributes

Identifiers< int64_t > all
 
Identifiers< int64_t > dead_end
 
Identifiers< int64_t > forbidden
 
int64_t last_edge_id
 
Identifiers< int64_t > non_contracted
 

Graph related types

typedef G::V V
 
typedef G::E E
 
typedef G::V_i V_i
 
typedef G::E_i E_i
 
typedef G::EO_i EO_i
 
typedef G::EI_i EI_i
 
void disconnectVertex (G &graph, int64_t vertex_id)
 Disconnects all incoming and outgoing edges from the vertex Calls the disconnect_vertex function of the graph with assertions. More...
 
void setForbiddenVertices (int64_t *forbidden_vertices, size_t size_forbidden_vertices)
 Stores the ids of those vertices forbidden from contraction in a set Stores them in the set forbidden_vertices More...
 
void getAllVertices (G &graph)
 Stores ids of all the vertices of the graph in a set Stores them in the set all_vertices More...
 
void getNonContractedVertices ()
 Stores the set of ids of those vertices which are not contracted Stores them in the set non_contracted More...
 
Identifiers< int64_t > getAdjacentVertices (G &graph, int64_t vertex_id)
 Returns a set of ids of all those vertices adjacent to vertex with id vertex_id Calls the disconnect_vertex function of the graph with assertions. More...
 
void print_identifiers (std::ostringstream &stream, Identifiers< int64_t > identifiers)
 Writes the string form of identifier class to the stream More...
 
void print_forbidden_vertices (std::ostringstream &stream)
 Writes the string form of forbidden vertices to the stream More...
 
void print_all_vertices (std::ostringstream &stream)
 Writes the string form of all vertices to the stream More...
 
void print_non_contracted_vertices (std::ostringstream &stream)
 Writes the string form of non contracted vertices to the stream More...
 

Detailed Description

template<class G>
class Pgr_contract< G >

Definition at line 48 of file pgr_contract.hpp.

Member Typedef Documentation

template<class G>
typedef G::E Pgr_contract< G >::E

Definition at line 183 of file pgr_contract.hpp.

template<class G>
typedef G::E_i Pgr_contract< G >::E_i

Definition at line 185 of file pgr_contract.hpp.

template<class G>
typedef G::EI_i Pgr_contract< G >::EI_i

Definition at line 190 of file pgr_contract.hpp.

template<class G>
typedef G::EO_i Pgr_contract< G >::EO_i

Definition at line 186 of file pgr_contract.hpp.

template<class G>
typedef G::V Pgr_contract< G >::V

Definition at line 182 of file pgr_contract.hpp.

template<class G>
typedef G::V_i Pgr_contract< G >::V_i

Definition at line 184 of file pgr_contract.hpp.

Member Function Documentation

template<class G >
void Pgr_contract< G >::disconnectVertex ( G &  graph,
int64_t  vertex_id 
)

Disconnects all incoming and outgoing edges from the vertex Calls the disconnect_vertex function of the graph with assertions.

Parameters
graph
vertex_id

Definition at line 327 of file pgr_contract.hpp.

References pgassert.

template<class G >
Identifiers< int64_t > Pgr_contract< G >::getAdjacentVertices ( G &  graph,
int64_t  vertex_id 
)

Returns a set of ids of all those vertices adjacent to vertex with id vertex_id Calls the disconnect_vertex function of the graph with assertions.

Parameters
graph
vertex_id

Definition at line 358 of file pgr_contract.hpp.

template<class G >
void Pgr_contract< G >::getAllVertices ( G &  graph)

Stores ids of all the vertices of the graph in a set Stores them in the set all_vertices

Parameters
graph

Definition at line 343 of file pgr_contract.hpp.

template<class G >
void Pgr_contract< G >::getDeadEndSet ( G &  graph)

Stores ids of dead end vertices of the graph in a set Stores them in the set dead_end_vertices

Parameters
graph

Definition at line 430 of file pgr_contract.hpp.

Referenced by do_pgr_test_c_edges().

template<class G >
void Pgr_contract< G >::getNonContractedVertices ( )

Stores the set of ids of those vertices which are not contracted Stores them in the set non_contracted

Definition at line 353 of file pgr_contract.hpp.

template<class G >
bool Pgr_contract< G >::is_dead_end ( G &  graph,
int64_t  vertex_id 
) const

Checks whether a vertex is a dead end vertex.

Parameters
graph
vertex_id

Definition at line 400 of file pgr_contract.hpp.

template<class G >
void Pgr_contract< G >::print_all_vertices ( std::ostringstream &  stream)

Writes the string form of all vertices to the stream

Parameters
stream

Definition at line 389 of file pgr_contract.hpp.

template<class G >
void Pgr_contract< G >::print_dead_end_vertices ( std::ostringstream &  stream)

Writes the string form of dead end vertices to the stream

Parameters
stream

Definition at line 442 of file pgr_contract.hpp.

Referenced by do_pgr_test_c_edges().

template<class G >
void Pgr_contract< G >::print_forbidden_vertices ( std::ostringstream &  stream)

Writes the string form of forbidden vertices to the stream

Parameters
stream

Definition at line 384 of file pgr_contract.hpp.

template<class G >
void Pgr_contract< G >::print_identifiers ( std::ostringstream &  stream,
Identifiers< int64_t >  identifiers 
)

Writes the string form of identifier class to the stream

Parameters
stream
identifiers

Definition at line 379 of file pgr_contract.hpp.

template<class G >
void Pgr_contract< G >::print_non_contracted_vertices ( std::ostringstream &  stream)

Writes the string form of non contracted vertices to the stream

Parameters
stream

Definition at line 395 of file pgr_contract.hpp.

template<class G >
void Pgr_contract< G >::setForbiddenVertices ( int64_t *  forbidden_vertices,
size_t  size_forbidden_vertices 
)

Stores the ids of those vertices forbidden from contraction in a set Stores them in the set forbidden_vertices

Parameters
forbidden_vertices
size_forbidden_vertices

Definition at line 335 of file pgr_contract.hpp.

Member Data Documentation

template<class G>
Identifiers<int64_t> Pgr_contract< G >::all
private

Definition at line 308 of file pgr_contract.hpp.

template<class G>
Identifiers<int64_t> Pgr_contract< G >::dead_end
private

Definition at line 310 of file pgr_contract.hpp.

template<class G>
Identifiers<int64_t> Pgr_contract< G >::forbidden
private

Definition at line 314 of file pgr_contract.hpp.

template<class G>
int64_t Pgr_contract< G >::last_edge_id
private

Definition at line 306 of file pgr_contract.hpp.

template<class G>
Identifiers<int64_t> Pgr_contract< G >::non_contracted
private

Definition at line 312 of file pgr_contract.hpp.


The documentation for this class was generated from the following file: