File:  [CENS] / python / pyGiNaC / test / expair.tst
Revision 1.3: 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: expair.tst,v 1.3 2001-03-15 13:48:35 pearu Exp $
# Pearu Peterson

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

isinstance(expair(),expair) :: 1
isinstance(expair(expair()),expair) :: 1
isinstance(expair(ex(),ex()),expair) :: 1
isinstance(expair(),basic) :: 0
isinstance(expair(),ex) :: 0

expair().printraw() :: expair(ex(numeric(0)),ex(numeric(1)))
expair(expair()).printraw() :: expair(ex(numeric(0)),ex(numeric(1)))
expair(expair(ex(),ex())).printraw() :: expair(ex(numeric(0)),ex(numeric(0)))
expair(expair(ex(symbol("i")),ex(symbol("a")))).printraw().split('serial')[0] :: expair(ex(symbol(name=i,#serial=0,hash=1075577072,flags=7)),ex(symbol(name=a,serial=1,hash=1075577072,flags=7)))

expair().is_equal(expair()) :: 1
expair().is_equal(expair(ex(),ex())) :: 0
expair().is_equal(expair(ex(),ex(symbol("a")))) :: 0
sym_a = symbol("a")
expair(ex(),ex(sym_a)).is_equal(expair(ex(),ex(sym_a))) :: 1
expair(ex(numeric("7")),ex(sym_a)).is_equal(expair(ex(numeric("7")),ex(sym_a))) :: 1

expair().is_less(expair()) :: 0
expair().is_less(expair(ex(),ex())) :: 0
expair().is_less(expair(ex(),ex(numeric("7")))) :: 1
expair().is_less(expair(ex(),ex(symbol("a")))) :: 0
expair(ex(),ex(symbol("a"))).is_less(expair()) :: 1

expair().compare(expair()) :: 0
expair().compare(expair(ex(),ex())) :: 1
expair(ex(),ex()).compare(expair()) :: -1

expair().compare(expair(ex(symbol("a")),ex())) :: 1
expair().compare(expair(ex(),ex(symbol("a")))) :: 1
expair().compare(expair(ex(symbol("a")),ex(numeric("7")))) :: 1

expair().is_canonical_numeric() :: 1
expair(ex(),ex()).is_canonical_numeric() :: 0
expair(ex(),ex(numeric("2"))).is_canonical_numeric() :: 0
expair(ex(numeric("8")),ex(numeric("1"))).is_canonical_numeric() :: 1
expair(ex(symbol("i")),ex(numeric("1"))).is_canonical_numeric() :: 0

exp_a = expair(ex(symbol("a")),ex(symbol("b")))
exp_a.rest.print_(0) :: a
exp_a.coeff.print_(0) :: b
setattr(exp_a,"rest",ex(symbol("c"))) :: None
exp_a.rest.print_(0) :: c
exp_a.coeff.print_(0) :: b
setattr(exp_a,"coeff",ex(symbol("d"))) :: None
exp_a.coeff.print_(0) :: d

str(exp_a).split('serial')[0] :: expair(ex(symbol(name=c,#serial=12,hash=1075663488,flags=7)),ex(symbol(name=d,serial=13,hash=1344966046,flags=7)))

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