File:  [CENS] / python / pyGiNaC / test / ex.tst
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Thu Mar 15 13:48:35 2001 UTC (16 years, 8 months ago) by pearu
Branches: MAIN
CVS tags: HEAD
Major revision, now more explicit wrapping

#
# $Id: ex.tst,v 1.2 2001-03-15 13:48:35 pearu Exp $
# Pearu Peterson

_startup = __import__('__startup__')
module = __import__('GiNaC._ginac',globals(),locals(),['_ginac'])

isinstance(ex(),basic)		:: 0
isinstance(ex(),ex)		:: 1
isinstance(ex(ex()),ex)		:: 1
isinstance(ex(basic()),ex)		:: 1
isinstance(ex(symbol()),ex)		:: 1
isinstance(ex(numeric(-7,14)),ex)		:: 1
isinstance(ex(1),ex)		:: 1
isinstance(ex(3.4),ex)		:: 1
isinstance(ex("1+2",ex()),ex)	:: 1   # XXX: not really working

ex(3).print_(0) :: 3
ex(numeric(3.7)).print_(0)[:3] :: 3.7
ex(3.7).print_(0) :will be!!: 3

ex() :: 0
ex(3.4) :: 3
ex(numeric("3.4")) :: 3.4
ex(symbol("a")) :: a

my_ex = ex(symbol("a"))
my_ex :: a
my_s = symbol("b")
my_ex.swap(ex(my_s)) :: None
my_ex :: b

my_ex.info(0) :: 0
my_ex.nops() :: 0
my_ex.expand(0) :: b
my_ex.has(ex()) :: 0 
my_ex.has(my_ex) :: 1
my_ex.degree(my_ex) :: TypeError,extensionclass'ex'isnotconvertibleinto'symbol'.
my_ex.degree(symbol("b")) :: 0
my_ex.ldegree(symbol("b")) :: 0
my_ex.degree(my_s) :: 1
my_ex.ldegree(my_s) :: 1
my_ex.coeff(my_s,1) :: 1
my_ex.coeff(symbol("b"),1) :: 0
my_ex.lcoeff(my_s) :: 1
my_ex.lcoeff(symbol("b")) :: b
my_ex.tcoeff(my_s) :: 1
my_ex.tcoeff(symbol("a")) :: b
my_ex.numer() :: b
my_ex.denom() :: 1
ex(numeric(3,4)).numer() :: 3
ex(numeric(6,8)).denom() :: 4
my_ex.unit(symbol("cm")) :: 1
my_ex.unit(my_s) :: 1
my_ex.content(symbol("a")) :: b
my_ex.content(my_s) :: 1
my_ex.integer_content() :: 1
my_ex.normal(0) :: b
my_ex.to_rational(lst(my_ex)) :: b
my_ex.to_rational(lst(ex(symbol("a")))) :: b
my_ex.smod(numeric(3,4)) :: b
my_ex.max_coefficient() :: 1
my_ex.collect(my_s) :: b
my_ex.collect(symbol("a")) :: b
my_ex.eval(0) :: b
my_ex.evalf(0) :: b
my_ex.diff(my_s,0) :: b
my_ex.diff(my_s,1) :: 1
my_ex.diff(my_s,2) :: 0
my_ex.diff(symbol("a"),1) :: 0
my_ex.diff(symbol("a"),0) :: b
my_ex.series(my_ex,0,0) :: Order(1)
my_ex.series(my_ex,1,0) :: Order(b)
my_ex.series(my_ex,2,0) :: 1*b
my_ex.series(my_ex,3,0) :: 1*b
my_ex.series(ex(symbol("a")),0,0) :: (b)
my_ex.series(ex(symbol("a")),1,0) :: (b)
my_ex.series(ex(symbol("a")),2,0) :: (b)
len(my_ex.get_free_indices()) :: 0
my_ex.simplify_ncmul(exvector()) :: 1
my_ex.simplify_ncmul(exvector((my_ex,))) :: b
my_ex.simplify_ncmul(exvector((ex(my_s),))) :: b
my_ex.simplify_ncmul(exvector((ex(symbol("a")),))) :: a
my_ex.simplify_ncmul(exvector((ex(symbol("a")),my_ex))) :: a%b
my_ex.op(0) :: RuntimeError,op()outofrange
my_ex.let_op(0) :: RuntimeError,op()outofrange
my_ex.lhs() :SegFault:
my_ex.rhs() :SegFault:
my_ex.compare(my_ex) :: 0
not my_ex.compare(ex()) :: 0
my_ex.is_equal(my_ex) :: 1
my_ex.is_equal(ex(my_s)) :: 1
my_ex.is_equal(ex(symbol("a"))) :: 0
my_ex.is_zero() :: 0
ex().is_zero() :: 1
my_ex.return_type() :: 0
ex().return_type() :: 0
ex(numeric(3,4)).return_type() :: 0
my_ex.return_type_tinfo() :: 131073
ex().return_type_tinfo() :: 589825
my_ex.gethash() > 0:: 1
my_ex.exadd(ex()) :: b
my_ex.exadd(ex(symbol("a"))) :: b+a
my_ex.exadd(my_ex) :: 2*b
my_ex.exadd(my_ex).nops() :: 2
my_ex.exadd(my_ex).op(0) :: b
my_ex.exadd(my_ex).op(1) :: 2
my_ex.exmul(ex()) :: 0
my_ex.exmul(ex(symbol("a"))) :: b*a
my_ex.exmul(my_ex) :: b^2
my_ex.exncmul(ex()) :: 0
my_ex.exncmul(ex(symbol("q"))) :: q * b
my_ex.exncmul(my_ex) :: b^2

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