コード例 #1
0
ファイル: IntegerSet.cpp プロジェクト: 12330072/C-learning
IntegerSet::IntegerSet(int s[], int l) {
    emptySet();
    for (int i = 0; i < l; i++) {
        if (validEntry(s[i]) == 0)
            cout << "Invalid insert attempted!" << endl;
        else
        set[s[i]] = 1;
    }
}
コード例 #2
0
ファイル: procSet.C プロジェクト: Federico2014/edg4x-rose
bool contRangeProcSet::cgDisconnect(ConstrGraph* tgtCG) const
{
        bool modified=false;
        
        if(emptySet() || !validSet()) return modified;
        
        if(tgtCG!=NULL)
        {
                // Disconnect this process set's bounds from its constraint craph
                modified = tgtCG->removeVar(getLB()) || modified;
                modified = tgtCG->removeVar(getUB()) || modified;
        }
        return modified;
}
コード例 #3
0
ファイル: procSet.C プロジェクト: Federico2014/edg4x-rose
// Removes the upper and lower bounds of this set from its associated constraint graph
// or the provided constraint graph (if it is not ==NULL) and sets cg to NULL if tgtCG==NULL.
// Returns true if this causes the constraint graph to change, false otherwise.
bool contRangeProcSet::cgDisconnect() 
{
        bool modified=false;
        
        if(emptySet() || !validSet()) return modified;
                
        if(cg!=NULL)
        {
                // Disconnect this process set's bounds from its constraint craph
                modified = cg->removeVar(getLB()) || modified;
                modified = cg->removeVar(getUB()) || modified;
                
                cg = NULL;
        }

        return modified;
}
コード例 #4
0
ファイル: procSet.C プロジェクト: Federico2014/edg4x-rose
// The size of this process set, either a specific integer or infinity
int contRangeProcSet::size() const
{
/*Dbg::dbg << "contRangeProcSet::size() : cg->eqVars("<<lb.str()<<", "<<ub.str()<<")="<<cg->eqVars(lb, ub)<<endl;
Dbg::dbg << "    cg = "<<cg->str()<<endl;*/
        if(emptySet())
                return 0;
        // If the lower bound is equal to the upper bound, the domain has a single element
        else if(cg->eqVars(lb, ub, "    "))
                return 1;
        else
        {
                int a, b, c;
                // If both the lower bound and the upper bound are related to each other via a 
                // lb = ub + c relationship
                if(cg->eqVars(lb, ub, a, b, c, "    ") && a==1 && b==1)
                        return c;
                // Otherwise, we don't know the exact size of this set and conservatively report infinity
                else
                        return infinity;
        }
}
コード例 #5
0
ファイル: ossEDU.cpp プロジェクト: 2015520/SequoiaDB
 _ossSigSet::_ossSigSet ()
 {
    emptySet () ;
 }