Exemple #1
0
bool connectionValid(int mask, Stat S){
    for (int i = 0; i < 5; i++) if (maskGet(mask, i)){
        Stat::iterator it = SSfind(S, i);
        if (it != S.end()) S.erase(it);
    }
    return S.empty();
}
Exemple #2
0
void SScombine(Stat &S, int i, int j){
    Stat::iterator iti = SSfind(S, i);
    Stat::iterator itj = SSfind(S, j);
    if (iti == itj) return;
    set<int> s(*iti);
    for (set<int>::iterator it = itj->begin(); it != itj->end(); it++){
        s.insert(*it);
    }
    S.erase(iti);
    S.erase(itj);
    S.insert(s);
}
Exemple #3
0
void SSinsert(Stat &S, int i, int j){
    Stat::iterator it = SSfind(S, j);
    assert(it != S.end());
    set<int> s(*it); S.erase(it);
    s.insert(i); S.insert(s);    
}