1 | ring r=0,(x,y,z,a,b),lp; |
---|
2 | poly f=37x3y+x2yz; |
---|
3 | ideal i=x*(x-1),y; |
---|
4 | LIB "primdec.lib"; |
---|
5 | //LIB "poly.lib"; |
---|
6 | ideal p1=x2,y; |
---|
7 | ideal p2=(x-1),(y-5)^2; |
---|
8 | ideal p3=(x)^2; |
---|
9 | ideal big=intersect(intersect(p1,p2),p3); |
---|
10 | ideal i2=cyclic(5); |
---|
11 | |
---|
12 | print(i2); |
---|
13 | LIB("/Users/michael/sing2/modules/python/python_module.so"); |
---|
14 | Python_module::python("from interpreter import SingularGlobalsProxy |
---|
15 | #import psyco |
---|
16 | import sys |
---|
17 | sys.argv=['Singular'] |
---|
18 | #import sre_compile |
---|
19 | #psyco.bind(sre_compile._optimize_charset) |
---|
20 | #psyco.log() |
---|
21 | #psyco.profile() |
---|
22 | from cas.singular import * |
---|
23 | from context import * |
---|
24 | context=Context() |
---|
25 | from lxmlencoder import encode as xml |
---|
26 | |
---|
27 | import cd.polyd as polyd |
---|
28 | import cd.fieldname1 as fieldname1 |
---|
29 | import cas.singular |
---|
30 | import cd.list1 |
---|
31 | import cd.primdec |
---|
32 | context.addCDImplementation(cd.list1.implementation) |
---|
33 | context.addCDImplementation(cd.primdec.implementation) |
---|
34 | context.addCDImplementation(polyd.implementation) |
---|
35 | context.addCDImplementation(fieldname1.implementation) |
---|
36 | from cd.polyd import groebnersym |
---|
37 | r=singular.r |
---|
38 | inter=SingularGlobalsProxy() |
---|
39 | |
---|
40 | |
---|
41 | |
---|
42 | easy=ideal2OM(singular.i) |
---|
43 | call=OMA(cd.primdec.implementation.minAss, [easy]) |
---|
44 | print call |
---|
45 | print context.evaluate(call) |
---|
46 | r.set() |
---|
47 | |
---|
48 | |
---|
49 | easy=ideal2OM(singular.i) |
---|
50 | call=OMA(cd.primdec.implementation.primdecGTZ, [easy]) |
---|
51 | print call |
---|
52 | print context.evaluate(call) |
---|
53 | r.set() |
---|
54 | |
---|
55 | |
---|
56 | easy=ideal2OM(singular.i) |
---|
57 | call=OMA(cd.primdec.implementation.minAssGTZ, [ideal2OM(singular.big)]) |
---|
58 | print call |
---|
59 | #print encode(call) |
---|
60 | print context.evaluate(call) |
---|
61 | print |
---|
62 | print |
---|
63 | out=open('blupper','w') |
---|
64 | xml(context.evaluate(call)).write(out) |
---|
65 | out.close() |
---|
66 | print 'ARG' |
---|
67 | r.set() |
---|
68 | |
---|
69 | easy=ideal2OM(singular.i) |
---|
70 | call=OMA(cd.primdec.implementation.primdecGTZ, [ideal2OM(singular.big)]) |
---|
71 | print call |
---|
72 | #print lxmlencoder.encode(call).tostring |
---|
73 | xml(context.evaluate(call)).write(open('primdec.in', 'w')) |
---|
74 | print context.evaluate(call) |
---|
75 | r.set() |
---|
76 | cyc5=ideal2OM(singular.i2) |
---|
77 | ord=ordering2OM(singular.r) |
---|
78 | gcall=OMA(groebnersym,[ord,cyc5]) |
---|
79 | |
---|
80 | |
---|
81 | print gcall |
---|
82 | |
---|
83 | def myblock(i): |
---|
84 | out=open('blipper'+str(i),'w') |
---|
85 | xml(context.evaluate(gcall)).write(out) |
---|
86 | out.close() |
---|
87 | r.set() |
---|
88 | |
---|
89 | for i in range(20): |
---|
90 | myblock(i) |
---|
91 | #from timeit import Timer |
---|
92 | |
---|
93 | #print 'Timing:', t.timeit(1) |
---|
94 | #gcout=open('cyc3om','w') |
---|
95 | #gcout.write(context.XMLEncodeObject(gcall)) |
---|
96 | #gcout.close() |
---|
97 | |
---|
98 | #print 'now calculating GB' |
---|
99 | #omin=context.XMLEncodeObject(gcall) |
---|
100 | #from omxmlreader import * |
---|
101 | def inout(context, infn): |
---|
102 | doc=readFile(infn) |
---|
103 | builder=OMFromXMLBuilder() |
---|
104 | doc=builder.build(doc) |
---|
105 | doc=context.evaluate(doc) |
---|
106 | output=context.XMLEncodeObject(doc) |
---|
107 | gcout=open('cyc3om.out','w') |
---|
108 | gcout.write(output) |
---|
109 | gcout.close() |
---|
110 | |
---|
111 | #inout(context,'cyc3om') |
---|
112 | |
---|
113 | |
---|
114 | "); |
---|
115 | $ |
---|