source: git/dyn_modules/python/polytester @ 662ece

fieker-DuValspielwiese
Last change on this file since 662ece was 3c473c, checked in by Kai Krüger <krueger@…>, 14 years ago
rename directory modules to dyn_modules anticipating "modules" directory for cmake. git-svn-id: file:///usr/local/Singular/svn/trunk@13033 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 786 bytes
Line 
1//ring s=0,(x,y,z),lp;
2
3ring r=0,(x,y,z),lp;
4timer=1;
5LIB("python_module.so");
6Python_module::python("from Singular import *
7iv=IntVector()
8iv.append(1)
9iv.append(2)
10iv.append(3)
11print Polynomial(iv)
12zero=Number(0)
13one=Number(1)
14zerop=Polynomial(0)
15onep=Polynomial(1)
16
17#deprecated
18xy=Polynomial('xy')
19print xy
20comp=Polynomial('xy+1')
21print comp
22#the same as only monomials are build
23
24z=Polynomial('z');
25z*=Number(3);
26print z,xy
27print xy+Number(1)
28print z+xy
29print z,xy
30print xy*xy
31print xy
32for t in ((xy+Number(1))*(xy+Number(-1))):
33  print t,-t,t
34import util
35r=util.create_ring(char=0,nvars=3, ordering='lp')
36r.set()
37z2=Polynomial('z')
38r=util.create_ring(char=0,nvars=3, varNames=['u','v','w'], ordering='lp', register=locals())
39print u+v*w
40#the following should fail
41#print z+z2
42");
43$
Note: See TracBrowser for help on using the repository browser.