本文整理汇总了C++中VariableSet类的典型用法代码示例。如果您正苦于以下问题:C++ VariableSet类的具体用法?C++ VariableSet怎么用?C++ VariableSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VariableSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: closePrefix
/**
* Does the closure of the formula, by adding the variables to the list of
* prefix sets
*
* @param prefix: list of second-order variables corresponding to the prefix
* @param freeVars: list of free variables in formula
* @param negationIsTopMost: whether the prefix had negation on left or no
*/
void closePrefix(PrefixListType & prefix, IdentList* freeVars, bool negationIsTopmost) {
unsigned int quantifiedSize;
unsigned value;
unsigned int prefixSize = prefix.size();
// phi = neg exists X ...
// we will add new level of quantification
if (negationIsTopmost) {
VariableSet set;
quantifiedSize = freeVars->size();
for (unsigned i = 0; i < quantifiedSize; ++i) {
value = freeVars->get(i);
set.push_back(varMap[value]);
}
prefix.push_back(set);
} else {
int index = prefix.size() - 1;
quantifiedSize = freeVars->size();
for (unsigned i = 0; i < quantifiedSize; ++i) {
value = freeVars->get(i);
prefix[index].insert(prefix[index].begin()+i, varMap[value]);
}
}
}
开发者ID:inmathwetrust,项目名称:dWiNA,代码行数:33,代码来源:decision_procedures.cpp
示例2: assignValue
void Variable::assignValue(std::string value) {
VariableSet *vs = VariableSet::instance();
vs->loadIfNeeded();
m_imp->m_value = value;
try {
vs->commit();
} catch (...) {
}
}
开发者ID:gab3d,项目名称:opentoonz,代码行数:9,代码来源:tenv.cpp
示例3: SearchVariable
VariableSet::VariableSet(const VariableSet &vs)
{
for (int var = 0; var<vs.getNumVariables(); var++) {
mVariables.push_back(new SearchVariable(vs.getVariable(var)));
}
for (int par=0; par<(int)vs.mParameters.size(); par++) {
mParameters.push_back(SearchParameter(vs.mParameters[par]));
}
mHand = vs.mHand;
}
开发者ID:mzbikows,项目名称:Graspit,代码行数:10,代码来源:searchState.cpp
示例4: stackVariables
void GeneralConstraint::stackVariables( VariableList& varList,
const VariableSet& varSet )
{
for(VariableSet::const_iterator it= varSet.begin();
it!=varSet.end();
++it)
{
varList.push_back(*it);
}
} // End of method 'GeneralConstraint::stackVariables()'
开发者ID:Milfhunter,项目名称:gpstk,代码行数:11,代码来源:GeneralConstraint.cpp
示例5: convertPrefixFormulaToList
/**
* Takes formula, the prefix, and converts it to the set of sets of second
* order variables, according to the variable map;
*
* @param formula: formula corresponding to the prefix
* @return: list of lists of second-order variables
*/
PrefixListType convertPrefixFormulaToList(ASTForm* formula) {
PrefixListType list;
VariableSet set;
unsigned int quantifiedSize;
unsigned int value;
bool isFirstNeg = true;
// empty prefix is just one empty list
if (formula->kind == aTrue) {
list.push_front(set);
return list;
}
ASTForm* iterator = formula;
// while we are not at the end of the prefix
while (iterator->kind != aTrue) {
//iterator->dump();
//std::cout << "\n";
// Add to set
if (iterator->kind == aEx2) {
ASTForm_Ex2* exf = (ASTForm_Ex2*) iterator;
quantifiedSize = (exf->vl)->size();
for (unsigned i = 0; i < quantifiedSize; ++i) {
value = (exf->vl)->get(i);
//std::cout << value << " -> " << varMap[value] << "\n";
set.push_back(varMap[value]);
}
iterator = exf->f;
isFirstNeg = false;
// Create new set
} else if (iterator->kind == aNot) {
if (!isFirstNeg) {
list.push_front(set);
set.clear();
} else {
isFirstNeg = false;
}
ASTForm_Not* notf = (ASTForm_Not*) iterator;
iterator = notf->f;
// Fail, should not happen
} else {
assert(false);
}
}
if (set.size() != 0) {
list.push_front(set);
}
return list;
}
开发者ID:inmathwetrust,项目名称:dWiNA,代码行数:60,代码来源:decision_procedures.cpp
示例6: tempSet
VariableSet GeneralConstraint::unionVariables( const VariableSet& vs1,
const VariableSet& vs2 )
{
VariableSet tempSet(vs1);
for(VariableSet::const_iterator it=vs2.begin();
it!=vs2.end();
++it)
{
tempSet.insert(*it);
}
return tempSet;
} // End of method 'GeneralConstraint::unionVariables()'
开发者ID:Milfhunter,项目名称:gpstk,代码行数:14,代码来源:GeneralConstraint.cpp
示例7: printTeXVariableSet
void TeXDisplay::printTeXVariableSet(const VariableSet & x) {
d_sink.put(" $\\{$ ");
Variable var;
bool b = x.firstVariable(var);
if(b) {
d_sink.put(var);
b = x.nextVariable(var);
while(b) {
d_sink.put(',');
d_sink.put(var);
b = x.nextVariable(var);
};
};
d_sink.put(" $\\}$ ");
};
开发者ID:mcdeoliveira,项目名称:NC,代码行数:15,代码来源:TeXDisplay.c
示例8: variablesInOrder
VariableSet AdmWithLevels::variablesInOrder() const {
VariableSet result;
typedef vector<vector<Variable> >::const_iterator VI;
VI w = d_v.begin(), e = d_v.end();
while(w!=e) {
const vector<Variable> & V = *w;
vector<Variable>::const_iterator ww = V.begin(), ee = V.end();
while(ww!=ee) {
result.insert(*ww);
++ww;
};
++w;
};
return result;
};
开发者ID:mcdeoliveira,项目名称:NC,代码行数:15,代码来源:AdmWithLevels.cpp
示例9: getVariables
VariableSet GeneralConstraint::getVariables( const SatID& sat,
const TypeID& type )
{
VariableSet vset;
VariableSet varSet = getVariables(sat);
for(VariableSet::iterator itv=varSet.begin();
itv!=varSet.end();
++itv)
{
if( (itv->getType()==type) ) vset.insert(*itv);
}
return vset;
} // End of method 'GeneralConstraint::getVariables(const SatID& sat,...)'
开发者ID:Milfhunter,项目名称:gpstk,代码行数:16,代码来源:GeneralConstraint.cpp
示例10: asString
inline std::string asString(const VariableSet& vset)
{
std::ostringstream oss;
for( VariableSet::const_iterator it = vset.begin();
it != vset.end();
++it )
{
oss << it->getType() << " "
<< it->getSource() << " "
<< it->getSatellite() << " "
<< it->getTypeIndexed() << " "
<< it->getSourceIndexed() << " "
<< it->getSatIndexed()<< std::endl;
}
return oss.str();
}
开发者ID:JC5005,项目名称:GPSTk,代码行数:17,代码来源:Equation.hpp
示例11: result
VariableSet VariableSet::operator*(const VariableSet& o) const {
VariableSet result(capacity_);
for(unsigned i = 0; i < size_; i++) {
if(o.contains(vars_[i]))
result += vars_[i];
}
return result;
}
开发者ID:vianney,项目名称:castor,代码行数:8,代码来源:variable.cpp
示例12: unkSet
VariableSet GeneralConstraint::getVariables( const SourceIDSet& sourceSet )
{
VariableSet vset;
VariableSet unkSet( getVariables() );
for( VariableSet::const_iterator itv = unkSet.begin();
itv != unkSet.end();
++itv )
{
SourceIDSet::const_iterator it = sourceSet.find( (*itv).getSource() );
if( it!=sourceSet.end() ) vset.insert( *itv );
}
return vset;
} // End of method 'GeneralConstraint::getVariables(...'
开发者ID:Milfhunter,项目名称:gpstk,代码行数:17,代码来源:GeneralConstraint.cpp
示例13: variablesIn
void Polynomial::variablesIn(VariableSet & result) const {
const int len = numberOfTerms();
// Bypass the reordering of the polynomial
PolynomialIterator j = _terms.begin();
for(int i=1;i<=len&&!result.full();++i,++j) {
(*j).MonomialPart().variablesIn(result);
}
};
开发者ID:mcdeoliveira,项目名称:NC,代码行数:8,代码来源:oPolynomial.cpp
示例14: solution
Vector<double> GeneralConstraint::getSolution( const VariableSet& varSet )
{
Vector<double> solution(varSet.size(),0.0);
int i(0);
for(VariableSet::const_iterator it=varSet.begin();
it!=varSet.end();
++it)
{
solution[i] = solver.getSolution(*it);
i++;
}
return solution;
} // End of method 'GeneralConstraint::getSolution(...'
开发者ID:Milfhunter,项目名称:gpstk,代码行数:17,代码来源:GeneralConstraint.cpp
示例15: for_each
OptionalMessageList UndeclaredVariableCheck::visitLambdaDefinition(const LambdaDefinitionAddress& lambdaDef) {
OptionalMessageList res;
VariableSet recFunctions;
for_each(lambdaDef.getAddressedNode()->getDefinitions(), [&recFunctions](const LambdaBindingPtr& cur) {
recFunctions.insert(cur->getVariable());
});
for_each(lambdaDef->getDefinitions(), [&](const LambdaBindingAddress& cur) {
// assemble set of defined variables
VariableSet declared;
// add recursive function variables
declared.insert(recFunctions.begin(), recFunctions.end());
// add parameters
auto paramList = cur.getAddressedNode()->getLambda()->getParameterList();
declared.insert(paramList.begin(), paramList.end());
// run check on body ...
VarDeclarationCheck check(declared);
// trigger check
addAll(res, conductCheck(check, cur->getLambda()));
});
return res;
}
开发者ID:8l,项目名称:insieme,代码行数:30,代码来源:imperative_checks.cpp
示例16: merge
void merge( VariableSet &vs, const VariableSet &other )
{
if ( vs.empty() )
vs = other;
else
{
for ( auto i: other )
{
auto cur = vs.find( i.first );
if ( cur == vs.end() )
{
vs.emplace( std::make_pair( i.first, i.second ) );
}
else
cur->second.merge( i.second );
}
}
}
开发者ID:iangodin,项目名称:constructor,代码行数:18,代码来源:Variable.cpp
示例17: getParent
void
Item::extractVariables( VariableSet &vs ) const
{
ItemPtr i = getParent();
if ( i )
i->extractVariables( vs );
for ( auto x = myVariables.begin(); x != myVariables.end(); ++x )
vs.emplace( std::make_pair( x->first, x->second ) );
}
开发者ID:iangodin,项目名称:constructor,代码行数:9,代码来源:Item.cpp
示例18: operator
bool operator()(const VariableSet & m,const VariableSet & n) const {
bool result = false;
int msz = m.size();
int nsz = n.size();
if(msz!=nsz) {
result = msz< nsz;
} else if(msz>0) {
result = false; // perhaps they are equal
Variable v1,v2;
bool b1 = m.firstVariable(v1);
bool b2 = n.firstVariable(v2);
if(v1==v2) {
while(b1&&b2) {
b1 = m.nextVariable(v1);
b2 = n.nextVariable(v2);
if(b1) {
if(v1!=v2) {
result = operator()(v1,v2);
};
} else break;
};
} else {
result = operator()(v1,v2);
};
if(b1!=b2) errorh(__LINE__);
};
return result;
};
开发者ID:lolmid,项目名称:2015-2016,代码行数:28,代码来源:ByAdmissible.hpp
示例19: covariance
Matrix<double> GeneralConstraint::getCovariance( const VariableSet& varSet )
{
Matrix<double> covariance(varSet.size(),varSet.size(),0.0);
int i(0);
for(VariableSet::const_iterator iti=varSet.begin();
iti!=varSet.end();
++iti)
{
int j(0);
for(VariableSet::const_iterator itj=varSet.begin();
itj!=varSet.end();
++itj)
{
covariance[i][j] = solver.getCovariance(*iti,*itj);
j++;
}
i++;
}
return covariance;
} // End of method 'GeneralConstraint::getCovariance(...'
开发者ID:Milfhunter,项目名称:gpstk,代码行数:25,代码来源:GeneralConstraint.cpp
示例20: intersectionVariables
VariableSet GeneralConstraint::intersectionVariables(const VariableSet& vs1,
const VariableSet& vs2 )
{
VariableSet tempSet;
for(VariableSet::const_iterator it=vs1.begin();
it!=vs1.end();
++it)
{
VariableSet::const_iterator it2 = vs2.find(*it);
if(it2!=vs2.end()) tempSet.insert(*it);
}
return tempSet;
} // End of method 'GeneralConstraint::intersectionVariables()'
开发者ID:Milfhunter,项目名称:gpstk,代码行数:15,代码来源:GeneralConstraint.cpp
注:本文中的VariableSet类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论