本文整理汇总了C++中vertex_type::num_out_edges方法的典型用法代码示例。如果您正苦于以下问题:C++ vertex_type::num_out_edges方法的具体用法?C++ vertex_type::num_out_edges怎么用?C++ vertex_type::num_out_edges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vertex_type
的用法示例。
在下文中一共展示了vertex_type::num_out_edges方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scatter
void scatter(icontext_type& context, const vertex_type& vertex,
edge_type& edge) const {
const vertex_type other = edge.target();
pagerank_type value = vertex.data().pagerank / vertex.num_out_edges();
assert(other.id() != vertex.id());
const sum_pagerank_type msg(value);
context.signal(other, msg);
}
示例2: apply
void apply(icontext_type& context, vertex_type& vertex,
const factor_type& sum) {
const size_t num_neighbors = vertex.num_in_edges() + vertex.num_out_edges();
ASSERT_GT(num_neighbors, 0);
// There should be no new edge data since the vertex program has been cleared
vertex_data& vdata = vertex.data();
ASSERT_EQ(sum.size(), NTOPICS);
ASSERT_EQ(vdata.factor.size(), NTOPICS);
vdata.nupdates++; vdata.nchanges = 0;
vdata.factor = sum;
} // end of apply
示例3: apply
void apply(icontext_type& context, vertex_type& vertex,
const gather_type& total)
{
sort_pool.push_back(make_pair(vertex.parse<vertex_data>().id,vertex.num_in_edges()+vertex.num_out_edges()));
}
示例4: apply
void apply(icontext_type& context, vertex_type& vertex,
const gather_type& total) {
ASSERT_EQ( total, int(vertex.num_out_edges()) );
}
示例5: empty
/**
* \brief Signal all vertices on one side of the bipartite graph
*/
static graphlab::empty signal_left(icontext_type& context,
vertex_type& vertex) {
if(vertex.num_out_edges() > 0) context.signal(vertex);
return graphlab::empty();
} // end of signal_left