Commit ac4eec83 authored by ehebrard's avatar ehebrard
Browse files

resize 0

parent ce67cc91
......@@ -105,7 +105,7 @@ int main(int argc, char *argv[]) {
DistanceGraph<int> G(S2);
cout << G << endl;
G.FloydWarshall();
// cout << G << endl;
......
......@@ -162,31 +162,35 @@ SparseDistanceGraph<T>::SparseDistanceGraph(Schedule<T> &s)
template <typename T> void SparseDistanceGraph<T>::initialise() {
auto n{sched.numEvent()};
if(n > 0) {
predecessor.resize(n);
successor.resize(n);
predecessor.resize(n);
successor.resize(n);
for (auto v : sched.variables) {
for (auto v : sched.variables) {
assert(v->from >= 0 and v->from < n);
assert(v->to >= 0 and v->to < n);
assert(v->from >= 0 and v->from < n);
assert(v->to >= 0 and v->to < n);
successor[v->from].push_back(
{v, static_cast<int>(predecessor[v->to].size())});
predecessor[v->to].push_back(
{v, static_cast<int>(successor[v->from].size())});
}
successor[v->from].push_back(
{v, static_cast<int>(predecessor[v->to].size())});
predecessor[v->to].push_back(
{v, static_cast<int>(successor[v->from].size())});
}
vertices.reserve(n);
vertices.fill();
representant.resize(n);
tail.resize(n);
next.resize(n);
prev.resize(n);
vertices.reserve(n);
vertices.fill();
representant.resize(n);
tail.resize(n);
next.resize(n);
prev.resize(n);
for (auto i = 0; i < n; ++i) {
representant[i] = tail[i] = next[i] = prev[i] = i;
}
for (auto i = 0; i < n; ++i) {
representant[i] = tail[i] = next[i] = prev[i] = i;
}
}
// dbuffer.resize(n, -INFTY);
}
......
Supports Markdown
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