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

Add QP-rand problem #52

Merged
merged 5 commits into from
Mar 16, 2024
Merged

Conversation

geoffroyleconte
Copy link
Member

No description provided.

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.18%. Comparing base (9926db3) to head (2bb7e4d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
+ Coverage   99.16%   99.18%   +0.02%     
==========================================
  Files          10       11       +1     
  Lines         360      369       +9     
==========================================
+ Hits          357      366       +9     
  Misses          3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@geoffroyleconte geoffroyleconte requested a review from dpo March 15, 2024 19:29
src/qp_rand_model.jl Outdated Show resolved Hide resolved

## Keyword arguments

* `dens :: Real`: density of `A`` used to generate the quadratic model (default: `1.0e-4`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with 0 < dens ≤ 1 ?

src/qp_rand_model.jl Outdated Show resolved Hide resolved
src/qp_rand_model.jl Show resolved Hide resolved
src/qp_rand_model.jl Outdated Show resolved Hide resolved
src/qp_rand_model.jl Outdated Show resolved Hide resolved
u = one(R) .+ rand(R, n)
qp = QuadraticModel(c, H; lvar = l, uvar = u)
x0 = zeros(R, n)
qp, x0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x0 should be part of qp.meta. Also, the docstring does not say that you return x0.

test/runtests.jl Outdated
model, x0 = qp_rand_model(n; dens = dens, convex = false)
@test all(-2.0 .≤ model.meta.lvar .≤ 0.0)
@test all(0.0 .≤ model.meta.uvar .≤ 2.0)
@test all(model.meta.x0 .== x0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it is. No need to return x0 above.

@geoffroyleconte geoffroyleconte requested a review from dpo March 16, 2024 19:29
Copy link
Member

@dpo dpo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@dpo dpo merged commit 410e0cc into JuliaSmoothOptimizers:main Mar 16, 2024
13 checks passed
@geoffroyleconte geoffroyleconte deleted the rand-pb branch March 17, 2024 00:23
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

Successfully merging this pull request may close these issues.

2 participants