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

RipQP is failing #172

Open
abelsiqueira opened this issue Jul 6, 2024 · 1 comment
Open

RipQP is failing #172

abelsiqueira opened this issue Jul 6, 2024 · 1 comment

Comments

@abelsiqueira
Copy link
Member

Maybe it's RipQP's fault, but we have it on the docs.

julia> using JSOSuite, RipQP
julia> minimize("RipQP", ones(2), [4.0 1.0; 1.0 2.0])
ERROR: ArgumentError: Invalid buffers for SparseMatrixCSC construction n=2, colptr=3-element Vector{Int64}, rowval=4-element Vector{Int64}, nzval=4-element Vector{Float64}
Stacktrace:
  [1] SparseArrays.SparseMatrixCSC{Float64, Int64}(m::Int64, n::Int64, colptr::Vector{Int64}, rowval::Vector{Int64}, nzval::Vector{Float64})
    @ SparseArrays ~/.julia/juliaup/julia-1.10.4+0.x64.linux.gnu/share/julia/stdlib/v1.10/SparseArrays/src/sparsematrix.jl:29
  [2] create_K2(id::RipQP.QM_IntData, D::Vector{…}, Q::SparseArrays.SparseMatrixCSC{…}, A::SparseArrays.SparseMatrixCSC{…}, diag_Q::SparseArrays.SparseVector{…}, regu::RipQP.Regularization{…}, uplo::Symbol, ::Type{…})
    @ RipQP ~/.julia/packages/RipQP/H6krR/src/iterations/solvers/augmented/K2LDL.jl:388
  [3] get_K2_matrixdata
    @ ~/.julia/packages/RipQP/H6krR/src/iterations/solvers/augmented/K2LDL.jl:461 [inlined]
  [4] PreallocatedData(sp::K2LDLParams{…}, fd::RipQP.QM_FloatData{…}, id::RipQP.QM_IntData, itd::RipQP.IterDataCPU{…}, pt::RipQP.Point{…}, iconf::RipQP.InputConfig{…})
    @ RipQP ~/.julia/packages/RipQP/H6krR/src/iterations/solvers/augmented/K2LDL.jl:95
  [5] RipQP.RipQPMonoSolver(QM::QuadraticModels.PresolvedQuadraticModel{…}; itol::InputTol{…}, scaling::Bool, normalize_rtol::Bool, kc::Int64, perturb::Bool, mode::Symbol, ap::RipQP.RipQPMonoParameters{…}, history::Bool, w::SystemW
rite, display::Bool)
    @ RipQP ~/.julia/packages/RipQP/H6krR/src/mono_solver.jl:40
  [6] RipQPMonoSolver
    @ ~/.julia/packages/RipQP/H6krR/src/mono_solver.jl:9 [inlined]
  [7] #RipQPSolver#168
    @ ~/.julia/packages/RipQP/H6krR/src/mono_solver.jl:6 [inlined]
  [8] ripqp(QM::QuadraticModels.QuadraticModel{…}, ap::RipQP.RipQPMonoParameters{…}; ps::Bool, scaling::Bool, history::Bool, display::Bool, kwargs::@Kwargs{…})
    @ RipQP ~/.julia/packages/RipQP/H6krR/src/RipQP.jl:69
  [9] ripqp
    @ ~/.julia/packages/RipQP/H6krR/src/RipQP.jl:47 [inlined]
 [10] ripqp(QM::QuadraticModels.QuadraticModel{…}; mode::Symbol, sp::K2LDLParams{…}, sp2::Nothing, sp3::Nothing, solve_method::PC, solve_method2::Nothing, solve_method3::Nothing, kwargs::@Kwargs{…})
    @ RipQP ~/.julia/packages/RipQP/H6krR/src/RipQP.jl:156
 [11] minimize(::Val{:RipQP}, nlp::QuadraticModels.QuadraticModel{Float64, Vector{Float64}, Matrix{Float64}, Matrix{Float64}}; max_iter::Int64, max_time::Float64, kwargs::@Kwargs{})
    @ JSOSuite ~/.julia/packages/JSOSuite/itKIP/src/solvers/ripqp_solve.jl:61
 [12] minimize
    @ ~/.julia/packages/JSOSuite/itKIP/src/solvers/ripqp_solve.jl:1 [inlined]
 [13] minimize(solver_name::String, nlp::QuadraticModels.QuadraticModel{Float64, Vector{Float64}, Matrix{Float64}, Matrix{Float64}}; kwargs::@Kwargs{})
    @ JSOSuite ~/.julia/packages/JSOSuite/itKIP/src/solve.jl:44
 [14] minimize
    @ ~/.julia/packages/JSOSuite/itKIP/src/solve.jl:38 [inlined]
 [15] #minimize#16
    @ ~/.julia/packages/JSOSuite/itKIP/src/solve-model.jl:249 [inlined]
 [16] minimize(solver_name::String, c::Vector{Float64}, args::Matrix{Float64})
    @ JSOSuite ~/.julia/packages/JSOSuite/itKIP/src/solve-model.jl:239
 [17] top-level scope
    @ REPL[6]:1
@dpo
Copy link
Member

dpo commented Jul 6, 2024

The QuadraticModels documentation states that only the lower triangle of H should be given. This works:

julia> minimize("RipQP", ones(2), [4.0 0.0; 1.0 2.0])

[ Info: Solving in Float64 using K2LDL with LDLFactorizationData
[ Info:   iter       obj      rgap      ‖rb‖      ‖rc‖     α_pri      α_du         μ         ρ         δ
[ Info:      0   0.0e+00   0.0e+00   0.0e+00   7.1e-01   0.0e+00   0.0e+00       NaN   1.5e-03   1.5e-03
[ Info:      1  -2.9e-01   5.2e-04   0.0e+00   9.0e-04   1.0e+00   1.0e+00       NaN   1.5e-03   1.5e-03
[ Info:      2  -2.9e-01   6.4e-08   0.0e+00   1.3e-07   1.0e+00   1.0e+00       NaN   1.5e-04   1.5e-04
[ Info:      3  -2.9e-01   8.7e-13   0.0e+00   2.1e-12   1.0e+00   1.0e+00       NaN   1.5e-05   1.5e-05
"Execution stats: first-order stationary"

However, there is clearly a lot of room for improvements here, in QuadraticModels, RipQP and JSOSuite.

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

2 participants