-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add objective scaling and other small fixes #60
base: master
Are you sure you want to change the base?
Conversation
Changed dependencies for cmake sub project support Fixed some memory leaks Fixed printf format strings etc Fixed compatibility with newer compilers
@@ -337,8 +337,8 @@ void resize_workspace_vars(Prob& problem, Alg& algorithm, Sol& solution, Workspa | |||
workspace->x0->resize(nvars,1); | |||
workspace->lambda->resize(nlp_ncons,1); | |||
|
|||
workspace->xlb->resize(nvars,1); | |||
workspace->xub->resize(nvars,1); | |||
*workspace->xlb = MatrixXd::Zero(nvars,1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes reading of an un-initialised variable
@@ -1058,35 +1059,6 @@ int get_iphase_offset(Prob& problem, int iphase,Workspace* workspace); | |||
|
|||
adouble ff_ad(adouble* xad, Workspace* workspace); | |||
|
|||
|
|||
void rk4_propagate( void (*dae)(adouble* derivatives, adouble* path, adouble* states, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions have been removed from the source
constexpr double inf = std::numeric_limits<double>::infinity(); | ||
constexpr double pi = 4.0*atan(1.0); | ||
constexpr double inf = std::numeric_limits<double>::infinity(); | ||
const double pi = 4.0*atan(1.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On newer compilers constexpr is enforced and atan can't be calculated at compiletime with this c++ version.
I added an objective scaling input.
Which allows overriding just objective without affecting the other automatic scaling numbers.
I changed the cmake slightly to allow sub project to work, (directly linking the target into a bigger cmake project without installing).
I also changed some small things that my linter suggested. Like printf format strings etc.
Let me know if you'd like the objective scaling done a different way perhaps? I'm happy to put a couple hours or so into this.
Thank you for the library! Works well.