Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

poolfeast-420
Copy link

@poolfeast-420 poolfeast-420 commented Oct 11, 2024

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.

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);
Copy link
Author

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,
Copy link
Author

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);
Copy link
Author

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.

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.

1 participant