I want to try to regularly write giac dependent c++ code. But there are things that confuses me a bit. First, I don't suppose that there is any (official or unofficial) documentation on using the giac c++ library, is there? This is understandable (since I am sure it is a lot of work for the developrs). Second, I have the following situation:
I have a set of precomputed equations (that I can do in xcas or some other computer algebra software) saved in a text file.
To use these in giac (c++) I just initialize the equation as an expression in giac by typing
Code : Tout sélectionner
eqn=giac::gen(str.c_str(),&ct);
Now str has several variables like x1,x2,..etc. and I need to sometimes substitute these variables with some numerical value. So it would be nice to have a gen type that represents these variables. Do I have to initialize x1, x2,..etc. using the constructor like in eqn? Because this way of initializing a gen type looks cumbersome. I have seen that one can use std::cin in istream to initialize a gen variable given by a user, so there must be a faster way to initialize gen e.g.
Code : Tout sélectionner
gen a;
a = "x1";
Should the procedure always be creating a string variable and referring to the address of the string variable in the constructor?
Jose