Hi guys, first, thanks for your great package! I am trying to let users input expressions with matrix indices in their expressions (like A.i). I order to try this feature, I wrote a simple program (see attached file try.cpp) (compiled with gcc) the bulk of the program consist in: ex e("2*S.j+n", lst(S,j,n)); //(S is a symbol, j an idx, n a symbol) cout << "ok! :" << e << endl; I am getting the result: ok! :2*S which is wrong in my opinion. Am I doing something wrong? Are there ways to get around this problem? Thanks for your help #include <iostream> #include <ginac/ginac.h> using namespace std; using namespace GiNaC; int main (){ symbol j_sym("j"); symbol n("n"); idx j(j_sym,n); symbol S("S"); try { ex e("2*S.j+n", lst(S,j,n)); cout << "ok! :" << e << endl; } catch (exception &p) { cerr << p.what() << endl; } }
Hi! On Wed, Jul 10, 2002 at 02:09:24PM -0400, Vincent Demarcus wrote:
I am trying to let users input expressions with matrix indices in their expressions (like A.i).
The input parser currently can't handle indices at all... Bye, Christian -- / Coding on PowerPC and proud of it \/ http://www.uni-mainz.de/~bauec002/
Hi! On Fri, Jul 12, 2002 at 03:22:05PM +0200, Christian Bauer wrote:
I am trying to let users input expressions with matrix indices in their expressions (like A.i).
The input parser currently can't handle indices at all...
Ok, now it can. :-) Bye, Christian -- / Coding on PowerPC and proud of it \/ http://www.uni-mainz.de/~bauec002/
participants (2)
-
Christian Bauer
-
Vincent Demarcus