The topology is reconstructed even if the number of nodes did not change in order to start the model more than once (Nils Mangelsen)
This commit is contained in:
parent
c9c982fb81
commit
b411e85607
3 changed files with 41 additions and 49 deletions
|
|
@ -32,19 +32,17 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
|
||||
void paradiseo::smp::Ring::operator()(unsigned nbNode, std::vector<std::vector<bool>>& matrix) const
|
||||
{
|
||||
if(nbNode != matrix.size())
|
||||
{
|
||||
matrix.clear();
|
||||
matrix.clear();
|
||||
|
||||
matrix.resize(nbNode);
|
||||
for(auto& line : matrix)
|
||||
line.resize(nbNode);
|
||||
matrix.resize(nbNode);
|
||||
for(auto& line : matrix)
|
||||
line.resize(nbNode);
|
||||
|
||||
std::vector<bool> line;
|
||||
line.assign(nbNode, false);
|
||||
matrix.assign(nbNode, line);
|
||||
std::vector<bool> line;
|
||||
line.assign(nbNode, false);
|
||||
matrix.assign(nbNode, line);
|
||||
|
||||
for(unsigned i=0; i < nbNode; i++)
|
||||
matrix[i][(i+1)%nbNode]=true;
|
||||
for(unsigned i=0; i < nbNode; i++)
|
||||
matrix[i][(i+1)%nbNode]=true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue