[GiNaC-list] comparing symbols

Chris Bouchard cbouchrd at illinois.edu
Thu Jul 24 17:29:47 CEST 2008


GiNaC discussion list, 

I'd like to discern when arguments of a pre-defined function
(from another library, xloops) attain a certain value.  One 
of the arguments is type: 

lst x(symbol("a"), symbol("b")); 

cout << x yields {0,1} and these are the values I'm looking 
for.  I'm unable to define a relational that accurately
tests the values attained by a & b.  I tried: 

if (a==0 && ...) 
if (a.is_equal(0) && ...) 
if (a.is_zero() && ...) 
if (match(a,0,lst placeholder) && ...) 

with no success. "Probably because a is type symbol", I 
reasoned.  So I defined 

lst y(symbol("c"), symbol("d")); 

and used in-place modification 

y[0] = 0; 
y[1] = 1; 

to set symbols c and d to 0 and 1, resp.  I then tried the 
conditionals 

if (x==y && ...) 
if (x.is_equal(y) && ...) 
if (match(x,y,lst placeholder) && ...) 

with no success.  How does one set up a conditional for
symbols that have been assigned numeric values?  Any ideas?

Thanks in advance!  Sincerely, 
Chris Bouchard 


More information about the GiNaC-list mailing list