InfiniteOpt.jl icon indicating copy to clipboard operation
InfiniteOpt.jl copied to clipboard

DNMY: Support Domain Restriction Inversions

Open pulsipher opened this issue 4 years ago • 1 comments

This adds the invert_logic keyword argument to DomainRestrictions such that the restrictions denote the logical compliment of the conditions given. This is an experiment to see if we should implement this.

For example:

using InfiniteOpt
model = InfiniteModel()
@infinite_parameter(model, t in [0, 1])
@variable(model, y(t))
@constraint(model, y^2 <= 9, DomainRestrictions(t => 0.5, invert_logic = true)) # enforce constraint for every t != 0.5

Update: #167 is probably the better solution.

pulsipher avatar Sep 28 '21 03:09 pulsipher

Codecov Report

Merging #166 (6c13bd9) into master (d4c0ab8) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #166   +/-   ##
=======================================
  Coverage   99.78%   99.78%           
=======================================
  Files          32       32           
  Lines        6522     6555   +33     
=======================================
+ Hits         6508     6541   +33     
  Misses         14       14           
Impacted Files Coverage Δ
src/TranscriptionOpt/transcribe.jl 99.71% <100.00%> (+<0.01%) :arrow_up:
src/constraints.jl 100.00% <100.00%> (ø)
src/datatypes.jl 100.00% <100.00%> (ø)
src/show.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d4c0ab8...6c13bd9. Read the comment docs.

codecov[bot] avatar Sep 28 '21 03:09 codecov[bot]