Giter Club home page Giter Club logo

ripqp.jl's Introduction

RipQP

DOI CI Cirrus CI - Base Branch Build Status codecov

A package to optimize linear and quadratic problems in QuadraticModel format (see https://github.com/JuliaSmoothOptimizers/QuadraticModels.jl).

By default, RipQP iterates in the floating-point type of its input QuadraticModel, but it can also perform operations in several floating-point systems if some parameters are modified (see the documentation for more information).

Basic usage

In this example, we use QPSReader to read a quadratic problem (QAFIRO) from the Maros and Meszaros dataset.

using QPSReader, QuadraticModels
using RipQP
qps = readqps("QAFIRO.SIF")
qm = QuadraticModel(qps)
stats = ripqp(qm)

To use the multi precision mode (default to :mono) and change the maximum number of iterations:

stats = ripqp(qm, mode=:multi, itol = InputTol(max_iter=100))

Bug reports and discussions

If you think you found a bug, feel free to open an issue. Focused suggestions and requests can also be opened as issues. Before opening a pull request, start an issue or a discussion on the topic, please.

If you want to ask a question not suited for a bug report, feel free to start a discussion here. This forum is for general discussion about this repository and the JuliaSmoothOptimizers organization, so questions about any of our packages are welcome.

ripqp.jl's People

Contributors

abelsiqueira avatar amontoison avatar dpo avatar geoffroyleconte avatar github-actions[bot] avatar kellertuer avatar monssaftoukal avatar tmigot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ripqp.jl's Issues

Size of solution with LLSModels

using LLSModels, RipQP

A = rand(2,2)
b = rand(2)
nlp = LLSModel(A, b)
stats = ripqp(nlp)
@show length(stats.solution), nlp.meta.nvar

I think we expect the solution to be of the size of the problem.

Solve unconstrained problems

I tried using ripqp for an unconstrained quadratic problem, and it returns an error in the scaling I believe. For instance,

g = ones(3)
Hrows = [1, 2, 3]
Hcols = [1, 2, 3]
Hvals = zeros(3)
using QuadraticModels
nlp = QuadraticModel(g, Hrows, Hcols, Hvals)
using RipQP
ripqp(nlp)

returns

ERROR: ArgumentError: reducing over an empty collection is not allowed
Stacktrace:
  [1] _empty_reduce_error()
    @ Base ./reduce.jl:301
  [2] reduce_empty(op::Function, #unused#::Type{Float64})
    @ Base ./reduce.jl:311
  [3] mapreduce_empty(#unused#::typeof(identity), op::Function, T::Type)
    @ Base ./reduce.jl:345
  [4] reduce_empty(op::Base.MappingRF{typeof(identity), typeof(max)}, #unused#::Type{Float64})
    @ Base ./reduce.jl:331
  [5] reduce_empty_iter
    @ ./reduce.jl:357 [inlined]
  [6] mapreduce_empty_iter(f::Function, op::Function, itr::Vector{Float64}, ItrEltype::Base.HasEltype)
    @ Base ./reduce.jl:353
  [7] _mapreduce(f::typeof(identity), op::typeof(max), #unused#::IndexLinear, A::Vector{Float64})
    @ Base ./reduce.jl:402
  [8] _mapreduce_dim
    @ ./reducedim.jl:330 [inlined]
  [9] #mapreduce#725
    @ ./reducedim.jl:322 [inlined]
 [10] mapreduce
    @ ./reducedim.jl:322 [inlined]
 [11] #_maximum#743
    @ ./reducedim.jl:894 [inlined]
 [12] _maximum
    @ ./reducedim.jl:894 [inlined]
 [13] #_maximum#742
    @ ./reducedim.jl:893 [inlined]
 [14] _maximum
    @ ./reducedim.jl:893 [inlined]
 [15] #maximum#740
    @ ./reducedim.jl:889 [inlined]
 [16] maximum
    @ ./reducedim.jl:889 [inlined]
 [17] scaling_Ruiz!(fd_T0::RipQP.QM_FloatData{Float64, Vector{Float64}, LinearAlgebra.Symmetric{Float64, SparseArrays.SparseMatrixCSC{Float64, Int64}}, SparseArrays.SparseMatrixCSC{Float64, Int64}}, id::RipQP.QM_IntData, sd::RipQP.ScaleData{Float64, Vector{Float64}}, ϵ::Float64; max_iter::Int64)
    @ RipQP ~/.julia/packages/RipQP/M6f8t/src/scaling.jl:117
 [18] scaling_Ruiz!
    @ ~/.julia/packages/RipQP/M6f8t/src/scaling.jl:68 [inlined]
 [19] ripqp(QM0::QuadraticModel{Float64, Vector{Float64}, SparseMatricesCOO.SparseMatrixCOO{Float64, Int64}, SparseMatricesCOO.SparseMatrixCOO{Float64, Int64}}; iconf::InputConfig{Int64}, itol::InputTol{Float64, Int64}, display::Bool)
    @ RipQP ~/.julia/packages/RipQP/M6f8t/src/RipQP.jl:72
 [20] ripqp(QM0::QuadraticModel{Float64, Vector{Float64}, SparseMatricesCOO.SparseMatrixCOO{Float64, Int64}, SparseMatricesCOO.SparseMatrixCOO{Float64, Int64}})
    @ RipQP ~/.julia/packages/RipQP/M6f8t/src/RipQP.jl:56

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Use `RipQP` for more types

The following returns an error:

T = Float16
 A = rand(T, 4, 4)
b = rand(T, 4)
lls = LLSModel(A, b)
ripqp(lls)

and the error is:

ERROR: MethodError: no method matching RipQP.Regularization(::Float16, ::Float16, ::Float64, ::Float64, ::Symbol)
Closest candidates are:
  RipQP.Regularization(::T, ::T, ::T, ::T, ::Symbol) where T<:Real at C:\Users\tangi\.julia\packages\RipQP\0tSCl\src\types_definition.jl:419

inbounds GPU

using the @inboundsmacro may speed up the gpu computations when using CUDA.jl

Generate DOI

  • add DOI to CITATION.bib
  • add DOI badge to README.md

Issue with size of the solution with fixed variables

It is maybe not the most simple example, but I hope simple enough (maybe connected to #142 )

using LLSModels, RipQP, NLPModelsModifiers, QuadraticModels
A = rand(2,2)
b = rand(2)
lvar = zeros(2)
uvar = zeros(2)
nlp = LLSModel(A, b, lvar = lvar, uvar = uvar)
FLLS = FeasibilityFormNLS(nlp)
qm = QuadraticModel(FLLS, FLLS.meta.x0)
stats = ripqp(qm)
@show length(stats.solution), qm.meta.nvar

Use CITATION.cff instead of CITATION.bib

I am reviewing the CITATION usage in the repos and in particular moving to CFF files. The bib can still be generated using Github menu.
Here are a couple of suggestions to adapt this repo:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.