Commit cff7450e authored by Tiago Peixoto's avatar Tiago Peixoto

Fix some clang warnings

parent 6891e399
......@@ -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;
......
......@@ -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);
}
......
......@@ -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.");
}
......
......@@ -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()
......
......@@ -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()
......
......@@ -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()
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
}
......
......@@ -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
}
......
......@@ -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
}
......
......@@ -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
}
......
......@@ -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
}
......
......@@ -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()
......
......@@ -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()
......
......@@ -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()
......
......@@ -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()
......
......@@ -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)
{
......
......@@ -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
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment