File:  [CENS] / python / pyGiNaC / test / exvector.tst
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Sun Mar 11 23:07:20 2001 UTC (16 years, 8 months ago) by pearu
Branches: MAIN
CVS tags: HEAD
Wrapped e?vector, expair, exlist

#
# $Id: exvector.tst,v 1.1 2001-03-11 23:07:20 pearu Exp $
# Pearu Peterson

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

isinstance(exvector(),exvector) :: 1
isinstance(exvector(4),exvector) :: 1
isinstance(exvector((ex(4),ex(5))),exvector) :: 1
isinstance(exvector((ex(4),ex())),exvector) :: 1
isinstance(exvector(),basic) :: 0
isinstance(exvector(),ex) :: 0

len(exvector()) :: 0
len(exvector(5)) :: 5
len(exvector((ex(4),ex(5)))) :: 2
#len(exvector([ex(4),ex(5)])) :: 2

ev = exvector((ex(),ex(symbol("a"))))

ev[0].print_(0) :: 0
ev[1].print_(0) :: a
ev[2].print_(0) :: IndexError,2

!ev[0] = ex(symbol("i")) :: 
ev[0].print_(0) :: i
!ev[3] = ex(symbol("j")) :: IndexError,3
!del ev[4] :: IndexError,4
len(ev) :: 2
!del ev[0] ::
len(ev) :: 1
ev[0].print_(0) :: a

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