Changeset 750519 for src/graph/centrality
- Timestamp:
- 05/23/09 11:22:24 (4 years ago)
- Branches:
- master, python3
- Children:
- a8f2c8
- Parents:
- b334e1
- git-author:
- Tiago de Paula Peixoto <tiago@…> (05/23/09 06:38:05)
- git-committer:
- Tiago de Paula Peixoto <tiago@…> (05/23/09 11:22:24)
- Location:
- src/graph/centrality
- Files:
-
- 2 edited
-
graph_absolute_trust.cc (modified) (1 diff)
-
graph_absolute_trust.hh (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/graph/centrality/graph_absolute_trust.cc
r9c825c r750519 23 23 #include "graph_selectors.hh" 24 24 25 #include < boost/random.hpp>26 typedef boost::mt19937 rng_t;25 #include <tr1/random> 26 typedef std::tr1::mt19937 rng_t; 27 27 28 28 #include "graph_absolute_trust.hh" -
src/graph/centrality/graph_absolute_trust.hh
rb334e1 r750519 24 24 25 25 #include <tr1/unordered_set> 26 #include < boost/random/uniform_int.hpp>26 #include <tr1/random> 27 27 #include <boost/functional/hash.hpp> 28 29 #include <iostream> 28 30 29 31 namespace graph_tool … … 52 54 // init inferred trust t 53 55 int i, N = num_vertices(g); 54 #pragma omp parallel for default(shared) private(i) \ 55 schedule(dynamic) 56 #pragma omp parallel for default(shared) private(i) schedule(dynamic) 56 57 for (i = (source == -1) ? 0 : source; 57 58 i < ((source == -1) ? N : source + 1); ++i) … … 72 73 // walk hash set 73 74 tr1::unordered_set<size_t> path_set; 74 uniform_int<size_t> random_salt(0, numeric_limits<size_t>::max()); 75 tr1::uniform_int<size_t> 76 random_salt(0, numeric_limits<size_t>::max()); 75 77 size_t salt = random_salt(rng); 76 78 … … 122 124 // select edge according to its probability 123 125 typename graph_traits<Graph>::edge_descriptor e; 124 uniform_real<t_type> random(0,out_prob.back()); 126 typedef tr1::uniform_real<t_type> dist_t; 127 tr1::variate_generator<rng_t, dist_t> 128 random(rng, dist_t(0, out_prob.back())); 125 129 126 130 t_type u; 127 131 { 128 132 #pragma omp critical 129 u = random( rng);133 u = random(); 130 134 } 131 135 e = out_es[lower_bound(out_prob.begin(),
Note: See TracChangeset
for help on using the changeset viewer.


