Differences between revisions 2 and 3
Revision 2 as of 2007-11-11 15:36:50
Size: 1686
Editor: OndrejCertik
Comment:
Revision 3 as of 2008-11-14 13:42:07
Size: 1686
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Things to improve:

  • pattern matching
  • subexpression substitution
  • unifying and especially simplify the way to check the type of an
    • expression. Now you need to do this ugly switch:

def _is(e, what):

  • import operator if what == "Mul":
    • return isinstance(e, sage.calculus.calculus.SymbolicArithmetic) and \

      • e._operator == operator.mul
    if what == "Add":
    • return isinstance(e, sage.calculus.calculus.SymbolicArithmetic) and \

      • e._operator == operator.add
    if what == "Pow":
    • return isinstance(e, sage.calculus.calculus.SymbolicArithmetic) and \

      • e._operator == operator.pow
    if what == "Div":
    • return isinstance(e, sage.calculus.calculus.SymbolicArithmetic) and \

      • e._operator == operator.div
    if what == "log":
    • return isinstance(e, sage.calculus.calculus.SymbolicComposition) and \

      • bool(e._operands[0] == sage.all.log)
    if what == "exp":
    • return isinstance(e, sage.calculus.calculus.SymbolicComposition) and \

      • bool(e._operands[0] == sage.all.exp)
    if what == "Function": elif what == "Rational":
    • return isinstance(e, sage.rings.rational.Rational)
    elif what == "Real":
    • return isinstance(e, sage.rings.real_mpfr.RealNumber)

    else:
    • raise "Sorry, unknown 'class': %s" % what

Those are just things I discovered when trying to port the limits from SymPy to SAGE. Then there are other things, for example:

  • working with unknown functions, expanding them in series, etc.

(there is some trac ticket for that already)

days6/sprint/calculus (last edited 2008-11-14 13:42:07 by localhost)