Hello friends
I am developing an interface to solve my Nonlinear Optimization Problems using Optizelle 1.3.0. I am still in my first steps. I have compiled and run the nq_sqp_exercise.cpp successfully, but I have had problems with my own examples. When I try to run my own code, even on toy problems having less than 10 variables and constraints, after some callback evaluations, I have had the following:
terminate called after throwing an instance of ‘std::bad_alloc’
what(): std::bad_alloc
running my software using valgrind (Linux, intel icpc compiler), I have had, using Constrained optimizer:
terminate called after throwing an instance of ‘std::bad_alloc’
what(): std::bad_alloc
==8620==
==8620== Process terminating with default action of signal 6 (SIGABRT)
==8620== at 0x6BDAFB7: raise (raise.c:51)
==8620== by 0x6BDC920: abort (abort.c:79)
==8620== by 0xF80B9C2: __gnu_cxx::__verbose_terminate_handler() [clone .cold] (vterminate.cc:95)
==8620== by 0xF817445: __cxxabiv1::__terminate(void ()()) (eh_terminate.cc:48)
==8620== by 0xF8174B0: std::terminate() (eh_terminate.cc:58)
==8620== by 0xF817703: __cxa_throw (eh_throw.cc:95)
==8620== by 0xF80DEA8: std::__throw_bad_alloc() (functexcept.cc:54)
==8620== by 0xF1AD8EC: void Optizelle::solveInKrylov<double, Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::XXxYY>(unsigned long c
onst&, double const, double const*, std::__cxx11::list<Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::XXxYY::Vector, std::al
locator<Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::XXxYY::Vector> > const&, Optizelle::Operator<double, Optizelle::Equali
tyConstrained<double, Optizelle::Rm, Optizelle::Rm>::XXxYY, Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::XXxYY> const&, Optizelle::
EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::XXxYY::Vector const&, Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm
::XXxYY::Vector&) [clone .constprop.1142] (in /opt/optizelle_versions/Optizelle-1.3.0-Source/build/install/lib/liboptizelle.so)
==8620== by 0xF1ADCF0: std::pair<double, unsigned long> Optizelle::gmres<double, Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::XX
xYY>(Optizelle::Operator<double, Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::XXxYY, Optizelle::EqualityConstrained<double, Optizel
le::Rm, Optizelle::Rm>::XXxYY> const&, Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::XXxYY::Vector const&, double, unsigned
long, unsigned long, Optizelle::Operator<double, Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::XXxYY, Optizelle::EqualityConstrained
<double, Optizelle::Rm, Optizelle::Rm>::XXxYY> const&, Optizelle::Operator<double, Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::XXx
YY, Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::XXxYY> const&, Optizelle::GMRESManipulator<double, Optizelle::EqualityConstrained<
double, Optizelle::Rm, Optizelle::Rm>::XXxYY> const&, Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::XXxYY::Vector&) [clone .
constprop.1139] (in /opt/optizelle_versions/Optizelle-1.3.0-Source/build/install/lib/liboptizelle.so)
==8620== by 0xF1E784F: Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::Algorithms::findEqualityMultiplier(Optizelle::EqualityConstr
ained<double, Optizelle::Rm, Optizelle::Rm>::Functions::t const&, Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::State::t&) (in /opt/
optizelle_versions/Optizelle-1.3.0-Source/build/install/lib/liboptizelle.so)
==8620== by 0x5A185B: Optizelle::EqualityConstrained<double, Optizelle::Rm, Optizelle::Rm>::Algorithms::CompositeStepManipulator<Optizelle::Constrained<d
ouble, Optizelle::Rm, Optizelle::Rm, Optizelle::Rm> >::eval(Optizelle::Constrained<double, Optizelle::Rm, Optizelle::Rm, Optizelle::Rm>::Functions::t const&
, Optizelle::Constrained<double, Optizelle::Rm, Optizelle::Rm, Optizelle::Rm>::State::t&, Optizelle::OptimizationLocation::t const&) const (optizelle.h:9684
)
==8620== by 0x5A5771: Optizelle::ConversionManipulator<Optizelle::Constrained<double, Optizelle::Rm, Optizelle::Rm, Optizelle::Rm>, Optizelle::Unconstrai
ned<double, Optizelle::Rm> >::eval(Optizelle::Unconstrained<double, Optizelle::Rm>::Functions::t const&, Optizelle::Unconstrained<double, Optizelle::Rm>::St
ate::t&, Optizelle::OptimizationLocation::t const&) const (optizelle.h:1688)
Does someone have some idea what can be wrong in my code? Unfortunately, my problem data is not hardcoded and I cannot put my formulation here. My interface to Optizelle belongs a large system and problem parameters cames from a complex path structure.
Thank you in advanced
Regards
Wendel Melo