当前位置: 首页>>代码示例>>C++>>正文


C++ VariableSet类代码示例

本文整理汇总了C++中VariableSet的典型用法代码示例。如果您正苦于以下问题:C++ VariableSet类的具体用法?C++ VariableSet怎么用?C++ VariableSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了VariableSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的VariableSet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。