spielwiese
Last change
on this file since 3c473c 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:
810 bytes
|
Line | |
---|
1 | ring r=0,(x,y,z),lp; |
---|
2 | timer=1; |
---|
3 | LIB("python_module.so"); |
---|
4 | Python_module::python("from Singular import Number, Polynomial, Ideal, gen, Module |
---|
5 | i=Ideal() |
---|
6 | zero=Number(0) |
---|
7 | one=Number(1) |
---|
8 | zerop=Polynomial(0) |
---|
9 | i.append(zerop) |
---|
10 | print len(i) |
---|
11 | onep=Polynomial(1) |
---|
12 | i.append(onep) |
---|
13 | print len(i) |
---|
14 | for p in i: |
---|
15 | print p |
---|
16 | print i |
---|
17 | xy=Polynomial('xy') |
---|
18 | print xy |
---|
19 | comp=Polynomial('xy+1') |
---|
20 | print comp |
---|
21 | #the same as only monomials are build |
---|
22 | |
---|
23 | z=Polynomial(xy); |
---|
24 | z*=Number(3); |
---|
25 | print z,xy |
---|
26 | print xy+Number(1) |
---|
27 | print z+xy |
---|
28 | print z,xy |
---|
29 | print xy*xy |
---|
30 | print xy |
---|
31 | for t in ((xy+Number(1))*(xy+Number(-1))): |
---|
32 | print t,-t,t |
---|
33 | import util |
---|
34 | r=util.create_ring(char=0,nvars=3, varNames=['t','u','v','w'], ordering='lp', register=locals()) |
---|
35 | r.set() |
---|
36 | m=Module() |
---|
37 | m.append(t*u*gen(1)+v*gen(2)) |
---|
38 | m.append(w*gen(4)) |
---|
39 | m.append(v*u*gen(3)) |
---|
40 | print m |
---|
41 | print m[1:] |
---|
42 | del m[1] |
---|
43 | print m |
---|
44 | "); |
---|
45 | $ |
---|
Note: See
TracBrowser
for help on using the repository browser.