Equation instantiate_equation(Equation innerEq, Name variable, Real index, VarSymbolTable &symbolTable) {
  VarSymbolTable v=symbolTable;
  VarInfo vinfo = VarInfo(TypePrefixes(1,parameter), "Integer", Option<Comment>(), Modification(ModEq(Expression(index))));
  v.insert(variable,vinfo);
  if (is<Equality>(innerEq)) {
      Equality eqeq = boost::get<Equality>(innerEq);
      Expression l=eqeq.left(), r=eqeq.right();
      //std::cout << "Left= " << l << " right " << r << std::endl;
      return Equality(Visit(Modelica::PartEvalExp(v),l),Visit(Modelica::PartEvalExp(v),r));
  } else {
      ERROR("process_for_equations - instantiate_equation:\n"
            "Incorrect equation type or not supported yet.\n");
  }
  return Equation();
}
	// does not check whether value is new
	void VarStore::Set(key_t key, var_t var, bool isClient)
	{
		m_tableLock.WriteLock();
		VarInfo *varRet = FindUnsafe(key);
		if (varRet == NULL)
		{
			m_varTable.push_back(VarInfo(key, var, isClient));
		}			
		else
		{
			OVR_CAPTURE_ASSERT(varRet->key == key);
			varRet->valCur = var;
			varRet->isClient = isClient;
		}
		OVR_CAPTURE_ASSERT(FindUnsafe(key) != NULL);
		m_tableLock.WriteUnlock();
	}
Esempio n. 3
0
void ClaspVmtf::startInit(const Solver& s) {
	if (reinit_) { score_.clear(); vars_.clear(); }
	score_.resize(s.numVars()+1, VarInfo(vars_.end()));
}