Skip to content

Add bound queries for finite parameters and parameter functions - #443

Open
dnguyen227 wants to merge 5 commits into
infiniteopt:masterfrom
dnguyen227:param_bound_info
Open

dnguyen227 wants to merge 5 commits into
infiniteopt:masterfrom
dnguyen227:param_bound_info

Conversation

@dnguyen227

@dnguyen227 dnguyen227 commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Extend the standard JuMP bound API to finite parameters and parameter functions. Both are AbstractVariableRefs and can appear anywhere a variable can, but the bound queries were not defined for them:

All queries dispatch through GeneralVariableRef as usual, so has_lower_bound(...) works on the reference returned by the macro. copy_model carries the declared bounds over. Tests pending

This PR fixes/implements the following bugs/features

  • has_lower_bound/lower_bound/has_upper_bound/upper_bound for FiniteParameterRef
  • has_*_bound/*_bound/set_*_bound/delete_*_bound for ParameterFunctionRef
  • Bounds preserved by copy_model

note about DP.jl: We talked about defaulting to Inf,-Inf, but for methods like Hull, an error will keep being thrown if a proper bound isn't given, so I've added the option here for the user to give a bound to a parameter function.

Fixes #441

@codecov

codecov Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.72%. Comparing base (467c671) to head (fef067f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #443   +/-   ##
=======================================
  Coverage   99.72%   99.72%           
=======================================
  Files          39       39           
  Lines        6830     6834    +4     
=======================================
+ Hits         6811     6815    +4     
  Misses         19       19           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pulsipher

Copy link
Copy Markdown
Collaborator

I am in favor of adding the queries for finite parameters, but I don't think adding a bound API for parameter functions is the right way to go. It doesn't have much use outside of the niche use case of InfiniteGDPs with Hull. Moreover, the parameter function object is central to a lot of other objects in InfiniteOpt. Is is not possible to make is so DP can handle Inf in the one special case that the reference is a parameter function?

@dnguyen227

Copy link
Copy Markdown
Contributor Author

I am in favor of adding the queries for finite parameters, but I don't think adding a bound API for parameter functions is the right way to go. It doesn't have much use outside of the niche use case of InfiniteGDPs with Hull. Moreover, the parameter function object is central to a lot of other objects in InfiniteOpt. Is is not possible to make is so DP can handle Inf in the one special case that the reference is a parameter function?

It's possible. I've removed instance of it here.

@pulsipher

Copy link
Copy Markdown
Collaborator

For parameter functions or perhaps at the GeneralVariableRef level, we can have bound queries that fall back to -Inf and Inf or have the has_xxx_bound functions default to false.

This branch has not been deployed

No deployments
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.

[FEATURE] JuMP bound queries for finite parameters and parameter functions

2 participants