16 Nov
2014
16 Nov
'14
7:53 a.m.
Hello, I'd like to convert std::string to ex constructor. But my code do not work now. How to put variables to the second argument of ex(const std::string &s, const ex &l). ----Code: #include <iostream> #include <ginac/ginac.h> using namespace std; using namespace GiNaC; int main(){ string st("2*a+3*sqrt(4)*b"); symbol a("a"), b("b"); ex sample(st, ex(a)); cout << sample <<endl; return 0; } ----Excuted: terminate called after throwing an instance of 'std::invalid_argument' what(): find_or_insert_symbol: symbol "a" not found IOT trap