Hi, I don't have much time, and didn't read this carefully or test anything. However, my first thought is that you are incorrectly mixing the libsingular C++ library interface (sage.libs.singular) with the singular pexpect interface (just "singular" from the command line). These are two completely different things. You should do everything using the singular pexpect interface, unless you have some reason to use the library interface. E.g., only use "singular", "singular.eval", "singular.load", etc...
William On Mon, Apr 26, 2010 at 8:12 AM, Andrea Gobbi <[email protected]> wrote: > Hi! > I try to find out a solution by myself, but without result. > I have to call a singular function (vanishId) in the library > decodegb.lib. I write: > > from sage.libs.singular.function import singular_function > from sage.libs.singular.function import lib as singular_lib > singular_lib('decodegb.lib') > singular_lib('matrix.lib') > > vanish = singular_function('vanishId'); > R=PolynomialRing(GF(11),['x%s'%p for p in range(0,17)],'degrevlex'); > x=R.gens(); > > .. > the main program write in sage > .. > > I have a list of lists, called points, and i eliminate duplicates > here: > > provv=list(); > > for i in range(0,m-1): > cont=0; > for j in range(i+1,m-1): > if points[j]==points[i]: > j=m-1; > cont=1; > if cont==0: > provv.append(points[i]); > > Now i have to convert sage list of lists into singular list of columns > vectors ( because vanishId takes a list of columns vectors) > > presing=list(); > for i in range (0,len(provv)): > presing.append(singular.matrix(1,17,provv[i])); > > > I set the ring to use ( also if i have declarated it before) > > Rid = singular.ring(0, '(x(0..12))', 'dp') > > I use it > > Rid.set_ring(); > > I call the function > > id=vanish(presing); > > > Traceback (click to the left of this block for traceback) > ... > ValueError: Could not detect ring. > > Traceback (most recent call last): R=PolynomialRing(GF(11),['x%s'%p > for p in range(0,17)],'degrevlex'); > File "", line 1, in <module> > > File "/tmp/tmpJ3mx02/___code___.py", line 138, in <module> > Rid.set_ring();id=vanish(presing); > File "", line 1, in <module> > > File "function.pyx", line 1000, in > sage.libs.singular.function.SingularFunction.__call__ (sage/libs/ > singular/function.cpp:9581) > File "function.pyx", line 1092, in > sage.libs.singular.function.SingularFunction.common_ring (sage/libs/ > singular/function.cpp:10067) > File "function.pyx", line 1109, in > sage.libs.singular.function.SingularFunction.common_ring (sage/libs/ > singular/function.cpp:10289) > ValueError: Could not detect ring. > > If i try to call vanishId like this: > > > id=vanish(presing,ring=R); > > > raceback (most recent call last): R=PolynomialRing(GF(11),['x%s'%p > for p in range(0,17)],'degrevlex'); > File "", line 1, in <module> > > File "/tmp/tmpO_XUc7/___code___.py", line 139, in <module> > id=vanish(presing,ring=R); > File "", line 1, in <module> > > File "function.pyx", line 1003, in > sage.libs.singular.function.SingularFunction.__call__ (sage/libs/ > singular/function.cpp:9645) > File "function.pyx", line 1155, in > sage.libs.singular.function.call_function (sage/libs/singular/ > function.cpp:10617) > File "function.pyx", line 348, in > sage.libs.singular.function.Converter.__init__ (sage/libs/singular/ > function.cpp:4645) > File "function.pyx", line 642, in > sage.libs.singular.function.Converter.append_list (sage/libs/singular/ > function.cpp:7330) > File "function.pyx", line 368, in > sage.libs.singular.function.Converter.__init__ (sage/libs/singular/ > function.cpp:4877) > TypeError: unknown argument type '<class > 'sage.interfaces.singular.SingularElement'>' > > If i set the ring in "id=vanish(presing,ring=R);" like a singular ring > i recive: > > TypeError: Argument 'ring' has incorrect type (expected > sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular, > got SingularElement) > > I try everything! If someone know the truth post it!!! > Thanks > Best regards! > Andrea > > -- > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/sage-support > URL: http://www.sagemath.org > -- William Stein Professor of Mathematics University of Washington http://wstein.org -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
