-
Notifications
You must be signed in to change notification settings - Fork 15
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
Changing DP.Polyvar -> DP.Variable as suggested #829
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #829 +/- ##
==========================================
+ Coverage 96.38% 96.77% +0.39%
==========================================
Files 56 56
Lines 8971 8971
==========================================
+ Hits 8647 8682 +35
+ Misses 324 289 -35 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @stephanmg for the fix, and sorry I didn't think the suggestion through enough.
I found two more updates that are breaking the examples:
- In examples\convexityparameter\JuMP.jl, line 72 could be
bss() = SAS.FullSpace()
and on line 77addinequality!
->add_inequality!
- In examples\JuMP_utils.jl,
MOI.Bridges.add_bridge(opt, B{Float64})
->MOI.Bridges.add_bridge(opt, B)
I would prefer for someone else (not me) to make the fixes, if you are up for it.
@@ -105,7 +105,7 @@ function get_lagrange_polys(pts::Matrix{T}, deg::Int) where {T <: Real} | |||
end | |||
|
|||
# returns the multivariate Chebyshev polynomials in x up to degree deg | |||
function get_chebyshev_polys(x::Vector{DP.PolyVar{true}}, deg::Int) | |||
function get_chebyshev_polys(x::Vector{DP.Variable{true}}, deg::Int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just have this as Vector{<:DP.Variable}
, the DP types seem to have acquired even more parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also below on line 114 Vector(undef, PolyUtils.get_L(n, deg))
seems to work and it would be nice not to have to update these DP types in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, <:DP.Variable
seems safer or even <:MultivariatePolynomials.AbstractVariable
@@ -124,7 +124,7 @@ function get_chebyshev_polys(x::Vector{DP.PolyVar{true}}, deg::Int) | |||
return V | |||
end | |||
|
|||
function get_chebyshev_univ(monovec::Vector{DP.PolyVar{true}}, deg::Int) | |||
function get_chebyshev_univ(monovec::Vector{DP.Variable{true}}, deg::Int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto Vector{<:DP.Variable}
, ditto Vector(undef, deg + 1)
on line 134
H::Matrix{<:DP.Polynomial} | ||
is_feas::Bool # whether model should be primal-dual feasible; only for testing | ||
use_wsosmatrix::Bool # use wsosinterppossemideftri cone, else PSD formulation | ||
use_dual::Bool # use dual formulation, else primal formulation | ||
end | ||
|
||
function SemidefinitePolyJuMP{Float64}( | ||
x::Vector{DP.PolyVar{true}}, | ||
x::Vector{DP.Variable{true}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto thoughts on Vector{<:DP.Variable}
Thanks @stephanmg and @lkapelevich. tagging @blegat here in case he has any thoughts. |
Hi @chriscoey I tried to add most of @lkapelevich suggestions, however, please double check. |
@stephanmg good changes! the polynomial examples are still failing though - https://github.com/chriscoey/Hypatia.jl/actions/runs/6900952711/job/18774937852?pr=829 |
moved to #830 |
@lkapelevich here you go anyway but still some tests error here.