-
Notifications
You must be signed in to change notification settings - Fork 290
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
Ipopt will crash if there is no non-fixed variable. #648
Comments
It would be good to fix this. Here is a small patch that works for me: @@ -66,6 +66,14 @@ Index TripletToCSRConverter::InitializeConverter(
dim_ = dim;
nonzeros_triplet_ = nonzeros;
+ if( nonzeros == 0 )
+ {
+ initialized_ = true;
+ nonzeros_compressed_ = 0;
+ num_doubles_ = 0;
+ return 0;
+ }
+
// Create a list with all triplet entries
std::vector<TripletEntry> entry_list(nonzeros);
std::vector<TripletEntry>::iterator list_iterator = entry_list.begin(); There are some error messages printed, but it terminates with a good status. |
Thanks for your quick reply!! It works for me too and looks reasonable. |
svigerske
added a commit
that referenced
this issue
Mar 15, 2023
- ... for square problems, thus for empty NLPs, e.g. #648 - avoids some warning messages from linear solver
svigerske
added a commit
that referenced
this issue
Mar 15, 2023
- should cover really empty NLP case from #648
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a simple problem:
min f(x0), where f(x0) = 0.0,
subject to 0.0 <= x0 <= 0.0.
The code to solve this problem using Ipopt is:
It will segfault.
Do you want to fix this corner case or it is users' responsibility to guarantee that there's at least one non-fixed variable?
The text was updated successfully, but these errors were encountered: