File:  [CENS] / python / pyGiNaC / test / test_ginac.py
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Thu Mar 8 13:54:38 2001 UTC (16 years, 8 months ago) by pearu
Branches: MAIN
CVS tags: HEAD
Created ginac stripper


execfile('__startup__.py')

from  GiNaC.ginac import *

print dir()


s = symbol("x")
print 's=',s,s.__class__.__bases__
s2 = symbol('ab')
print 's2=',s2,isinstance(s2,basic),isinstance(s2,symbol)
b = basic(s)
print 'b(s)=',b
s3 = symbol(s)
print 's3(s)=',s3
print s.print_()
print s2.printraw()
print `s.printtree(1)`
print s.printcsrc(0)

e = ex(5)

print "e(5)=",e
print e.print_()
print e.printraw()
print `e.printtree(1)`
print `ex(4.5).printtree(1)`
print 'e.numer=',e.numer().printraw()
print 'e.denom=',e.denom().printraw()

print s.eval(0).printraw()

s = s.eval(0)

e = (s*s*s/e-s+e)
print 'e=',e.print_()

for i in range(e.nops()):
    print 'e.op(%s)='%(i),e.op(i).print_()
print 'diff(e,x,1)=',e.diff(ex_to_symbol(s),1).print_()

print 'ok'


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>