x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
graph_as_tree.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\graph\graph_as_tree.hpp
旋转
特效
属性
历史版本
// //======================================================================= // 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_GRAPH_AS_TREE_HPP #define BOOST_GRAPH_GRAPH_AS_TREE_HPP #include
#include
#include
#include
#include
#include
#include
namespace boost { template
class graph_as_tree_base { typedef Derived Tree; public: typedef Node node_descriptor; typedef ChIt children_iterator; graph_as_tree_base(Graph& g, Node root) : _g(g), _root(root) { } friend Node root(const Tree& t) { return t._root; } template
friend std::pair
children(N n, const Tree& t) { return adjacent_vertices(n, t._g); } template
friend Node parent(N n, const Tree& t) { return boost::get(t.parent_pa(), n); } Graph& _g; Node _root; }; struct graph_as_tree_tag { }; template
::vertex_descriptor #endif , class ChIt #if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION = typename graph_traits
::adjacency_iterator #endif > class graph_as_tree : public graph_as_tree_base
> { typedef graph_as_tree self; typedef graph_as_tree_base
super; public: graph_as_tree(Graph& g, Node root) : super(g, root) { } graph_as_tree(Graph& g, Node root, ParentMap p) : super(g, root), _p(p) { breadth_first_search(g, root, visitor(make_bfs_visitor (record_predecessors(p, boost::on_tree_edge())))); } ParentMap parent_pa() const { return _p; } typedef graph_as_tree_tag graph_tag; // for property_map protected: ParentMap _p; }; namespace detail { struct graph_as_tree_vertex_property_selector { template
struct bind_ { typedef typename GraphAsTree::base_type Graph; typedef property_map
PMap; typedef typename PMap::type type; typedef typename PMap::const_type const_type; }; }; struct graph_as_tree_edge_property_selector { template
struct bind_ { typedef typename GraphAsTree::base_type Graph; typedef property_map
PMap; typedef typename PMap::type type; typedef typename PMap::const_type const_type; }; }; } // namespace detail template <> struct vertex_property_selector
{ typedef detail::graph_as_tree_vertex_property_selector type; }; template <> struct edge_property_selector
{ typedef detail::graph_as_tree_edge_property_selector type; }; template
typename property_map
::type get(Property p, graph_as_tree
& g) { return get(p, g._g); } template
typename property_map
::const_type get(Property p, const graph_as_tree
& g) { const Graph& gref = g._g; // in case GRef is non-const return get(p, gref); } template
typename property_traits< typename property_map
::const_type >::value_type get(Property p, const graph_as_tree
& g, const Key& k) { return get(p, g._g, k); } template
void put(Property p, const graph_as_tree
& g, const Key& k, const Value& val) { put(p, g._g, k, val); } } // namespace boost #endif // BOOST_GRAPH_GRAPH_AS_TREE_HPP
graph_as_tree.hpp
网页地址
文件地址
上一页
34/95
下一页
下载
( 4 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.