Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dual not supported #123

Open
eXcuvator opened this issue Sep 18, 2017 · 0 comments
Open

Dual not supported #123

eXcuvator opened this issue Sep 18, 2017 · 0 comments

Comments

@eXcuvator
Copy link

I'm cross posting an issue I have when using pyjulia with PATHSolver
.

I can't pass over a lambda function (this appears to be a PATHSolver issue)

In [1]: import julia
In [2]: j = julia.Julia()
In [3]: j.sind(10)  #works as planned
Out[3]: 0.17364817766693036 
In [8]: j.using("PATHSolver")
In [9]: M = np.array([[0, 0, -1, -1], [0, 0, 1, -2], [1, -1, 2, -2], [1, 2, -2, 4]])
In [12]: q = np.array([2, 2, -2, -6])
In [13]: myf = lambda x: M*x + q
In [14]: lb = np.zeros((4,))
In [15]: ub = 100*np.ones((4,))
In [16]: j.solveMCP(myf, lb, ub)
RuntimeError: Julia exception: MethodError(PATHSolver.solveMCP,(PyObject <function <lambda> at 0x7f6a70eeb048>,[0.0,0.0,0.0,0.0],[100.0,100.0,100.0,100.0]))

Workaround doesn't work either (this appears to be a pyjulia issue?)

fwrap = j.eval('f -> (args...) -> f(args...)')
In [20]: j.solveMCP(fwrap(myf), lb, ub)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-20-05aae9205059> in <module>()
----> 1 j.solveMCP(fwrap(myf), lb, ub)

RuntimeError: Julia exception: MethodError(convert,(Float64,Dual(0.0,1.0,0.0,0.0,0.0)))
@tkf tkf changed the title MethodError Dual not supported Nov 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant