File:  [CENS] / python / pyGiNaC / test / class.tst
Revision 1.3: download - view: text, annotated - select for diffs - revision graph
Tue Mar 13 06:38:39 2001 UTC (16 years, 8 months ago) by pearu
Branches: MAIN
CVS tags: HEAD
Got add(vxvector()) to work

#
# $Id: class.tst,v 1.3 2001-03-13 06:38:39 pearu Exp $
# Pearu Peterson

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

#-----------------------------------------------------
# Test constructors and inheritance
#-----------------------------------------------------
isinstance(basic(),basic)		:: 1
isinstance(basic(basic()),basic)	:: 1
isinstance(basic(symbol()),basic)	:: 1
isinstance(basic(numeric(4,3)),basic)	:: 1
isinstance(basic(),ex)		:: 0

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


isinstance(symbol(),symbol):: 1
isinstance(symbol(symbol()),symbol):: 1
isinstance(symbol("foo"),symbol):: 1
isinstance(symbol(),basic):: 1
isinstance(symbol(),ex):: 0
isinstance(symbol(),numeric):: 0

#isinstance(constant("bar",numeric("4")),basic) :: 1
#isinstance(constant("bar",numeric("4")),numeric) :: 0
#isinstance(constant("bar",numeric("4")),constant) :: 1

#isinstance(lst(ex()),lst) :: 1
#isinstance(lst(ex()),basic) :: 1
#isinstance(lst(ex()),ex) :: 0

#isinstance(exprseq(ex()),exprseq) :: 1
#isinstance(exprseq(ex()),basic) :: 1
#isinstance(exprseq(ex()),ex) :: 0

#isinstance(function(0),function) :: 1
#isinstance(function(0,ex()),function) :: 1
#isinstance(function(0),exprseq) :: 1
#isinstance(function(0),basic) :: 1
#isinstance(function(0),ex) :: 0

#isinstance(ncmul(ex(),ex()),ncmul) :: 1
#isinstance(ncmul(ex(),ex(),ex(),ex(),ex(),ex()),ncmul) :: 1
#isinstance(ncmul(ex(),ex()),exprseq) :: 1
#isinstance(ncmul(ex(),ex()),basic) :: 1
#isinstance(ncmul(ex(),ex()),ex) :: 0

#isinstance(indexed(ex()),indexed) :: 1
#isinstance(indexed(ex()),exprseq) :: 1
#isinstance(indexed(ex()),basic) :: 1
#isinstance(indexed(ex()),ex) :: 0
#isinstance(indexed(ex(),ex(),ex(),ex()),indexed) :: 1


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

isinstance(mul(ex(),ex()),mul) :: 1
isinstance(mul(ex(),ex()),expairseq) :: 1
isinstance(mul(ex(),ex()),basic) :: 1
isinstance(mul(ex(),ex()),ex) :: 0

isinstance(add(ex(),ex()),add) :: 1
isinstance(add(ex(),ex()),expairseq) :: 1
isinstance(add(ex(),ex()),basic) :: 1
isinstance(add(ex(),ex()),ex) :: 0
isinstance(add(ex(),ex()),mul) :: 0

#isinstance(matrix(1,1),matrix) :: 1
#isinstance(matrix(1,1),basic) :: 1
#isinstance(matrix(1,1),ex) :: 0

#isinstance(power(ex(),numeric("3")),power) :: 1
#isinstance(power(ex(),numeric("3")),basic) :: 1

#isinstance(idx(ex(),ex(numeric("1"))),idx) :: 1
#isinstance(idx(ex(),ex(numeric("1"))),basic) :: 1
#isinstance(idx(ex(),ex(numeric("1"))),ex) :: 0
#isinstance(varidx(ex(),ex(numeric("1")),0),varidx) :: 1
#isinstance(varidx(ex(),ex(numeric("1")),0),idx) :: 1
#isinstance(varidx(ex(),ex(numeric("1")),0),basic) :: 1
#isinstance(varidx(ex(),ex(numeric("1")),0),ex) :: 0
#isinstance(varidx(ex(),ex(numeric("1")),0),symbol) :: 0

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