27 for (std::map<std::string, unsigned int>::iterator it = numObjectsPerPattern.begin(); it != numObjectsPerPattern.end(); ++it)
29 unsigned int numObjects = it->second;
31 std::vector<Relation> relations;
33 for (
unsigned int i = 0; i < numObjects; ++i)
35 for (
unsigned int j = i + 1; j < numObjects; ++j)
37 relations.push_back({i, j});
47 unsigned int numOnesInVector = 0;
48 for (
bool bit : bitvector)
50 numOnesInVector += bit;
59 std::stack<unsigned int>().swap(
mToVisit);
66 unsigned int toVisit =
mToVisit.top();
91 for (
unsigned int i = 0; i < from; ++i)
93 checkNeighbour(patternName, from, index + from - (i + 1), bitvector);
94 index += numObjects - (i + 1);
97 for (
unsigned int i = index; i < index + numObjects - (from + 1); ++i)
bool isConnected(std::vector< bool > bitvector, const std::string &patternName)
std::stack< unsigned int > mToVisit
void visitNeighbours(const std::string &patternName, unsigned int from, std::vector< bool > bitvector)
std::map< std::string, std::vector< Relation > > mRelationsPerPattern
void checkNeighbour(const std::string &patternName, unsigned int from, unsigned int index, std::vector< bool > bitvector)
ConnectivityChecker(std::map< std::string, unsigned int > numObjectsPerPattern)
std::map< std::string, unsigned int > mNumObjectsPerPattern
std::set< unsigned int > mVisited
this namespace contains all generally usable classes.