[SciPy-user] openopt vs. cvxopt, 'f' vs. 'd','z'
Tue Jan 29 08:12:41 CST 2008
I haven't understood all that you've written in your messages, however,
I guess sending the code to me could be helpful. However, I use CVXOPT
0.9, and I haven't any problems with CVXOPT QP solver (despite I had
never used CVXOPT 0.8.x).
On the other hand, fixing the bug is more up to numpy-cvxopt binding,
not OpenOpt-CVXOPT: doing only latter will not suppress the bug
coplitely, sometimes others will encounter the one as well.
So, I guess it's better either for you to control more thoroughly your
fortran<->numpy<->CVXOPT matrix conversions, or for numpy developers to
fix the one.
Mclean Edwards wrote:
> There seems to be a problem with openopt/cvxopt working together.
> I am using double ('d') for my cvxopt.base.matrix matrices, and so the
> line 27 in QP.py:
> kwargs[fn] = asarray(kwargs[fn], float)
> caused the program to crash since it tried to treat the double values as
> floating point.
> Removing the 'float' and recompiling led to
> 'Array not contiguous' error.
> I admit I'm not too such what this means exactly, and was only able to
> discover that arrays can be ordered in a contiguous fashion or in a
> FORTRAN fashion.
> Replacing the above line (27 in QP.py in Rev 166) with:
> kwargs[fn] = asarray(kwargs[fn], order='C')
> fixes this problem (by forcing the new array to be contiguous).
> However errors eventually occur with the other
> values, so the for loop initial line (25) needed to be changed to:
> for fn in ('H', 'f', 'A', 'b', 'Aeq', 'beq', 'lb', 'ub'):
> Recompiling openopt with these changes
> results in no more errors in my code.
> I have not tested this for matrix(*, 'z') formats,
> but it seems to work for the standard floating point format.
> I do not understand the note:
> #TODO: handle the case in runProbSolver()
> but perhaps the original reason for casting to float has now disappeared
> with more recent changes to runProbSolver().
> (I am running off of Subversion's most recent code base.)
> I am running cvxopt version 0.8.1 (there is a problem with the QP solver
> in the most recent version 0.9.2).
> SciPy-user mailing list
More information about the SciPy-user