Minor modification for documentation and not changing topology if not necessary

This commit is contained in:
lasnier 2012-12-04 17:40:00 +01:00
commit 9b46377062
5 changed files with 54 additions and 45 deletions

View file

@ -31,6 +31,8 @@ Contact: paradiseo-help@lists.gforge.inria.fr
#include <vector> #include <vector>
void paradiseo::smp::Complete::operator()(unsigned nbNode, std::vector<std::vector<bool>>& matrix) const void paradiseo::smp::Complete::operator()(unsigned nbNode, std::vector<std::vector<bool>>& matrix) const
{
if(nbNode!=matrix.size())
{ {
matrix.clear(); matrix.clear();
@ -44,3 +46,4 @@ void paradiseo::smp::Complete::operator()(unsigned nbNode, std::vector<std::vect
for(int i=0;i<nbNode;i++) for(int i=0;i<nbNode;i++)
matrix[i][i]=false; matrix[i][i]=false;
} }
}

View file

@ -38,7 +38,7 @@ namespace smp
{ {
/** /**
*Complete: Inherit from TopologyBuilder. Reprents a builder for a complete topology : each node has every other node for neighor. *Complete: Inherit from TopologyBuilder. Represents a builder for a complete topology : each node has every other node for neighor.
*/ */
class Complete: public TopologyBuilder class Complete: public TopologyBuilder
{ {

View file

@ -33,6 +33,8 @@ Contact: paradiseo-help@lists.gforge.inria.fr
#include <assert.h> #include <assert.h>
void paradiseo::smp::Hypercubic::operator()(unsigned nbNode, std::vector<std::vector<bool>>& matrix) const void paradiseo::smp::Hypercubic::operator()(unsigned nbNode, std::vector<std::vector<bool>>& matrix) const
{
if(nbNode!=matrix.size())
{ {
//Check if the number of node is coherent with an hypercube //Check if the number of node is coherent with an hypercube
assert((nbNode & (nbNode-1)) == 0); assert((nbNode & (nbNode-1)) == 0);
@ -60,3 +62,4 @@ void paradiseo::smp::Hypercubic::operator()(unsigned nbNode, std::vector<std::ve
} }
} }
} }
}

View file

@ -31,6 +31,8 @@ Contact: paradiseo-help@lists.gforge.inria.fr
#include <topology/ring.h> #include <topology/ring.h>
void paradiseo::smp::Ring::operator()(unsigned nbNode, std::vector<std::vector<bool>>& matrix) const void paradiseo::smp::Ring::operator()(unsigned nbNode, std::vector<std::vector<bool>>& matrix) const
{
if(nbNode!=matrix.size())
{ {
matrix.clear(); matrix.clear();
@ -45,3 +47,4 @@ void paradiseo::smp::Ring::operator()(unsigned nbNode, std::vector<std::vector<b
for(int i=0; i<nbNode;i++) for(int i=0; i<nbNode;i++)
matrix[i][(i+1)%nbNode]=true; matrix[i][(i+1)%nbNode]=true;
} }
}

View file

@ -39,7 +39,7 @@ namespace smp
{ {
/** /**
*Ring: Inherit from TopologyBuilder. Reprents a builder for a complete topology : each node has the next node for neighor. The last node is connected to the first. *Ring: Inherit from TopologyBuilder. Represents a builder for a ring topology : each node has the next node for neighor. The last node is connected to the first.
*/ */
class Ring : public TopologyBuilder class Ring : public TopologyBuilder
{ {