本文整理汇总了C++中lst::append方法的典型用法代码示例。如果您正苦于以下问题:C++ lst::append方法的具体用法?C++ lst::append怎么用?C++ lst::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lst
的用法示例。
在下文中一共展示了lst::append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: find
/** Find all occurrences of a pattern. The found matches are appended to
* the "found" list. If the expression itself matches the pattern, the
* children are not further examined. This function returns true when any
* matches were found. */
bool ex::find(const ex & pattern, lst & found) const
{
if (match(pattern)) {
found.append(*this);
found.sort();
found.unique();
return true;
}
bool any_found = false;
for (size_t i=0; i<nops(); i++)
if (op(i).find(pattern, found))
any_found = true;
return any_found;
}
示例2: convert_delay_to_lagvalue
//
// On return, lags is a GiNac::lst, where each element is a GiNac::lst
// of length 4 containing {lagsym, variable_index + 1, var, lag_time}
//
void VectorField::convert_delay_to_lagvalue(ex& f, lst &lags)
{
symbol t(IndependentVariable);
exset dlist;
f.find(delay(wild(1),wild(2)),dlist);
for (exset::const_iterator iter = dlist.begin(); iter != dlist.end(); ++iter) {
ex delayfunc = *iter;
ex delayexpr = delayfunc.op(0);
lst vars = FindVarsInEx(delayexpr);
ex del = delayfunc.op(1);
for (lst::const_iterator iter = vars.begin(); iter != vars.end(); ++iter) {
ostringstream os;
lst tmp;
os << lags.nops() + 1;
symbol lagsym("lag" + os.str());
int vindex = FindVar(ex_to<symbol>(*iter));
delayexpr = delayexpr.subs(*iter == lagsym);
tmp = {lagsym, vindex + 1, *iter, del};
lags.append(tmp);
}
f = f.subs(delayfunc == delayexpr);
}
}