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

adding quadratic terms&constraints #26

Closed
ywaki-econ opened this issue Sep 20, 2014 · 2 comments
Closed

adding quadratic terms&constraints #26

ywaki-econ opened this issue Sep 20, 2014 · 2 comments

Comments

@ywaki-econ
Copy link

Hi,
I'm running Julia 0.2.1 (64bit) on mac.
When I call test/qp_01.jl (also qp_02.jl), I got the following error message:

ERROR: access to undefined reference
in unsafe_copy! at array.jl:135
in copy! at array.jl:51
in getindex at array.jl:296
in splice! at array.jl:814
in splice! at array.jl:807
in - at sparse/sparsematrix.jl:498
in - at sparse/sparsematrix.jl:407
in add_qpterms! at /Users/yuichirowaki/.julia/CPLEX/src/cpx_quad.jl:11
in add_qpterms! at /Users/yuichirowaki/.julia/CPLEX/src/cpx_quad.jl:37
in include at boot.jl:238
in include_from_node1 at loading.jl:114
in process_options at client.jl:303
in _start at client.jl:389
at /Users/yuichirowaki/.julia/CPLEX/test/qp_01.jl:19

This was solved by changing the line 10 in src/cpx_quad.jl from
Q = Q + Q' - spdiagm(diag(Q))
to
Q = Q + Q' - spdiagm(convert(Array{Cdouble},diag(Q)))

It seems, when applied to a sparse matrix, diag returns an array of type ANY and this was causing the problem.

@mlubin
Copy link
Member

mlubin commented Sep 22, 2014

Hi @ywaki. Julia 0.2.1 is no longer being supported. Do you encounter the same issue on Julia 0.3.0?

@ywaki-econ
Copy link
Author

Hi @mlubin, I just tried Julia 0.3.0, and it worked fine. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants