Re: [sympy] should we allow using implicit imports?

2008-06-15 Thread Kirill Smelkov
On Tue, May 27, 2008 at 10:53:23PM +0200, Ondrej Certik wrote: > > Hi, > > I think we should know allow using implicit imports in the sympy code > as I think it only makes debugging harder because you don't know where > the symbols are comming from. > We discussed this on the mpmath mailinglist:

[sympy] Re: sympify and matrices

2008-06-15 Thread Ondrej Certik
On Mon, Jun 9, 2008 at 11:34 AM, Robert Cimrman <[EMAIL PROTECTED]> wrote: > Ondrej Certik wrote: >>> >>> Disadvantage -- if one needs to set entries of a Matrix using the >>> syntax "A[1, 2] = y" not only at the beginning of the calculaton, but >>> also in the middle, then he would have to do: A

[sympy] generic matrices subs

2008-06-15 Thread goric
Hello, here is a tiny patch to generalize Matrix.subs() with a working test. diff -r 55980b35927e sympy/matrices/matrices.py --- a/sympy/matrices/matrices.pySat Jun 14 21:09:27 2008 +0200 +++ b/sympy/matrices/matrices.pySun Jun 15 18:44:16 2008 +0200 @@ -251,9 +251,9 @@ o

[sympy] Re: generic matrices subs

2008-06-15 Thread Ondrej Certik
Hi Riccardo! On Sun, Jun 15, 2008 at 6:54 PM, goric <[EMAIL PROTECTED]> wrote: > > Hello, > here is a tiny patch to generalize Matrix.subs() with a working test. > > diff -r 55980b35927e sympy/matrices/matrices.py > --- a/sympy/matrices/matrices.pySat Jun 14 21:09:27 2008 +0200 > +++ b/sy

[sympy] Re: Identifying repeated subexpressions in systems of equations

2008-06-15 Thread Luke
Ondrej, I know that Sympy has the capability to do symbolic replacement like you described. I guess what I'm looking for is more an algorithm to help identify and automatically collect common subexpressions so that repeated quantities are only calculated once. For each repeated subexpression i

[sympy] Re: Identifying repeated subexpressions in systems of equations

2008-06-15 Thread Ondrej Certik
Hi Luke, On Sun, Jun 15, 2008 at 9:00 PM, Luke <[EMAIL PROTECTED]> wrote: > > Ondrej, > I know that Sympy has the capability to do symbolic replacement like > you described. I guess what I'm looking for is more an algorithm to > help identify and automatically collect common subexpressions so t

[sympy] Re: Identifying repeated subexpressions in systems of equations

2008-06-15 Thread Robert Kern
On Sun, Jun 15, 2008 at 16:11, Ondrej Certik <[EMAIL PROTECTED]> wrote: > > Hi Luke, > > On Sun, Jun 15, 2008 at 9:00 PM, Luke <[EMAIL PROTECTED]> wrote: >> >> Ondrej, >> I know that Sympy has the capability to do symbolic replacement like >> you described. I guess what I'm looking for is more a

[sympy] Re: Identifying repeated subexpressions in systems of equations

2008-06-15 Thread Robert Kern
On Sun, Jun 15, 2008 at 16:11, Ondrej Certik <[EMAIL PROTECTED]> wrote: > I don't understand which criteria you use to substitute the > subexpressions --- the most frequent subexpression? Here's some help I got a long time ago when I asked about how to do this with Python ASTs. I never followed u

[sympy] Re: Identifying repeated subexpressions in systems of equations

2008-06-15 Thread Ondrej Certik
On Mon, Jun 16, 2008 at 12:10 AM, Robert Kern <[EMAIL PROTECTED]> wrote: > > On Sun, Jun 15, 2008 at 16:11, Ondrej Certik <[EMAIL PROTECTED]> wrote: >> >> Hi Luke, >> >> On Sun, Jun 15, 2008 at 9:00 PM, Luke <[EMAIL PROTECTED]> wrote: >>> >>> Ondrej, >>> I know that Sympy has the capability to do

[sympy] roadmap to SymPy 1.0

2008-06-15 Thread Ondrej Certik
Hi, I started making a roadmap for SymPy 1.0 here: http://wiki.sympy.org/wiki/Plan_for_SymPy_1.0 Are there some features missing, or something not necessary? I am not talking about some specific CAS features in there, those can be added anytime anyone is interested and writes a patch. I am just

[sympy] Re: Identifying repeated subexpressions in systems of equations

2008-06-15 Thread Robert Kern
On Sun, Jun 15, 2008 at 17:46, Ondrej Certik <[EMAIL PROTECTED]> wrote: > > On Mon, Jun 16, 2008 at 12:10 AM, Robert Kern <[EMAIL PROTECTED]> wrote: >> Actually, that example is not relevant since there is no repeated >> subexpression. The idea is to reduce the amount of unnecessarily >> repeated

[sympy] Re: Identifying repeated subexpressions in systems of equations

2008-06-15 Thread Friedrich Hagedorn
On Sun, Jun 15, 2008 at 12:00:54PM -0700, Luke wrote: > > I guess what I'm looking for is more an algorithm to > help identify and automatically collect common subexpressions so that > repeated quantities are only calculated once. For each repeated > subexpression in an equation, an intermediate

[sympy] Re: Identifying repeated subexpressions in systems of equations

2008-06-15 Thread Robert Kern
On Sun, Jun 15, 2008 at 17:46, Ondrej Certik <[EMAIL PROTECTED]> wrote: > Anyway, I created an issue for this: > > http://code.google.com/p/sympy/issues/detail?id=891 I've attached some nominally working code to the issue. Playing with it, I see some suboptimal results. First, it's quadratic, but