31 Jan
2008
31 Jan
'08
6:49 a.m.
On Thu, Jan 31, 2008 at 08:47:42AM +0300, Alexei Sheplyakov wrote:
struct ff { const ex f0, f1, f2; // should depend on 3 variables const lst sym; ff(const ex& f0_, const ex& f1_, const ex& f2_, const lst& sym_) : f0(f0_), f1(f1_), f2(f2_), sym(sym_) { }
void operator()(GTvector& res, const GTvector& x) const { lst args; args = x[0], x[1], x[2]; res[0] = f0.subs(sym, args) /* may be .evalf() ? */; res[1] = f1.subs(sym, args) /* may be .evalf() ? */; res[2] = f2.subs(sym, args) /* may be .evalf() ? */; return res; ^^^^^^^^^^^
The return statement is not necessary here and is obviously wrong. -- All science is either physics or stamp collecting.