Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tiago Peixoto
graph-tool
Commits
2d5dca6c
Commit
2d5dca6c
authored
Sep 06, 2009
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trivial fix for several compilation warnings
parent
c1c2aa9c
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
26 additions
and
26 deletions
+26
-26
src/graph/centrality/graph_absolute_trust.hh
src/graph/centrality/graph_absolute_trust.hh
+1
-1
src/graph/clustering/graph_motifs.cc
src/graph/clustering/graph_motifs.cc
+3
-3
src/graph/flow/graph_kolmogorov.cc
src/graph/flow/graph_kolmogorov.cc
+1
-1
src/graph/flow/graph_push_relabel.cc
src/graph/flow/graph_push_relabel.cc
+1
-1
src/graph/generation/graph_generation.hh
src/graph/generation/graph_generation.hh
+2
-3
src/graph/generation/graph_rewiring.hh
src/graph/generation/graph_rewiring.hh
+2
-2
src/graph/graph_copy.cc
src/graph/graph_copy.cc
+2
-2
src/graph/graph_filtering.hh
src/graph/graph_filtering.hh
+3
-2
src/graph/histogram.hh
src/graph/histogram.hh
+1
-1
src/graph/stats/graph_distance.hh
src/graph/stats/graph_distance.hh
+1
-1
src/graph/stats/graph_distance_sampled.hh
src/graph/stats/graph_distance_sampled.hh
+1
-1
src/graph/topology/graph_denominator_tree.cc
src/graph/topology/graph_denominator_tree.cc
+1
-1
src/graph/topology/graph_minimum_spanning_tree.cc
src/graph/topology/graph_minimum_spanning_tree.cc
+2
-2
src/graph/topology/graph_topology.cc
src/graph/topology/graph_topology.cc
+3
-3
src/graph/util/graph_search.hh
src/graph/util/graph_search.hh
+2
-2
No files found.
src/graph/centrality/graph_absolute_trust.hh
View file @
2d5dca6c
...
...
@@ -206,7 +206,7 @@ struct get_absolute_trust
typename
graph_traits
<
Graph
>::
vertex_descriptor
v
=
vertex
(
i
,
g
);
if
(
v
==
graph_traits
<
Graph
>::
null_vertex
())
continue
;
for
(
size_t
j
=
0
;
j
<
N
;
++
j
)
for
(
size_t
j
=
0
;
j
<
size_t
(
N
)
;
++
j
)
if
(
t_count
[
v
][
j
]
>
0
)
t
[
v
][
j
]
/=
t_count
[
v
][
j
];
}
...
...
src/graph/clustering/graph_motifs.cc
View file @
2d5dca6c
...
...
@@ -84,7 +84,7 @@ void get_motifs(GraphInterface& g, size_t k, python::list subgraph_list,
list
=
vector
<
u_graph_t
>
();
try
{
for
(
size_
t
i
=
0
;
i
<
python
::
len
(
subgraph_list
);
++
i
)
for
(
in
t
i
=
0
;
i
<
python
::
len
(
subgraph_list
);
++
i
)
{
GraphInterface
&
sub
=
python
::
extract
<
GraphInterface
&>
(
subgraph_list
[
i
]);
...
...
@@ -101,7 +101,7 @@ void get_motifs(GraphInterface& g, size_t k, python::list subgraph_list,
vector
<
size_t
>
phist
;
vector
<
double
>
plist
;
double
total
=
1
;
for
(
size_
t
i
=
0
;
i
<
python
::
len
(
p
);
++
i
)
for
(
in
t
i
=
0
;
i
<
python
::
len
(
p
);
++
i
)
{
plist
.
push_back
(
python
::
extract
<
double
>
(
p
[
i
]));
total
*=
plist
[
i
];
...
...
@@ -123,7 +123,7 @@ void get_motifs(GraphInterface& g, size_t k, python::list subgraph_list,
if
(
fill_list
)
{
for
(
size_
t
i
=
0
;
i
<
python
::
len
(
subgraph_list
);
++
i
)
for
(
in
t
i
=
0
;
i
<
python
::
len
(
subgraph_list
);
++
i
)
subgraph_list
.
pop
();
bool
done
=
false
;
...
...
src/graph/flow/graph_kolmogorov.cc
View file @
2d5dca6c
...
...
@@ -37,7 +37,7 @@ typename mpl::if_<
double
,
int
>::
type
min
(
const
T1
&
v1
,
const
T2
&
v2
)
{
if
(
v1
<=
v2
)
if
(
v1
<=
T1
(
v2
)
)
return
v1
;
else
return
v2
;
...
...
src/graph/flow/graph_push_relabel.cc
View file @
2d5dca6c
...
...
@@ -37,7 +37,7 @@ typename mpl::if_<
double
,
int
>::
type
min
(
const
T1
&
v1
,
const
T2
&
v2
)
{
if
(
v1
<=
v2
)
if
(
v1
<=
T1
(
v2
)
)
return
v1
;
else
return
v2
;
...
...
src/graph/generation/graph_generation.hh
View file @
2d5dca6c
...
...
@@ -218,10 +218,10 @@ public:
if
(
_biased
&&
!
_candidates_set
.
empty
()
&&
_erased_prob
>=
_probs
.
back
()
/
3
)
{
for
(
int
i
=
_probs
.
size
()
-
1
;
i
>
0
;
--
i
)
for
(
int
i
=
int
(
_probs
.
size
()
)
-
1
;
i
>
0
;
--
i
)
_probs
[
i
]
-=
_probs
[
i
-
1
];
for
(
in
t
i
=
0
;
i
<
_candidates
.
size
();
++
i
)
for
(
size_
t
i
=
0
;
i
<
_candidates
.
size
();
++
i
)
{
while
(
i
<
_erased
.
size
()
&&
_erased
[
i
])
{
...
...
@@ -699,7 +699,6 @@ struct gen_random_graph
for
(
int
i
=
0
;
i
<
int
(
sources
.
size
());
++
i
)
{
dvertex_t
source
=
sources
[
i
],
target
;
deg_t
source_deg
=
gen_strat
.
GetDegree
(
source
);
// in undirected graphs, there's no difference between source and
// target
...
...
src/graph/generation/graph_rewiring.hh
View file @
2d5dca6c
...
...
@@ -243,7 +243,7 @@ struct graph_rewire
}
// for each edge simultaneously rewire its source and target
for
(
size_t
i
=
0
;
i
<
int
(
edges
.
size
()
)
;
++
i
)
for
(
size_t
i
=
0
;
i
<
edges
.
size
();
++
i
)
{
if
(
!
is_edge
[
i
])
continue
;
...
...
@@ -336,7 +336,7 @@ public:
//try randomly drawn pairs of edges until one satisfies all the
//consistency checks
bool
found
=
false
;
edge_t
es
,
et
;
edge_t
es
=
e
,
et
=
e
;
typedef
random_permutation_iterator
<
typename
vector
<
index_t
>::
iterator
,
rng_t
>
random_edge_iter
;
...
...
src/graph/graph_copy.cc
View file @
2d5dca6c
...
...
@@ -63,13 +63,13 @@ struct graph_copy
// copy constructor
GraphInterface
::
GraphInterface
(
const
GraphInterface
&
gi
)
:
_mg
(),
_nedges
(
gi
.
_nedges
),
_reversed
(
gi
.
_reversed
),
_directed
(
gi
.
_directed
),
_vertex_index
(
get
(
vertex_index
,
_mg
)),
_edge_index
(
get
(
edge_index_t
(),
_mg
)),
_max_edge_index
(
gi
.
_max_edge_index
),
_nedges
(
gi
.
_nedges
),
_free_indexes
(
gi
.
_free_indexes
),
_max_edge_index
(
gi
.
_max_edge_index
),
_vertex_filter_map
(
_vertex_index
),
_vertex_filter_invert
(
false
),
_vertex_filter_active
(
false
),
...
...
src/graph/graph_filtering.hh
View file @
2d5dca6c
...
...
@@ -91,7 +91,7 @@ using namespace boost;
// struct my_algorithm
// {
// template <class Graph, class ValueType>
// void operator()(Graph
*
g, ValueType val) const
// void operator()(Graph
&
g, ValueType val) const
// {
// ... do something ...
// }
...
...
@@ -99,9 +99,10 @@ using namespace boost;
//
// ...
//
// GraphInterface g;
// typedef mpl::vector<int, double, string> value_types;
// double foo = 42.0;
// run_action(
*this
, my_algorithm(), value_types)(boost::any(foo));
// run_action(
g
, my_algorithm(), value_types)(boost::any(foo));
//
// The above line will run my_algorithm::operator() with Graph being the
// appropriate graph view type and ValueType being 'double' and val = 42.0.
...
...
src/graph/histogram.hh
View file @
2d5dca6c
...
...
@@ -163,7 +163,7 @@ public:
_sum
->
GetArray
().
resize
(
shape
);
for
(
size_t
i
=
0
;
i
<
this
->
_counts
.
num_elements
();
++
i
)
_sum
->
GetArray
().
data
()[
i
]
+=
this
->
_counts
.
data
()[
i
];
for
(
size_t
i
=
0
;
i
<
Histogram
::
dim
::
value
;
++
i
)
for
(
size_t
i
=
0
;
i
<
size_t
(
Histogram
::
dim
::
value
)
;
++
i
)
{
_sum
->
GetDataRange
()[
i
].
first
=
min
(
this
->
_data_range
[
i
].
first
,
...
...
src/graph/stats/graph_distance.hh
View file @
2d5dca6c
...
...
@@ -93,7 +93,7 @@ struct get_distance_histogram
unchecked_vector_property_map
<
val_type
,
VertexIndex
>
dist_map
(
vertex_index
,
num_vertices
(
g
));
for
(
size_t
j
=
0
;
j
<
N
;
++
j
)
for
(
size_t
j
=
0
;
j
<
size_t
(
N
)
;
++
j
)
{
if
(
vertex
(
i
,
g
)
!=
graph_traits
<
Graph
>::
null_vertex
())
dist_map
[
vertex
(
j
,
g
)]
=
numeric_limits
<
val_type
>::
max
();
...
...
src/graph/stats/graph_distance_sampled.hh
View file @
2d5dca6c
...
...
@@ -86,7 +86,7 @@ struct get_sampled_distance_histogram
vector
<
vertex_t
>
sources
;
sources
.
reserve
(
num_vertices
(
g
));
int
i
;
for
(
i
=
0
;
i
<
num_vertices
(
g
);
++
i
)
for
(
i
=
0
;
i
<
int
(
num_vertices
(
g
)
)
;
++
i
)
if
(
vertex
(
i
,
g
)
!=
graph_traits
<
Graph
>::
null_vertex
())
sources
.
push_back
(
vertex
(
i
,
g
));
n_samples
=
min
(
n_samples
,
sources
.
size
());
...
...
src/graph/topology/graph_denominator_tree.cc
View file @
2d5dca6c
...
...
@@ -39,7 +39,7 @@ typedef property_map_types::apply<mpl::vector<int32_t>,
mpl
::
bool_
<
false
>
>::
type
pred_properties
;
bool
denominator_tree
(
GraphInterface
&
gi
,
size_t
entry
,
boost
::
any
pred_map
)
void
denominator_tree
(
GraphInterface
&
gi
,
size_t
entry
,
boost
::
any
pred_map
)
{
run_action
<
graph_tool
::
detail
::
always_directed
>
()
(
gi
,
bind
<
void
>
(
get_denominator_tree
(),
_1
,
entry
,
_2
),
...
...
src/graph/topology/graph_minimum_spanning_tree.cc
View file @
2d5dca6c
...
...
@@ -111,7 +111,7 @@ typedef property_map_types::apply<mpl::vector<uint8_t>,
mpl
::
bool_
<
false
>
>::
type
tree_properties
;
bool
get_kruskal_spanning_tree
(
GraphInterface
&
gi
,
boost
::
any
weight_map
,
void
get_kruskal_spanning_tree
(
GraphInterface
&
gi
,
boost
::
any
weight_map
,
boost
::
any
tree_map
)
{
...
...
@@ -129,7 +129,7 @@ bool get_kruskal_spanning_tree(GraphInterface& gi, boost::any weight_map,
weight_maps
(),
edge_scalar_properties
())(
weight_map
,
tree_map
);
}
bool
get_prim_spanning_tree
(
GraphInterface
&
gi
,
size_t
root
,
void
get_prim_spanning_tree
(
GraphInterface
&
gi
,
size_t
root
,
boost
::
any
weight_map
,
boost
::
any
tree_map
)
{
typedef
ConstantPropertyMap
<
size_t
,
GraphInterface
::
edge_t
>
cweight_t
;
...
...
src/graph/topology/graph_topology.cc
View file @
2d5dca6c
...
...
@@ -25,15 +25,15 @@ using namespace graph_tool;
bool
check_isomorphism
(
GraphInterface
&
gi1
,
GraphInterface
&
gi2
,
boost
::
any
iso_map
);
bool
get_kruskal_spanning_tree
(
GraphInterface
&
gi
,
boost
::
any
weight_map
,
void
get_kruskal_spanning_tree
(
GraphInterface
&
gi
,
boost
::
any
weight_map
,
boost
::
any
tree_map
);
bool
get_prim_spanning_tree
(
GraphInterface
&
gi
,
size_t
root
,
void
get_prim_spanning_tree
(
GraphInterface
&
gi
,
size_t
root
,
boost
::
any
weight_map
,
boost
::
any
tree_map
);
void
topological_sort
(
GraphInterface
&
gi
,
vector
<
int32_t
>&
sort
);
bool
denominator_tree
(
GraphInterface
&
gi
,
size_t
entry
,
boost
::
any
pred_map
);
void
denominator_tree
(
GraphInterface
&
gi
,
size_t
entry
,
boost
::
any
pred_map
);
void
transitive_closure
(
GraphInterface
&
gi
,
GraphInterface
&
tcgi
);
...
...
src/graph/util/graph_search.hh
View file @
2d5dca6c
...
...
@@ -52,7 +52,7 @@ bool operator<=(const vector<ValueType>& v1, const vector<ValueType>& v2)
// sort strings in alphabetical (ASCII) order
bool
operator
<=
(
const
string
s1
,
const
string
s2
)
{
for
(
size_t
i
;
i
<
s1
.
size
();
++
i
)
for
(
size_t
i
=
0
;
i
<
s1
.
size
();
++
i
)
{
if
(
s1
[
i
]
!=
s1
[
i
])
return
(
s1
[
i
]
<
s1
[
i
]);
...
...
@@ -67,7 +67,7 @@ bool operator<=(const vector<string>& v1, const vector<string>& v2)
return
true
;
if
(
v1
.
size
()
>
v2
.
size
())
return
false
;
for
(
size_t
i
;
i
<
v1
.
size
();
++
i
)
for
(
size_t
i
=
0
;
i
<
v1
.
size
();
++
i
)
{
if
(
v1
[
i
]
>
v2
[
i
])
return
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment