Closed kalmarek closed 3 years ago
We seriously need to increase the coverage ;)
mein Gott, when broadcasting is fixed on master, now master decided to change spacing in parametrized types...
Anything blocking the merge ?
@blegat: coverage ;) @tweisser should I pick it up?
@blegat I will add coverage and merge this over this weekend
@tweisser @blegat this seems to be ready to go!
@blegat I'm updating the examples and I tried this:
msym = let m = SOSModel(SCS.Optimizer), basis = basis, R = R
@variable m t
@objective m Max t
soses = [@variable m [1:length(R)] SOSPoly(FixedPolynomialBasis(r * basis)) for r in R]
@constraint m f - t == sum(soses)
optimize!(m)
@info termination_status(m) objective_value(m)
msym
end
but JuMP/SumOfSquares refuses to sum(soses)
; any ideas?
This looks to be a but in MutableArithmetics, I would recommend doing the sum outside the macro as a workaround. EDIT in fact, this should be resolved by doing
soses = @variable m [1:length(R)] SOSPoly(FixedPolynomialBasis(r * basis))
Otherwise, you're doing a vector of vector and sum
gives a vector instead of a polynomial
This looks to be a but in MutableArithmetics, I would recommend doing the sum outside the macro as a workaround. EDIT in fact, this should be resolved by doing
soses = @variable m [1:length(R)] SOSPoly(FixedPolynomialBasis(r * basis))
Otherwise, you're doing a vector of vector and
sum
gives a vector instead of a polynomial
??? this doesn't even compile as r
is not defined. did you mean
soses = @variable m [1:length(R)] SOSPoly(FixedPolynomialBasis(R * basis))
?? (non-compatible dimensions, doesn't work even with R .* Ref(basis)
)
this: polys = SOSPoly.(FixedPolynomialBasis.(R.*Ref(basis)))
gives me a vector of SOSPolys. How do I create a vector of SOSPolys variables ??
[@variable m variable_type=SOSPoly(FixedPolynomialBasis(r * basis)) for r in R]
or
@variable m [r in R] SOSPoly(FixedPolynomialBasis(r * basis))
should work
:tada:
Codecov Report
91.17% <91.02%> (+19.07%)
Flags with carried forward coverage won't be shown. Click here to find out more.
100.00% <ø> (ø)
74.07% <58.33%> (+14.07%)
93.93% <90.00%> (+0.39%)
91.66% <90.90%> (+91.66%)
94.02% <90.90%> (+7.82%)
94.44% <92.72%> (+94.44%)
71.42% <100.00%> (+71.42%)
100.00% <100.00%> (+16.66%)
98.14% <100.00%> (+0.71%)
100.00% <100.00%> (ø)
Continue to review full report at Codecov.