Closed zhzhzoo-autra closed 1 year ago
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.
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?