boost graph之bgl_named_params

简介

bgl_named_params作为graph中的有名参数

定义

宏BOOST_BGL_ONE_PARAM_REF

有两个定义,一个定义在类bgl_named_params中用于定义成员方法,另外一个作为全局方法
bgl_named_params类中的成员方法

#define BOOST_BGL_ONE_PARAM_REF(name, key) \template <typename PType> \bgl_named_params<boost::reference_wrapper<PType>, BOOST_PP_CAT(key, _t), self> \name(PType& p) const { \typedef bgl_named_params<boost::reference_wrapper<PType>, BOOST_PP_CAT(key, _t), self> Params; \return Params(boost::ref(p), *this); \} \

全局方法

#define BOOST_BGL_ONE_PARAM_REF(name, key) \template <typename PType> \bgl_named_params<boost::reference_wrapper<PType>, BOOST_PP_CAT(key, _t)> \name(PType& p) { \typedef bgl_named_params<boost::reference_wrapper<PType>, BOOST_PP_CAT(key, _t)> Params; \return Params(boost::ref(p)); \} \

宏BOOST_BGL_ONE_PARAM_CREF

有两个定义,一个定义在类bgl_named_params中用于定义成员方法,另外一个作为全局方法
bgl_named_params类中的成员方法

#define BOOST_BGL_ONE_PARAM_CREF(name, key) \template <typename PType> \bgl_named_params<PType, BOOST_PP_CAT(key, _t), self> \name(const PType& p) const { \typedef bgl_named_params<PType, BOOST_PP_CAT(key, _t), self> Params; \return Params(p, *this); \} \

全局方法

#define BOOST_BGL_ONE_PARAM_CREF(name, key) \template <typename PType> \bgl_named_params<PType, BOOST_PP_CAT(key, _t)> \name(const PType& p) { \typedef bgl_named_params<PType, BOOST_PP_CAT(key, _t)> Params; \return Params(p); \} \

宏BOOST_BGL_DECLARE_NAMED_PARAMS

是一系列BOOST_BGL_ONE_PARAM_CREF集,定义的方法名包含

  • weight_map
    对应类型为edge_weight_t
  • weight_map2
    对应类型为edge_weight2_t
  • distance_map
    对应类型为vertex_distance_t
  • distance_map2
    对应类型为vertex_distance2_t
  • predecessor_map
    对应类型为vertex_predecessor_t
  • rank_map
    对应类型为vertex_rank_t
  • root_map
    对应类型为vertex_root_t
  • root_vertex
    对应类型为root_vertex_t
  • edge_centrality_map
    对应类型为edge_centrality_t
  • centrality_map
    对应类型为vertex_centrality_t
  • parity_map
    对应类型为parity_map_t
  • color_map
    对应类型为vertex_color_t
  • edge_color_map
    对应类型为edge_color_t
  • capacity_map
    对应类型为edge_capacity_t
  • residual_capacity_map
    对应类型为edge_residual_capacity_t
  • reverse_edge_map
    对应类型为edge_reverse_t
  • discover_time_map
    对应类型为vertex_discover_time_t
  • lowpoint_map
    对应类型为vertex_lowpoint_t
  • vertex_index_map
    对应类型为vertex_index_t
  • vertex_index1_map
    对应类型为vertex_index1_t
  • vertex_index2_map
    对应类型为vertex_index2_t
  • vertex_assignment_map
    对应类型为vertex_assignment_map_t
  • visitor
    对应类型为graph_visitor_t
  • distance_compare
    对应类型为distance_compare_t
  • distance_combine
    对应类型为distance_combine_t
  • distance_inf
    对应类型为distance_inf_t
  • distance_zero
    对应类型为distance_zero_t
  • edge_copy
    对应类型为edge_copy_t
  • vertex_copy
    对应类型为vertex_copy_t
  • buffer
    对应类型为buffer_param_t
  • orig_to_copy
    对应类型为orig_to_copy_t
  • isomorphism_map
    对应类型为vertex_isomorphism_t
  • vertex_invariant
    对应类型为vertex_invariant_t
  • vertex_invariant1
    对应类型为vertex_invariant1_t
  • vertex_invariant2
    对应类型为vertex_invariant2_t
  • vertex_max_invariant
    对应类型为vertex_max_invariant_t
  • polling
    对应类型为polling_t
  • lookahead
    对应类型为lookahead_t
  • in_parallel
    对应类型为in_parallel_t
  • displacement_map
    对应类型为vertex_displacement_t
  • attractive_force
    对应类型为attractive_force_t
  • repulsive_force
    对应类型为repulsive_force_t
  • force_pairs
    对应类型为force_pairs_t
  • cooling
    对应类型为cooling_t
  • iterations
    对应类型为iterations_t
  • diameter_range
    对应类型为diameter_range_t
  • learning_constant_range
    对应类型为learning_constant_range_t
  • vertices_equivalent
    对应类型为vertices_equivalent_t
  • edges_equivalent
    对应类型为edges_equivalent_t
  • index_in_heap_map
    对应类型为index_in_heap_map_t
  • max_priority_queue
    对应类型为max_priority_queue_t
