File:  [CENS] / python / pyGiNaC / test / epvector.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: epvector.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(epvector(),epvector) :: 1
isinstance(epvector(4),epvector) :: 1
isinstance(epvector((expair(),expair())),epvector) :: 1
isinstance(epvector((expair(),expair())),epvector) :: 1
isinstance(epvector(),basic) :: 0
isinstance(epvector(),ex) :: 0

len(epvector()) :: 0
len(epvector(5)) :: 5
len(epvector((expair(),expair()))) :: 2

ev = epvector((expair(),expair(ex(symbol("a")),ex(numeric("7")))))

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

!ev[0] = expair(ex(symbol("i")),ex(symbol("f"))) :: 
ev[0].rest.print_(0) :: i
ev[0].coeff.print_(0) :: f

!ev[3] = expair() :: IndexError,3
!del ev[4] :: IndexError,4
len(ev) :: 2
!del ev[0] ::
len(ev) :: 1
ev[0].rest.print_(0) :: a
ev[0].coeff.print_(0) :: 7

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