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

Remove 'using namespace std' from problems. #147

Merged
merged 3 commits into from Dec 11, 2019
Merged

Conversation

@rcurtin
Copy link
Member

rcurtin commented Dec 10, 2019

It made for a bit more std::pow(), std::sin(), etc., but anyway, now including anything in the problems/ directory should not cause any problems for downstream code. This fixes #146.

const ElemType objective = -0.0001 * pow(abs(sin(x1) * sin(x2) *
exp(abs(100 - (sqrt(pow(x1, 2) + pow(x2, 2)) /
arma::datum::pi))) + 1), 0.1);
const ElemType objective = -0.0001 * std::pow(std::abs(std::sin(x1) *

This comment has been minimized.

Copy link
@zoq

zoq Dec 10, 2019

Member

Looks like you introduced another sinus.

This comment has been minimized.

Copy link
@zoq

zoq Dec 10, 2019

Member

Nevermind, thought there was a second std::sin.

@zoq
zoq approved these changes Dec 10, 2019
Copy link
Member

zoq left a comment

Looks good to me.

const ElemType objective = -0.0001 * pow(abs(sin(x1) * sin(x2) *
exp(abs(100 - (sqrt(pow(x1, 2) + pow(x2, 2)) /
arma::datum::pi))) + 1), 0.1);
const ElemType objective = -0.0001 * std::pow(std::abs(std::sin(x1) *

This comment has been minimized.

Copy link
@zoq

zoq Dec 10, 2019

Member

Nevermind, thought there was a second std::sin.

@rcurtin

This comment has been minimized.

Copy link
Member Author

rcurtin commented Dec 10, 2019

Still, maybe there is some issue, let me try to debug the Travis build.

@rcurtin

This comment has been minimized.

Copy link
Member Author

rcurtin commented Dec 11, 2019

Ah, turns out that we needed a using namespace std in pso_test.cpp. I'm glad I took the time to investigate it instead of assuming that it was a random test failure :)

@mlpack-bot
mlpack-bot bot approved these changes Dec 11, 2019
Copy link

mlpack-bot bot left a comment

Second approval provided automatically after 24 hours. 👍

@zoq zoq merged commit 18ce994 into mlpack:master Dec 11, 2019
3 checks passed
3 checks passed
Static Code Analysis Checks Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
mlpack master build test Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.