25 #include "evalGodley.rcd" 36 throw error(
"shared column %s is not an asset/liability pair",
41 void SharedColumnCheck::checkShared(
const string& name,
AssetClass ac)
43 if (name.empty() || name==
":_")
45 if (!colAssetType.insert(make_pair(name, ac)).second)
50 if (colAssetType[name]!=asset)
54 if (colAssetType[name]!=liability)
60 throw error(
"duplicated column %s detected",name.c_str());
63 if (!sharedCol.insert(name).second)
64 throw error(
"More than two columns %s detected" ,name.c_str());
68 bool SharedColumnCheck::updateColDefs(
const string& col,
const FlowCoef& fc)
70 const bool alreadySeen=sharedCol.contains(col);
78 void SharedColumnCheck::checkSharedColDefs()
const 81 for (set<string>::iterator i=sharedCol.begin(); i!=sharedCol.end(); ++i)
83 const map<string, double>& cdef=colDef[*i];
84 for (map<string, double>::const_iterator j=cdef.begin();
86 if (abs(j->second)>1e-30)
87 throw error(
"column %s has mismatched flow %s",
88 i->c_str(), j->first.c_str());
92 void EvalGodley::eval(
double* sv,
const double* fv)
const 94 for (
size_t i=0; i<initIdx.size(); ++i)
97 for (
size_t i=0; i<sidx.size(); ++i)
98 sv[sidx[i]] += fv[fidx[i]] * m[i];
void throwInvalidAssetLiabilityPair(const string &name)
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky's state cha...
represents a numerical coefficient times a variable (a "flow")
CLASSDESC_ACCESS_EXPLICIT_INSTANTIATION(minsky::EvalGodley)