Commit afd7243a authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix compilation problem with clang

parent 35b3bf30
......@@ -2608,7 +2608,8 @@ public:
return S;
}
double get_parallel_entropy(auto&& vs, auto&& skip)
template <class Vs, class Skip>
double get_parallel_entropy(Vs&& vs, Skip&& skip)
{
double S = 0;
for (auto v : vs)
......
......@@ -117,7 +117,7 @@ struct MCMC
{
size_t r = _state._b[v];
if (r == nr)
return {0., 0.};
return std::make_tuple(0., 0.);
double dS = _state.virtual_move(v, r, nr, _entropy_args,
_m_entries);
......@@ -130,7 +130,7 @@ struct MCMC
_m_entries);
a = log(pb) - log(pf);
}
return {dS, a};
return std::make_tuple(dS, a);
}
void perform_move(size_t v, size_t nr)
......
......@@ -141,7 +141,8 @@ public:
return S;
}
double get_deg_dl_ent(auto&& rs, auto&& ks)
template <class Rs, class Ks>
double get_deg_dl_ent(Rs&& rs, Ks&& ks)
{
double S = 0;
for (auto r : rs)
......@@ -172,7 +173,8 @@ public:
return S;
}
double get_deg_dl_uniform(auto&& rs, auto&&)
template <class Rs, class Ks>
double get_deg_dl_uniform(Rs&& rs, Ks&&)
{
double S = 0;
for (auto r : rs)
......@@ -184,7 +186,8 @@ public:
return S;
}
double get_deg_dl_dist(auto&& rs, auto&& ks)
template <class Rs, class Ks>
double get_deg_dl_dist(Rs&& rs, Ks&& ks)
{
double S = 0;
for (auto r : rs)
......@@ -218,7 +221,8 @@ public:
return S;
}
double get_deg_dl(int kind, auto&& rs, auto&& ks)
template <class Rs, class Ks>
double get_deg_dl(int kind, Rs&& rs, Ks&& ks)
{
switch (kind)
{
......
......@@ -97,12 +97,14 @@ struct MCMC
return node_state(u, v);
}
bool skip_node(auto&)
template <class T>
bool skip_node(T&)
{
return false;
}
size_t node_weight(auto&)
template <class T>
size_t node_weight(T&)
{
return 1;
}
......@@ -136,7 +138,7 @@ struct MCMC
virtual_move_dS(size_t ei, int dm)
{
if (dm == 0)
return {0., 0.};
return std::make_tuple(0., 0.);
size_t u, v;
std::tie(u, v) = get_edge(ei);
......@@ -147,7 +149,7 @@ struct MCMC
else
dS = _state.add_edge_dS(u, v, _entropy_args);
return {dS, 0.};
return std::make_tuple(dS, 0.);
}
void perform_move(size_t ei, int dm)
......@@ -187,7 +189,8 @@ struct MCMC
return _niter;
}
void step(auto&, int)
template <class T>
void step(T&, int)
{
}
};
......
......@@ -693,8 +693,8 @@ class TemperingState(object):
return sweep_algo[1](self.states, algo_states)
def _sweep(self, algo, adjacent=True, **kwargs):
if numpy.random.random() < .5:
def _sweep(self, algo, r=0.1, adjacent=True, **kwargs):
if numpy.random.random() < r:
return self.states_swap(adjacent=adjacent, **kwargs)
else:
return self.states_move(algo, **kwargs)
......
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