On Feb 16, 7:54 am, Harald Schilly <[email protected]> wrote: > On Feb 16, 5:44 am, William Stein <[email protected]> wrote: > > > sage: import cvxopt > > sage: cvxopt.matrix > > > cvxopt.matrix can happily coexist with sage matrices, numpy matrices, > > maxima matrices, etc. > > Yeahr exactly, but originally that wasn't the real problem. It's just > that cvxopt.matrix doesn't understand Sage's Integer() after > preparsing.
is it only Integer() ? Look at the following* sage: import cvxopt sage: cvxopt.matrix([[1.,2.],[3.,4.]]) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /home/dima/sage/sage-4.3.2/<ipython console> in <module>() TypeError: invalid type in list whereas: sage: preparser(False) sage: import cvxopt sage: cvxopt.matrix([[1.,2.],[3.,4.]]) <2x2 matrix, tc='d'> works as it should. Dima That's why I wrote to the corresponding ticket that one > has to disable the preparser in order to run the cvxopt examples. I > don't consider this a problem. > > Something related I didn't really figure out is the "random" python > package which is overwritten by a function in Sage. cvxopt imports > methods from the random package and well, that obviously doesn't work. > I have seen that there is a Sage random module that does the same, > therefore I've replaced all the broken imports in cvxopt's sources. Is > there a better solution? For me that's a perfect example why > namespaces are necessary .. but i also understand that any serious > math program needs to have a simple "random" function ;) > > H -- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