#define BOOST_BGL_DECLARE_NAMED_PARAMS \BOOST_BGL_ONE_PARAM_CREF(weight_map, edge_weight) \BOOST_BGL_ONE_PARAM_CREF(weight_map2, edge_weight2) \BOOST_BGL_ONE_PARAM_CREF(distance_map, vertex_distance) \BOOST_BGL_ONE_PARAM_CREF(distance_map2, vertex_distance2) \BOOST_BGL_ONE_PARAM_CREF(predecessor_map, vertex_predecessor) \BOOST_BGL_ONE_PARAM_CREF(rank_map, vertex_rank) \BOOST_BGL_ONE_PARAM_CREF(root_map, vertex_root) \BOOST_BGL_ONE_PARAM_CREF(root_vertex, root_vertex) \BOOST_BGL_ONE_PARAM_CREF(edge_centrality_map, edge_centrality) \BOOST_BGL_ONE_PARAM_CREF(centrality_map, vertex_centrality) \BOOST_BGL_ONE_PARAM_CREF(parity_map, parity_map) \BOOST_BGL_ONE_PARAM_CREF(color_map, vertex_color) \BOOST_BGL_ONE_PARAM_CREF(edge_color_map, edge_color) \BOOST_BGL_ONE_PARAM_CREF(capacity_map, edge_capacity) \BOOST_BGL_ONE_PARAM_CREF(residual_capacity_map, edge_residual_capacity) \BOOST_BGL_ONE_PARAM_CREF(reverse_edge_map, edge_reverse) \BOOST_BGL_ONE_PARAM_CREF(discover_time_map, vertex_discover_time) \BOOST_BGL_ONE_PARAM_CREF(lowpoint_map, vertex_lowpoint) \BOOST_BGL_ONE_PARAM_CREF(vertex_index_map, vertex_index) \BOOST_BGL_ONE_PARAM_CREF(vertex_index1_map, vertex_index1) \BOOST_BGL_ONE_PARAM_CREF(vertex_index2_map, vertex_index2) \BOOST_BGL_ONE_PARAM_CREF(vertex_assignment_map, vertex_assignment_map) \BOOST_BGL_ONE_PARAM_CREF(visitor, graph_visitor) \BOOST_BGL_ONE_PARAM_CREF(distance_compare, distance_compare) \BOOST_BGL_ONE_PARAM_CREF(distance_combine, distance_combine) \BOOST_BGL_ONE_PARAM_CREF(distance_inf, distance_inf) \BOOST_BGL_ONE_PARAM_CREF(distance_zero, distance_zero) \BOOST_BGL_ONE_PARAM_CREF(edge_copy, edge_copy) \BOOST_BGL_ONE_PARAM_CREF(vertex_copy, vertex_copy) \BOOST_BGL_ONE_PARAM_REF(buffer, buffer_param) \BOOST_BGL_ONE_PARAM_CREF(orig_to_copy, orig_to_copy) \BOOST_BGL_ONE_PARAM_CREF(isomorphism_map, vertex_isomorphism) \BOOST_BGL_ONE_PARAM_CREF(vertex_invariant, vertex_invariant) \BOOST_BGL_ONE_PARAM_CREF(vertex_invariant1, vertex_invariant1) \BOOST_BGL_ONE_PARAM_CREF(vertex_invariant2, vertex_invariant2) \BOOST_BGL_ONE_PARAM_CREF(vertex_max_invariant, vertex_max_invariant) \BOOST_BGL_ONE_PARAM_CREF(polling, polling) \BOOST_BGL_ONE_PARAM_CREF(lookahead, lookahead) \BOOST_BGL_ONE_PARAM_CREF(in_parallel, in_parallel) \BOOST_BGL_ONE_PARAM_CREF(displacement_map, vertex_displacement) \BOOST_BGL_ONE_PARAM_CREF(attractive_force, attractive_force) \BOOST_BGL_ONE_PARAM_CREF(repulsive_force, repulsive_force) \BOOST_BGL_ONE_PARAM_CREF(force_pairs, force_pairs) \BOOST_BGL_ONE_PARAM_CREF(cooling, cooling) \BOOST_BGL_ONE_PARAM_CREF(iterations, iterations) \BOOST_BGL_ONE_PARAM_CREF(diameter_range, diameter_range) \BOOST_BGL_ONE_PARAM_CREF(learning_constant_range, learning_constant_range) \BOOST_BGL_ONE_PARAM_CREF(vertices_equivalent, vertices_equivalent) \BOOST_BGL_ONE_PARAM_CREF(edges_equivalent, edges_equivalent) \BOOST_BGL_ONE_PARAM_CREF(index_in_heap_map, index_in_heap_map) \BOOST_BGL_ONE_PARAM_REF(max_priority_queue, max_priority_queue)

