当前位置: 首页>>代码示例>>C++>>正文


C++ graph::get_num_edges方法代码示例

本文整理汇总了C++中graph::get_num_edges方法的典型用法代码示例。如果您正苦于以下问题:C++ graph::get_num_edges方法的具体用法?C++ graph::get_num_edges怎么用?C++ graph::get_num_edges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在graph的用法示例。


在下文中一共展示了graph::get_num_edges方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: draw_dashes_draft

    //------------------------------------------------------------------------
    void draw_dashes_draft()
    {
        pixfmt pixf(rbuf_window());
        base_renderer rb(pixf);
        primitives_renderer prim(rb);
        outline_rasterizer ras(prim);

        int i;
        for(i = 0; i < m_graph.get_num_edges(); i++)
        {
            graph::edge e  = m_graph.get_edge(i);
            graph::node n1 = m_graph.get_node(e.node1, width(), height());
            graph::node n2 = m_graph.get_node(e.node2, width(), height());
            curve c(n1.x, n1.y, n2.x, n2.y);
            dash_stroke_draft<curve> s(c, 6.0, 3.0, m_width.value());

            int r = rand() & 0x7F;
            int g = rand() & 0x7F;
            int b = rand() & 0x7F;
            int a = 255;
            if(m_translucent.status()) a = 80;
            prim.line_color(agg::srgba8(r, g, b, a));
            ras.add_path(s);
        }
    }
开发者ID:Bashakov,项目名称:agg,代码行数:26,代码来源:graph_test.cpp

示例2: get_graph_details

string CDLib::get_graph_details(const graph& g)
{
    ostringstream oss;
    oss << "Number of Nodes: " << g.get_num_nodes() << endl;
    oss << "Number of Edges: " << g.get_num_edges() << endl;
    oss << "Number of Self Edges: " << g.get_num_self_edges() << endl;
    oss << "Total Weight: " << g.get_total_weight() << endl;
    oss << "Weight of Self Edges: " << g.get_self_edges_weight() << endl;
    vector<id_type> in_degrees(g.get_num_nodes(),0),out_degrees(g.get_num_nodes(),0);
    vector<double> in_weights(g.get_num_nodes(),0.0),out_weights(g.get_num_nodes(),0.0);
    for(id_type i=0;i<g.get_num_nodes();i++)
    {
        in_degrees[i] = g.get_node_in_degree(i);
        out_degrees[i] = g.get_node_out_degree(i);
        in_weights[i] = g.get_node_in_weight(i);
        out_weights[i] = g.get_node_out_weight(i);
    }
    oss << "In Degrees" << endl;
    oss << "Min\tMedian\tMax\tMean\tVariance" << endl;
    oss << statistics_string(in_degrees,"\t") << endl;
    oss << "Out Degrees" << endl;
    oss << "Min\tMedian\tMax\tMean\tVariance" << endl;
    oss << statistics_string(out_degrees,"\t")  << endl;
    oss << "In Weights" << endl;
    oss << "Min\tMedian\tMax\tMean\tVariance" << endl;
    oss << statistics_string(in_weights,"\t") << endl;
    oss << "Out Weights" << endl;
    oss << "Min\tMedian\tMax\tMean\tVariance" << endl;
    oss << statistics_string(out_weights,"\t")  << endl;
    return oss.str();
}
开发者ID:BalkiLab,项目名称:graffy,代码行数:31,代码来源:graph_summary.cpp

示例3: draw_dashes_fine

 //------------------------------------------------------------------------
 void draw_dashes_fine(scanline_rasterizer& ras, 
                       solid_renderer& solid,
                       draft_renderer& draft)
 {
     int i;
     for(i = 0; i < m_graph.get_num_edges(); i++)
     {
         graph::edge b  = m_graph.get_edge(i);
         graph::node n1 = m_graph.get_node(b.node1, width(), height());
         graph::node n2 = m_graph.get_node(b.node2, width(), height());
         curve c(n1.x, n1.y, n2.x, n2.y);
         dash_stroke_fine<curve> s(c, 6.0, 3.0, m_width.value());
         render_edge_fine(ras, solid, draft, s);
     }
 }
开发者ID:Bashakov,项目名称:agg,代码行数:16,代码来源:graph_test.cpp

示例4: draw_polygons

 //------------------------------------------------------------------------
 void draw_polygons(scanline_rasterizer& ras, 
                    solid_renderer& solid,
                    draft_renderer& draft)
 {
     int i;
     if(m_type.cur_item() == 4)
     {
         ras.gamma(agg::gamma_threshold(0.5));
     }
     for(i = 0; i < m_graph.get_num_edges(); i++)
     {
         graph::edge b  = m_graph.get_edge(i);
         graph::node n1 = m_graph.get_node(b.node1, width(), height());
         graph::node n2 = m_graph.get_node(b.node2, width(), height());
         curve c(n1.x, n1.y, n2.x, n2.y);
         render_edge_fine(ras, solid, draft, c);
     }
     ras.gamma(agg::gamma_none());
 }
开发者ID:Bashakov,项目名称:agg,代码行数:20,代码来源:graph_test.cpp


注:本文中的graph::get_num_edges方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。