[GiNaC-list] subscripted variables

Marko Riedel riedelmo at mathematik.uni-stuttgart.de
Sun Feb 5 23:07:37 CET 2023


Greetings to all.

I am at this time considering to use GiNaC for some computations from 
group theory. I am not a C++ programmer. I would like to ask for 
assistance with the following task. I have a polynomial in several 
variables like a[1], a[2], a[5] etc. I understand I can initialize these 
by creating a symbol object with the variable name. The problem is, I 
need an easy and conformal means of accessing the integer in the 
variable name. This could be done by matching the name to a regular 
expression and extracting the value but I imagine there must be a better 
way.

I am also looking for a means of extracting a set of variables that are 
present in a polynomial, or the degree these variables have. 
Furthermore, another question, does the C++ standard library have a 
means of memoizing functions?

Thank you for your assistance.

Marko Riedel



More information about the GiNaC-list mailing list