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
relax.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\relax.hpp
Girar
Efecto
Propiedad
Historial
//======================================================================= // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. // 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_GRAPH_RELAX_HPP #define BOOST_GRAPH_RELAX_HPP #include
#include
// for numeric limits #include
#include
namespace boost { // The following version of the plus functor prevents // problems due to overflow at positive infinity. template
struct closed_plus { T operator()(const T& a, const T& b) const { using namespace std; T zero(0); T result = a + b; if (result < zero && a >= zero && b >= zero) return (numeric_limits
::max)(); return result; } }; template
bool relax(typename graph_traits
::edge_descriptor e, const Graph& g, const WeightMap& w, PredecessorMap& p, DistanceMap& d, const BinaryFunction& combine, const BinaryPredicate& compare) { typedef typename graph_traits
::directed_category DirCat; bool is_undirected = is_same
::value; typedef typename graph_traits
::vertex_descriptor Vertex; Vertex u = source(e, g), v = target(e, g); typedef typename property_traits
::value_type D; typedef typename property_traits
::value_type W; D d_u = get(d, u), d_v = get(d, v); W w_e = get(w, e); if ( compare(combine(d_u, w_e), d_v) ) { put(d, v, combine(d_u, w_e)); put(p, v, u); return true; } else if (is_undirected && compare(combine(d_v, w_e), d_u)) { put(d, u, combine(d_v, w_e)); put(p, u, v); return true; } else return false; } template
bool relax(typename graph_traits
::edge_descriptor e, const Graph& g, WeightMap w, PredecessorMap p, DistanceMap d) { typedef typename property_traits
::value_type D; typedef closed_plus
Combine; typedef std::less
Compare; return relax(e, g, w, p, d, Combine(), Compare()); } } // namespace boost #endif /* BOOST_GRAPH_RELAX_HPP */
relax.hpp
Dirección de la página
Dirección del archivo
Anterior
76/95
Siguiente
Descargar
( 2 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.