x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
create_condensation_graph.hpp - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\graph\create_condensation_graph.hpp
Girar
Efecto
Propiedad
Historial
//======================================================================= // Copyright 2002 Indiana University. // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) //======================================================================= #ifndef BOOST_CREATE_CONDENSATION_GRAPH_HPP #define BOOST_CREATE_CONDENSATION_GRAPH_HPP #include
#include
namespace boost { template
void create_condensation_graph(const Graph& g, const ComponentLists& components, ComponentNumberMap component_number, CondensationGraph& cg, EdgeMultiplicityMap edge_mult_map) { typedef typename graph_traits
::vertex_descriptor vertex; typedef typename graph_traits
::vertices_size_type size_type; typedef typename graph_traits
::vertex_descriptor cg_vertex; std::vector
to_cg_vertex(components.size()); for (size_type s = 0; s < components.size(); ++s) to_cg_vertex[s] = add_vertex(cg); for (size_type si = 0; si < components.size(); ++si) { cg_vertex s = to_cg_vertex[si]; std::vector
adj; for (size_type i = 0; i < components[si].size(); ++i) { vertex u = components[s][i]; typename graph_traits
::adjacency_iterator v, v_end; for (tie(v, v_end) = adjacent_vertices(u, g); v != v_end; ++v) { cg_vertex t = to_cg_vertex[component_number[*v]]; if (s != t) // Avoid loops in the condensation graph adj.push_back(t); } } std::sort(adj.begin(), adj.end()); if (! adj.empty()) { size_type i = 0; cg_vertex t = adj[i]; typename graph_traits
::edge_descriptor e; bool inserted; tie(e, inserted) = add_edge(s, t, cg); put(edge_mult_map, e, 1); ++i; while (i < adj.size()) { if (adj[i] == t) put(edge_mult_map, e, get(edge_mult_map, e) + 1); else { t = adj[i]; tie(e, inserted) = add_edge(s, t, cg); put(edge_mult_map, e, 1); } ++i; } } } } template
void create_condensation_graph(const Graph& g, const ComponentLists& components, ComponentNumberMap component_number, CondensationGraph& cg) { create_condensation_graph(g, components, component_number, cg, dummy_property_map()); } } // namespace boost #endif // BOOST_CREATE_CONDENSATION_GRAPH_HPP
create_condensation_graph.hpp
Dirección de la página
Dirección del archivo
Anterior
19/95
Siguiente
Descargar
( 3 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.