Changeset ba2aee
- Timestamp:
- 06/30/07 23:39:31 (6 years ago)
- Branches:
- master, python3
- Children:
- 0075ec
- Parents:
- d199d4
- git-author:
- Tiago de Paula Peixoto <tiago@…> (06/30/07 23:39:31)
- git-committer:
- Tiago de Paula Peixoto <tiago@…> (06/30/07 23:39:31)
- Location:
- src
- Files:
-
- 2 added
- 13 edited
-
boost-workaround/boost/graph/betweenness_centrality.hpp (added)
-
graph-tool (modified) (3 diffs)
-
graph/Makefile.am (modified) (1 diff)
-
graph/graph.hh (modified) (1 diff)
-
graph/graph_adaptor.hh (modified) (1 diff)
-
graph/graph_betweenness.cc (added)
-
graph/graph_bind.cc (modified) (1 diff)
-
graph/graph_clustering.cc (modified) (1 diff)
-
graph/graph_community.cc (modified) (1 diff)
-
graph/graph_extended_clustering.cc (modified) (1 diff)
-
graph/graph_filtering.hh (modified) (2 diffs)
-
graph/graph_io.cc (modified) (1 diff)
-
graph/graph_minimum_spanning_tree.cc (modified) (1 diff)
-
graph/graph_properties.cc (modified) (1 diff)
-
graph/graph_properties.hh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/graph-tool
rd199d4 rba2aee 1 1 #! /usr/bin/env python 2 # graph-tool -- a general graph modification and manipulation thingy 3 # 2 4 # Copyright (C) 2007 Tiago de Paula Peixoto <tiago@forked.de> 3 5 # … … 112 114 statistics.add_option("--minimum-spanning-tree", action="callback", callback=push_option, type="string", metavar="[WEIGHT|]PROPERTY", help="mark the minimum spanning tree edges in PROPERTY") 113 115 statistics.add_option("--line-graph", action="callback", callback=push_option, type="string", metavar="FILE[|FORMAT]", help="save the corresponding line graph to FILE") 116 statistics.add_option("--betweenness-centrality", action="callback", callback=push_option, type="string", metavar="VERTEX_BETWEENESS[EDGE_BETWEENESS]", help="calculate and store the vertex and/or edge betweenness centrality") 114 117 115 118 correlations = parser.add_option_group("Correlations") … … 504 507 format = "" 505 508 graph.GetLineGraph(values[0], format) 509 elif opt.name == "betweenness-centrality": 510 values = parse_values(opt.value) 511 if len(values) < 1 or len(values) > 3: 512 raise OptionError(opt.name, "invalid value '%s'" % opt.value) 513 if just_file: 514 return None 515 vertex_centrality = values[0] 516 if len(values) > 1: 517 edge_centrality = values[1] 518 else: 519 edge_centrality = "" 520 if len(values) > 2: 521 weight = values[2] 522 else: 523 weight = "" 524 graph.GetBetweenness(weight, vertex_centrality, edge_centrality) 506 525 elif opt.name == "vertex-correlation-histogram": 507 526 values = parse_values(opt.value) -
src/graph/Makefile.am
r0c9826 rba2aee 41 41 graph_community_network.cc\ 42 42 graph_line_graph.cc\ 43 graph_betweenness.cc\ 43 44 graph_io.cc\ 44 45 graph_bind.cc\ -
src/graph/graph.hh
rd199d4 rba2aee 98 98 void GetMinimumSpanningTree(std::string weight, std::string property); 99 99 void GetLineGraph(std::string out_file, std::string format); 100 void GetBetweenness(std::string weight, std::string edge_betweenness, std::string vertex_betweenness); 100 101 101 102 // community structure -
src/graph/graph_adaptor.hh
rd199d4 rba2aee 358 358 }; 359 359 360 template <class Graph> 361 struct graph_traits< const UndirectedAdaptor<Graph> >: public graph_traits< UndirectedAdaptor<Graph> > {}; 362 360 363 //============================================================================== 361 364 // Nonmember functions -
src/graph/graph_bind.cc
rd199d4 rba2aee 240 240 .def("GetMinimumSpanningTree", &GraphInterfaceWrap::GetMinimumSpanningTree) 241 241 .def("GetLineGraph", &GraphInterfaceWrap::GetLineGraph) 242 .def("GetBetweenness", &GraphInterfaceWrap::GetBetweenness) 242 243 .def("GetCommunityStructure", &GraphInterfaceWrap::GetCommunityStructure) 243 244 .def("GetCommunityNetwork", &GraphInterfaceWrap::GetCommunityNetwork) -
src/graph/graph_clustering.cc
rd199d4 rba2aee 198 198 void GraphInterface::SetLocalClusteringToProperty(string property) 199 199 { 200 typedef HashedDescriptorMap<vertex_index_map_t,double> clust_map_t;200 typedef vector_property_map<double,vertex_index_map_t> clust_map_t; 201 201 clust_map_t clust_map(_vertex_index); 202 202 -
src/graph/graph_community.cc
rd199d4 rba2aee 652 652 void GraphInterface::GetCommunityStructure(double gamma, comm_corr_t corr, size_t n_iter, double Tmin, double Tmax, size_t Nspins, size_t seed, bool verbose, string history_file, string weight, string property) 653 653 { 654 typedef HashedDescriptorMap<vertex_index_map_t,size_t> comm_map_t;654 typedef vector_property_map<size_t,vertex_index_map_t> comm_map_t; 655 655 comm_map_t comm_map(_vertex_index); 656 656 -
src/graph/graph_extended_clustering.cc
rd199d4 rba2aee 159 159 void GraphInterface::SetExtendedClusteringToProperty(string property_prefix, size_t max_depth) 160 160 { 161 typedef HashedDescriptorMap<vertex_index_map_t,double> cmap_t;161 typedef vector_property_map<double, vertex_index_map_t> cmap_t; 162 162 vector<cmap_t> cmaps(max_depth); 163 163 for (size_t i = 0; i < cmaps.size(); ++i) -
src/graph/graph_filtering.hh
rd199d4 rba2aee 41 41 #endif 42 42 43 // some additional functions... 44 namespace boost 45 { 46 //============================================================================== 47 // vertex(i, filtered_graph<G>) 48 //============================================================================== 49 template <class Graph, class EdgePredicate, class VertexPredicate> 50 typename graph_traits<filtered_graph<Graph,EdgePredicate,VertexPredicate> >::vertex_descriptor 51 vertex(size_t i, const filtered_graph<Graph,EdgePredicate,VertexPredicate>& g) 52 { 53 typename graph_traits<Graph>::vertex_descriptor v = vertex(i, g.m_g); 54 if (g.m_vertex_pred(v)) 55 return v; 56 else 57 return graph_traits<Graph>::null_vertex(); 58 } 59 60 //============================================================================== 61 // vertex(i, reverse_graph<G>) 62 //============================================================================== 63 template <class Graph> 64 typename graph_traits<reverse_graph<Graph> >::vertex_descriptor 65 vertex(size_t i, const reverse_graph<Graph>& g) 66 { 67 return vertex(i, g.m_g); 68 } 69 70 } // namespace boost 71 72 43 73 namespace graph_tool 44 74 { … … 97 127 }; 98 128 99 100 //==============================================================================101 // vertex(i, filtered_graph<G>)102 //==============================================================================103 template <class Graph, class EdgePredicate, class VertexPredicate>104 typename graph_traits<filtered_graph<Graph,EdgePredicate,VertexPredicate> >::vertex_descriptor105 vertex(size_t i, const filtered_graph<Graph,EdgePredicate,VertexPredicate>& g)106 {107 typename graph_traits<Graph>::vertex_descriptor v = vertex(i, g.m_g);108 if (g.m_vertex_pred(v))109 return v;110 else111 return graph_traits<Graph>::null_vertex();112 }113 114 //==============================================================================115 // vertex(i, reverse_graph<G>)116 //==============================================================================117 template <class Graph>118 typename graph_traits<reverse_graph<Graph> >::vertex_descriptor119 vertex(size_t i, const reverse_graph<Graph>& g)120 {121 return vertex(i, g.m_g);122 }123 124 125 129 //============================================================================== 126 130 // RangeFilter -
src/graph/graph_io.cc
rd199d4 rba2aee 67 67 //============================================================================== 68 68 69 typedef mpl::vector<bool, int, long, float, double, string> value_types;70 71 69 template <class VertexIndexMap, class EdgeIndexMap> 72 70 struct create_dynamic_map -
src/graph/graph_minimum_spanning_tree.cc
rd199d4 rba2aee 56 56 void GraphInterface::GetMinimumSpanningTree(string weight, string property) 57 57 { 58 typedef HashedDescriptorMap<edge_index_map_t,size_t> tree_map_t;58 typedef vector_property_map<size_t, edge_index_map_t> tree_map_t; 59 59 tree_map_t tree_map(_edge_index); 60 60 -
src/graph/graph_properties.cc
rd199d4 rba2aee 35 35 using namespace graph_tool; 36 36 37 typedef mpl::vector<bool, int, long, size_t, float, double, std::string> value_types; 37 namespace graph_tool 38 { 39 // global property types 38 40 const char* type_names[] = {"boolean", "int", "long", "long", "float", "double", "string"}; 39 41 42 // scalar types 43 const char* scalar_names[] = {"boolean", "int", "long", "long", "float", "double"}; 44 } 40 45 41 46 //============================================================================== -
src/graph/graph_properties.hh
rd199d4 rba2aee 32 32 { 33 33 34 // global property types 35 typedef boost::mpl::vector<bool, int, long, size_t, float, double, std::string> value_types; 36 extern const char* type_names[]; 37 38 // scalar types 39 typedef boost::mpl::vector<bool, int, long, size_t, float, double> scalar_types; 40 extern const char* scalar_names[]; 41 42 43 34 44 //============================================================================== 35 45 // Property Map Utility Functions
Note: See TracChangeset
for help on using the changeset viewer.


