[sympy] Re: recursice call to cse and symbols

2012-04-19 Thread vweber
Here is what I am trying to do, with the hack for the symbols sym = 'r'+sym cse( ..., symbols=symbols(sym+'1:1000') ) so is there a way to replace that with something like this cse( ..., symbols=symbols(previous_last_symbol+1) ) previous_last_symbol = current_last_symbol def opt_eqs(eqs,

Re: [sympy] Re: recursice call to cse and symbols

2012-04-19 Thread Chris Smith
On Thu, Apr 19, 2012 at 2:34 PM, vweber wrote: > Here is what I am trying to do, with the hack for the symbols > > sym = 'r'+sym > cse( ..., symbols=symbols(sym+'1:1000') ) > > so is there a way to replace that with something like this > > cse( ..., symbols=symbols(previous_last_symbol+1) ) > prev

Re: [sympy] Re: recursice call to cse and symbols

2012-04-30 Thread Aaron Meurer
Based on Chris's previous examples, it looks like you can just create a numbered_symbols generator from the start and pass that in each time. Because it is a generator, it will keep track of the symbols count as long as you use the same object. Aaron Meurer On Thu, Apr 19, 2012 at 2:49 AM, vweber

Re: [sympy] Re: recursice call to cse and symbols

2012-05-01 Thread smichr
On Tuesday, May 1, 2012 1:03:37 AM UTC+5:45, Aaron Meurer wrote: > > Based on Chris's previous examples, it looks like you can just create > a numbered_symbols generator from the start and pass that in each > time. Because it is a generator, it will keep track of the symbols > count as long as