Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tiago Peixoto
graph-tool
Commits
cff7450e
Commit
cff7450e
authored
Jul 11, 2020
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some clang warnings
parent
6891e399
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
33 additions
and
42 deletions
+33
-42
src/boost-workaround/boost/graph/maximum_weighted_matching.hpp
...oost-workaround/boost/graph/maximum_weighted_matching.hpp
+3
-0
src/graph/graph_python_interface.cc
src/graph/graph_python_interface.cc
+1
-1
src/graph/graph_python_interface.hh
src/graph/graph_python_interface.hh
+1
-1
src/graph/inference/blockmodel/graph_blockmodel_gibbs.cc
src/graph/inference/blockmodel/graph_blockmodel_gibbs.cc
+2
-1
src/graph/inference/blockmodel/graph_blockmodel_mcmc.cc
src/graph/inference/blockmodel/graph_blockmodel_mcmc.cc
+2
-1
src/graph/inference/blockmodel/graph_blockmodel_multiflip_mcmc.cc
...h/inference/blockmodel/graph_blockmodel_multiflip_mcmc.cc
+2
-1
src/graph/inference/blockmodel/graph_blockmodel_partition.hh
src/graph/inference/blockmodel/graph_blockmodel_partition.hh
+0
-26
src/graph/inference/layers/graph_blockmodel_layers.hh
src/graph/inference/layers/graph_blockmodel_layers.hh
+2
-0
src/graph/inference/layers/graph_blockmodel_layers_gibbs.cc
src/graph/inference/layers/graph_blockmodel_layers_gibbs.cc
+2
-1
src/graph/inference/layers/graph_blockmodel_layers_mcmc.cc
src/graph/inference/layers/graph_blockmodel_layers_mcmc.cc
+2
-1
src/graph/inference/layers/graph_blockmodel_layers_multiflip_mcmc.cc
...nference/layers/graph_blockmodel_layers_multiflip_mcmc.cc
+2
-1
src/graph/inference/layers/graph_blockmodel_layers_overlap_gibbs.cc
...inference/layers/graph_blockmodel_layers_overlap_gibbs.cc
+2
-1
src/graph/inference/layers/graph_blockmodel_layers_overlap_mcmc.cc
.../inference/layers/graph_blockmodel_layers_overlap_mcmc.cc
+2
-1
src/graph/inference/layers/graph_blockmodel_layers_overlap_multiflip_mcmc.cc
.../layers/graph_blockmodel_layers_overlap_multiflip_mcmc.cc
+2
-1
src/graph/inference/overlap/graph_blockmodel_overlap_gibbs.cc
...graph/inference/overlap/graph_blockmodel_overlap_gibbs.cc
+2
-1
src/graph/inference/overlap/graph_blockmodel_overlap_mcmc.cc
src/graph/inference/overlap/graph_blockmodel_overlap_mcmc.cc
+2
-1
src/graph/inference/overlap/graph_blockmodel_overlap_multiflip_mcmc.cc
...erence/overlap/graph_blockmodel_overlap_multiflip_mcmc.cc
+2
-1
src/graph/layout/graph_arf.hh
src/graph/layout/graph_arf.hh
+1
-1
src/graph/topology/graph_subgraph_isomorphism.cc
src/graph/topology/graph_subgraph_isomorphism.cc
+1
-1
No files found.
src/boost-workaround/boost/graph/maximum_weighted_matching.hpp
View file @
cff7450e
...
...
@@ -84,6 +84,7 @@ namespace boost
blossom_ptr_t
father
;
blossom
()
:
dual_var
(
0
),
father
(
blossom_ptr_t
())
{}
virtual
~
blossom
()
{}
// get the base vertex of a blossom by recursively getting
// its base sub-blossom, which is always the first one in
...
...
@@ -129,6 +130,8 @@ namespace boost
{
public:
trivial_blossom
(
vertex_descriptor_t
v
)
:
trivial_vertex
(
v
)
{}
virtual
~
trivial_blossom
()
{}
virtual
vertex_descriptor_t
get_base
()
const
{
return
trivial_vertex
;
...
...
src/graph/graph_python_interface.cc
View file @
cff7450e
...
...
@@ -307,7 +307,7 @@ python::object get_edge(GraphInterface& gi, size_t s, size_t t, bool all_edges)
(
std
::
forward
<
decltype
(
graph
)
>
(
graph
),
gi
,
s
,
t
,
all_edges
,
es
);
})();
return
es
;
return
std
::
move
(
es
)
;
}
...
...
src/graph/graph_python_interface.hh
View file @
cff7450e
...
...
@@ -619,7 +619,7 @@ public:
_pmap
.
swap
(
other
.
_pmap
);
}
void
swap_dispatch
(
PythonPropertyMap
&
other
,
std
::
false_type
)
void
swap_dispatch
(
PythonPropertyMap
&
,
std
::
false_type
)
{
throw
ValueException
(
"Read-only property map cannot be swapped."
);
}
...
...
src/graph/inference/blockmodel/graph_blockmodel_gibbs.cc
View file @
cff7450e
...
...
@@ -67,6 +67,7 @@ class gibbs_sweep_dispatch : public gibbs_sweep_base
{
public:
gibbs_sweep_dispatch
(
State
&
s
)
:
_s
(
s
)
{}
virtual
~
gibbs_sweep_dispatch
()
{}
virtual
std
::
tuple
<
double
,
size_t
,
size_t
>
run
(
rng_t
&
rng
)
{
...
...
@@ -116,7 +117,7 @@ python::object do_gibbs_sweep_parallel(python::object ogibbs_states,
python
::
list
orets
;
for
(
auto
&
ret
:
rets
)
orets
.
append
(
tuple_apply
([
&
](
auto
&
...
args
){
return
python
::
make_tuple
(
args
...);
},
ret
));
return
orets
;
return
std
::
move
(
orets
)
;
}
void
export_blockmodel_gibbs
()
...
...
src/graph/inference/blockmodel/graph_blockmodel_mcmc.cc
View file @
cff7450e
...
...
@@ -67,6 +67,7 @@ class MCMC_sweep : public MCMC_sweep_base
{
public:
MCMC_sweep
(
State
&
s
)
:
_s
(
s
)
{}
virtual
~
MCMC_sweep
()
{}
virtual
std
::
tuple
<
double
,
size_t
,
size_t
>
run
(
rng_t
&
rng
)
{
...
...
@@ -116,7 +117,7 @@ python::object do_mcmc_sweep_parallel(python::object omcmc_states,
python
::
list
orets
;
for
(
auto
&
ret
:
rets
)
orets
.
append
(
tuple_apply
([
&
](
auto
&
...
args
){
return
python
::
make_tuple
(
args
...);
},
ret
));
return
orets
;
return
std
::
move
(
orets
)
;
}
void
export_blockmodel_mcmc
()
...
...
src/graph/inference/blockmodel/graph_blockmodel_multiflip_mcmc.cc
View file @
cff7450e
...
...
@@ -67,6 +67,7 @@ class MCMC_sweep : public MCMC_sweep_base
{
public:
MCMC_sweep
(
State
&
s
)
:
_s
(
s
)
{}
virtual
~
MCMC_sweep
()
{}
virtual
std
::
tuple
<
double
,
size_t
,
size_t
>
run
(
rng_t
&
rng
)
{
...
...
@@ -116,7 +117,7 @@ python::object do_multiflip_mcmc_sweep_parallel(python::object omcmc_states,
python
::
list
orets
;
for
(
auto
&
ret
:
rets
)
orets
.
append
(
tuple_apply
([
&
](
auto
&
...
args
){
return
python
::
make_tuple
(
args
...);
},
ret
));
return
orets
;
return
std
::
move
(
orets
)
;
}
void
export_blockmodel_multiflip_mcmc
()
...
...
src/graph/inference/blockmodel/graph_blockmodel_partition.hh
View file @
cff7450e
...
...
@@ -571,32 +571,6 @@ public:
change_vertex_degs
(
v
,
nr
,
g
,
vweight
,
eweight
,
degs
,
1
);
}
void
change_k
(
size_t
v
,
size_t
r
,
bool
deg_corr
,
int
vweight
,
int
kin
,
int
kout
,
int
diff
)
{
if
(
_total
[
r
]
==
0
&&
diff
*
vweight
>
0
)
_actual_B
++
;
if
(
_total
[
r
]
==
vweight
&&
diff
*
vweight
<
0
)
_actual_B
--
;
_total
[
r
]
+=
diff
*
vweight
;
_N
+=
diff
*
vweight
;
assert
(
_total
[
r
]
>=
0
);
if
(
deg_corr
)
{
auto
deg
=
make_pair
(
kin
,
kout
);
auto
iter
=
_hist
[
r
].
insert
({
deg
,
0
}).
first
;
iter
->
second
+=
diff
*
vweight
;
if
(
iter
->
second
==
0
)
_hist
[
r
].
erase
(
iter
);
_em
[
r
]
+=
diff
*
deg
.
first
*
vweight
;
_ep
[
r
]
+=
diff
*
deg
.
second
*
vweight
;
}
}
void
change_E
(
int
dE
)
{
_E
+=
dE
;
...
...
src/graph/inference/layers/graph_blockmodel_layers.hh
View file @
cff7450e
...
...
@@ -105,6 +105,7 @@ struct Layers
for
(
auto
e
:
edges_range
(
BaseState
::
_g
))
_E
+=
BaseState
::
_eweight
[
e
];
}
virtual
~
LayerState
(){}
LayeredBlockState
*
_lstate
;
bmap_t
&
_block_map
;
...
...
@@ -236,6 +237,7 @@ struct Layers
for
(
auto
&
state
:
_layers
)
state
.
_lstate
=
this
;
}
virtual
~
LayeredBlockState
()
{}
std
::
vector
<
LayerState
>
_layers
;
size_t
_actual_B
=
0
;
...
...
src/graph/inference/layers/graph_blockmodel_layers_gibbs.cc
View file @
cff7450e
...
...
@@ -84,6 +84,7 @@ class gibbs_sweep_dispatch : public gibbs_sweep_base
{
public:
gibbs_sweep_dispatch
(
State
&
s
)
:
_s
(
s
)
{}
virtual
~
gibbs_sweep_dispatch
()
{}
virtual
std
::
tuple
<
double
,
size_t
,
size_t
>
run
(
rng_t
&
rng
)
{
...
...
@@ -144,7 +145,7 @@ python::object gibbs_layered_sweep_parallel(python::object ogibbs_states,
python
::
list
orets
;
for
(
auto
&
ret
:
rets
)
orets
.
append
(
tuple_apply
([
&
](
auto
&
...
args
){
return
python
::
make_tuple
(
args
...);
},
ret
));
return
orets
;
return
std
::
move
(
orets
)
;
#endif
}
...
...
src/graph/inference/layers/graph_blockmodel_layers_mcmc.cc
View file @
cff7450e
...
...
@@ -85,6 +85,7 @@ class MCMC_sweep : public MCMC_sweep_base
{
public:
MCMC_sweep
(
State
&
s
)
:
_s
(
s
)
{}
virtual
~
MCMC_sweep
()
{}
virtual
std
::
tuple
<
double
,
size_t
,
size_t
>
run
(
rng_t
&
rng
)
{
...
...
@@ -144,7 +145,7 @@ python::object mcmc_layered_sweep_parallel(python::object omcmc_states,
python
::
list
orets
;
for
(
auto
&
ret
:
rets
)
orets
.
append
(
tuple_apply
([
&
](
auto
&
...
args
){
return
python
::
make_tuple
(
args
...);
},
ret
));
return
orets
;
return
std
::
move
(
orets
)
;
#endif
}
...
...
src/graph/inference/layers/graph_blockmodel_layers_multiflip_mcmc.cc
View file @
cff7450e
...
...
@@ -84,6 +84,7 @@ class MCMC_sweep : public MCMC_sweep_base
{
public:
MCMC_sweep
(
State
&
s
)
:
_s
(
s
)
{}
virtual
~
MCMC_sweep
()
{}
virtual
std
::
tuple
<
double
,
size_t
,
size_t
>
run
(
rng_t
&
rng
)
{
...
...
@@ -143,7 +144,7 @@ python::object multiflip_mcmc_layered_sweep_parallel(python::object omcmc_states
python
::
list
orets
;
for
(
auto
&
ret
:
rets
)
orets
.
append
(
tuple_apply
([
&
](
auto
&
...
args
){
return
python
::
make_tuple
(
args
...);
},
ret
));
return
orets
;
return
std
::
move
(
orets
)
;
#endif
}
...
...
src/graph/inference/layers/graph_blockmodel_layers_overlap_gibbs.cc
View file @
cff7450e
...
...
@@ -83,6 +83,7 @@ class gibbs_sweep_dispatch : public gibbs_sweep_base
{
public:
gibbs_sweep_dispatch
(
State
&
s
)
:
_s
(
s
)
{}
virtual
~
gibbs_sweep_dispatch
()
{}
virtual
std
::
tuple
<
double
,
size_t
,
size_t
>
run
(
rng_t
&
rng
)
{
...
...
@@ -142,7 +143,7 @@ python::object gibbs_layered_overlap_sweep_parallel(python::object ogibbs_states
python
::
list
orets
;
for
(
auto
&
ret
:
rets
)
orets
.
append
(
tuple_apply
([
&
](
auto
&
...
args
){
return
python
::
make_tuple
(
args
...);
},
ret
));
return
orets
;
return
std
::
move
(
orets
)
;
#endif
}
...
...
src/graph/inference/layers/graph_blockmodel_layers_overlap_mcmc.cc
View file @
cff7450e
...
...
@@ -84,6 +84,7 @@ class MCMC_sweep : public MCMC_sweep_base
{
public:
MCMC_sweep
(
State
&
s
)
:
_s
(
s
)
{}
virtual
~
MCMC_sweep
()
{}
virtual
std
::
tuple
<
double
,
size_t
,
size_t
>
run
(
rng_t
&
rng
)
{
...
...
@@ -143,7 +144,7 @@ python::object mcmc_layered_overlap_sweep_parallel(python::object omcmc_states,
python
::
list
orets
;
for
(
auto
&
ret
:
rets
)
orets
.
append
(
tuple_apply
([
&
](
auto
&
...
args
){
return
python
::
make_tuple
(
args
...);
},
ret
));
return
orets
;
return
std
::
move
(
orets
)
;
#endif
}
...
...
src/graph/inference/layers/graph_blockmodel_layers_overlap_multiflip_mcmc.cc
View file @
cff7450e
...
...
@@ -84,6 +84,7 @@ class MCMC_sweep : public MCMC_sweep_base
{
public:
MCMC_sweep
(
State
&
s
)
:
_s
(
s
)
{}
virtual
~
MCMC_sweep
()
{}
virtual
std
::
tuple
<
double
,
size_t
,
size_t
>
run
(
rng_t
&
rng
)
{
...
...
@@ -142,7 +143,7 @@ python::object multiflip_mcmc_layered_overlap_sweep_parallel(python::object omcm
python
::
list
orets
;
for
(
auto
&
ret
:
rets
)
orets
.
append
(
tuple_apply
([
&
](
auto
&
...
args
){
return
python
::
make_tuple
(
args
...);
},
ret
));
return
orets
;
return
std
::
move
(
orets
)
;
}
void
export_layered_overlap_blockmodel_multiflip_mcmc
()
...
...
src/graph/inference/overlap/graph_blockmodel_overlap_gibbs.cc
View file @
cff7450e
...
...
@@ -70,6 +70,7 @@ class gibbs_sweep_dispatch : public gibbs_sweep_base
{
public:
gibbs_sweep_dispatch
(
State
&
s
)
:
_s
(
s
)
{}
virtual
~
gibbs_sweep_dispatch
()
{}
virtual
std
::
tuple
<
double
,
size_t
,
size_t
>
run
(
rng_t
&
rng
)
{
...
...
@@ -118,7 +119,7 @@ python::object gibbs_overlap_sweep_parallel(python::object ogibbs_states,
python
::
list
orets
;
for
(
auto
&
ret
:
rets
)
orets
.
append
(
tuple_apply
([
&
](
auto
&
...
args
){
return
python
::
make_tuple
(
args
...);
},
ret
));
return
orets
;
return
std
::
move
(
orets
)
;
}
void
export_overlap_blockmodel_gibbs
()
...
...
src/graph/inference/overlap/graph_blockmodel_overlap_mcmc.cc
View file @
cff7450e
...
...
@@ -71,6 +71,7 @@ class MCMC_sweep : public MCMC_sweep_base
{
public:
MCMC_sweep
(
State
&
s
)
:
_s
(
s
)
{}
virtual
~
MCMC_sweep
()
{}
virtual
std
::
tuple
<
double
,
size_t
,
size_t
>
run
(
rng_t
&
rng
)
{
...
...
@@ -120,7 +121,7 @@ python::object overlap_mcmc_sweep_parallel(python::object omcmc_states,
python
::
list
orets
;
for
(
auto
&
ret
:
rets
)
orets
.
append
(
tuple_apply
([
&
](
auto
&
...
args
){
return
python
::
make_tuple
(
args
...);
},
ret
));
return
orets
;
return
std
::
move
(
orets
)
;
}
void
export_overlap_blockmodel_mcmc
()
...
...
src/graph/inference/overlap/graph_blockmodel_overlap_multiflip_mcmc.cc
View file @
cff7450e
...
...
@@ -71,6 +71,7 @@ class MCMC_sweep : public MCMC_sweep_base
{
public:
MCMC_sweep
(
State
&
s
)
:
_s
(
s
)
{}
virtual
~
MCMC_sweep
()
{}
virtual
std
::
tuple
<
double
,
size_t
,
size_t
>
run
(
rng_t
&
rng
)
{
...
...
@@ -120,7 +121,7 @@ python::object overlap_multiflip_mcmc_sweep_parallel(python::object omcmc_states
python
::
list
orets
;
for
(
auto
&
ret
:
rets
)
orets
.
append
(
tuple_apply
([
&
](
auto
&
...
args
){
return
python
::
make_tuple
(
args
...);
},
ret
));
return
orets
;
return
std
::
move
(
orets
)
;
}
void
export_overlap_blockmodel_multiflip_mcmc
()
...
...
src/graph/layout/graph_arf.hh
View file @
cff7450e
...
...
@@ -67,7 +67,7 @@ struct get_arf_layout
diff
+=
dx
*
dx
;
delta_pos
[
j
]
+=
dx
;
}
diff
=
std
::
max
(
sqrt
(
diff
),
1e-6
);
diff
=
std
::
max
(
sqrt
(
diff
),
pos_t
(
1e-6
)
)
;
pos_t
m
=
r
/
diff
;
for
(
size_t
j
=
0
;
j
<
dim
;
++
j
)
{
...
...
src/graph/topology/graph_subgraph_isomorphism.cc
View file @
cff7450e
...
...
@@ -245,7 +245,7 @@ subgraph_isomorphism(GraphInterface& gi1, GraphInterface& gi2,
python
::
list
vmapping
;
for
(
auto
&
vmap
:
vmaps
)
vmapping
.
append
(
PythonPropertyMap
<
vlabel_t
>
(
vmap
));
return
vmapping
;
return
std
::
move
(
vmapping
)
;
}
else
{
...
...
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