bgl_named_params定义

template <typename T, typename Tag, typename Base = no_property>struct bgl_named_params{typedef bgl_named_params self;typedef Base next_type;typedef Tag tag_type;typedef T value_type;bgl_named_params(T v = T()) : m_value(v) { }bgl_named_params(T v, const Base& b) : m_value(v), m_base(b) { }T m_value;Base m_base;BOOST_BGL_DECLARE_NAMED_PARAMS// Duplicatetemplate <typename PType>bgl_named_params<PType, vertex_color_t, self>vertex_color_map(const PType& p) const {return this->color_map(p);}};

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/103988.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【奇葩问题】微信小程序 We分析 访问来源Top10的总比例为什么不止100%

今天有朋友在小程序后台开访问来源数据的时候发现三个渠道来源的比例超过了100% 搜了很多文章最终在官方社区找到了官方回复&#xff1a; 超过100%&#xff0c;是因为可能有用户&#xff0c;在当日通过多个场景&#xff0c;打开过你的小程序 比如用户A&#xff0c;上午通过【…

qt qtabwidget获取当前选项卡的所有按键

要获取当前选项卡中的所有按键&#xff0c;可以通过以下步骤进行&#xff1a; 通过currentIndex()函数获取当前选项卡的索引。 使用widget()函数获取当前选项卡的QWidget。 连接QWidget的keyPressEvent事件&#xff0c;并在事件处理函数中获取按下的按键信息。 下面是示例代…

Navicat For MySQL使用指南

勾选填充零后的效果&#xff0c;就是不够的位数用零来补齐&#xff01;

leetcode oj

150. 逆波兰表达式求值 - 力扣&#xff08;LeetCode&#xff09; 思路&#xff1a;定义一个名为 Solution 的类&#xff0c;并在其中定义了一个名为 evalRPN 的公共函数。这个函数接受一个由字符串组成的向量 tokens 作为输入&#xff0c;并返回一个整数。 在代码中&#xff0…

sentinel的启动与运行

首先我们github下载sentinel Releases alibaba/Sentinel (github.com) 下载好了后输入命令让它运行即可&#xff0c;使用cmd窗口输入一下命令即可 java -Dserver.port8089 -jar sentinel-dashboard-1.8.6.jar 账号密码默认都是sentinel 启动成功后登录进去效果如下

Nacos集群搭建

Nacos集群搭建 1.集群结构图 Nacos集群图&#xff1a; 其中包含3个nacos节点&#xff0c;然后一个负载均衡器代理3个Nacos。这里负载均衡器可以使用nginx。 三个nacos节点的地址&#xff1a; 节点ipportnacos1192.168.150.18845nacos2192.168.150.18846nacos3192.168.150…

vue-插件

插件 插件通常用来为 Vue 添加全局功能。插件的功能范围没有严格的限制。 通过全局方法 Vue.use() 使用插件。它需要在你调用 new Vue() 启动应用之前完成 // 调用 MyPlugin.install(Vue) Vue.use(MyPlugin)new Vue({// ...组件选项 })本质&#xff1a;包含install方法的一个…

PTE考试解析

Pte 考试题目 注入漏洞 空格被过滤 用/**/代替空格&#xff0c;发现#被过滤 对&#xff03;进行url编码为%23 输入构造好的payload http://172.16.12.100:81/vulnerabilities/fu1.php?id1%27)/**/and/**/11%23 http://172.16.12.100:81/vulnerabilities/fu1.php?id1%27)/*…

K8S云计算系列-(2)

1.Kubernetes平台配置实战 部署Kubernetes云计算平台&#xff0c;至少准备两台服务器&#xff0c;服务器CPU至少2C&#xff0c;内存4G&#xff0c;环境如下所示&#xff1a; Kubernetes Master节点&#xff1a;192.168.1.146 Kubernetes Minion节点&#xff1a;192.168.1.147…

415. 字符串相加

415. 字符串相加 class Solution { public:string addStrings(string num1, string num2){//i j分别指向当前字符串的最后一位int i num1.length() - 1;int j num2.length() - 1;int add 0;string s "";//不要忽略两个串都遍历完了 但是还有一个进位while (i …

Hadoop 安装教程 (Mac m1/m2版)

安装JDK1.8 这里最好是安装1.8版本的jdk 1. 进入官网Java Downloads | Oracle Hong Kong SAR, PRC,下滑到中间区域找到JDK8 2.选择mac os,下载ARM64 DMG Installer对应版本 注&#xff1a;这里下载需要注册oracle账号&#xff0c;不过很简单&#xff0c;只需要提供邮箱即可&…

【基础篇】三、Flink集群角色、系统架构以及作业提交流程

文章目录 1、集群角色2、部署模式3、Flink系统架构3.1 作业管理器&#xff08;JobManager&#xff09;3.2 任务管理器&#xff08;TaskManager&#xff09; 4、独立部署会话模式下的作业提交流程5、Yarn部署的应用模式下作业提交流程 1、集群角色 Flink提交作业和执行任务&…

ChatGPT或将引发现代知识体系转变

作为当下大语言模型的典型代表&#xff0c;ChatGPT对人类学习方式和教育发展所产生的变革效应已然引起了广泛关注。技术的快速发展在某种程度上正在“倒逼”教育领域开启更深层次的变革。在此背景下&#xff0c;教育从业者势必要学会准确识变、科学应变、主动求变、以变应变&am…

[Vue]之Jwt的入门和Jwt工具类的使用及Jwt集成spa项目

一&#xff0c;jwt入门 1.1 是什么&#xff1f; JWT&#xff0c;全称为 JSON Web Token&#xff0c;是一种用于在网络应用之间传递信息的标准方法。它是基于 JSON 格式定义的一种简洁且自包含的方式&#xff0c;可以安全地在用户和服务之间传输声明信息 1.2 为什么要使用 ①简…

计算机网络第四层 运输层

一&#xff0c;运输层引入的目的 1&#xff0c;网络通信主体标识 网络通信的本质是运行的主机上的进程之间的通信 同一个主机上有多个进程在工作&#xff0c;进程如何加以区分标识&#xff08;PID&#xff09;---本地主机 网络上的主机需要一个统一的进程标识分配机制 逻辑…

express-generator快速构建node后端项目

express-generator是express官方团队开发者准备的一个快速生成工具&#xff0c;可以非常快速的生成一个基于express开发的框架基础应用。 npm安装 npm install express-generator -g初始化应用 express my_node_test 创建了一个名为 my_node_test 的express骨架项目通过 Exp…

【数据结构】:队列的实现

队列 队列的概念及结构 队列&#xff1a;只允许在一端进行插入数据操作&#xff0c;在另一端进行删除数据操作的特殊线性表&#xff0c;队列具有先进先出 FIFO(First In First Out) 入队列&#xff1a;进行插入操作的一端称为队尾 出队列&#xff1a;进行删除操作的一端称为队…

EtherCAT 转 CClinkIE 协议网关与三菱CClinkIE通讯方法

远创智控YC-ECTM-CCLKIE网关产品是工业领域的一大神器&#xff0c;它可以通过各种数据接口与仪表、PLC、计量设备等产品进行连接&#xff0c;实时采集这些设备中的运行数据、状态数据等信息。然后&#xff0c;它将采集的数据进行整合、运算等操作后&#xff0c;传输到其他设备或…

Apache Shiro 漏洞复现

文章目录 Apache Shiro 漏洞复现1. Apache Shiro 1.2.4 反序列化漏洞1.1 漏洞描述1.2 漏洞原理1.3 漏洞复现1.3.1 环境启动 1.4 漏洞利用1.5 修复方案 Apache Shiro 漏洞复现 链接地址&#xff1a;Vulhub - Docker-Compose file for vulnerability environment 1. Apache Shi…

提升代码重用性:模板设计模式在实际项目中的应用

在软件开发中&#xff0c;我们经常面临着相似的问题&#xff0c;需要使用相同的解决方法。当我们希望将这种通用的解决方法抽象出来&#xff0c;并在不同的情境中重复使用时&#xff0c;就可以使用设计模式中的模板模式&#xff08;Template Pattern&#xff09;。模板模式是一…