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

Replaced SortStruct by std::pair #721

Merged
merged 3 commits into from Jul 13, 2016

Conversation

Projects
None yet
2 participants
@lozhnikov
Contributor

lozhnikov commented Jul 12, 2016

I replaced SortStruct by std::pair in the R* tree and the X tree and fixed some compiler warnings about uninitialized variables. I did some tests, std::pair provides some speedups in mlpack_knn for the R* tree and the X tree.

@@ -58,7 +58,7 @@ class OneHotLayer
output = inputActivations;
output.zeros();
arma::uword maxIndex;
arma::uword maxIndex = 0;

This comment has been minimized.

@lozhnikov

lozhnikov Jul 12, 2016

Contributor

I looked through the armadillo code, op_min::direct_min equates index_of_min_val to zero by default.

@lozhnikov

lozhnikov Jul 12, 2016

Contributor

I looked through the armadillo code, op_min::direct_min equates index_of_min_val to zero by default.

This comment has been minimized.

@rcurtin

rcurtin Jul 12, 2016

Member

Yeah; I agree that the -Wuninitialized is erroneous in this case, but I am not sure there is any other way to stop that warning from appearing here other than initializing the index to 0. Do you know any other ways?

@rcurtin

rcurtin Jul 12, 2016

Member

Yeah; I agree that the -Wuninitialized is erroneous in this case, but I am not sure there is any other way to stop that warning from appearing here other than initializing the index to 0. Do you know any other ways?

This comment has been minimized.

@lozhnikov

lozhnikov Jul 12, 2016

Contributor

No, I don't. I think this is the easiest way.

@lozhnikov

lozhnikov Jul 12, 2016

Contributor

No, I don't. I think this is the easiest way.

@rcurtin

This comment has been minimized.

Show comment
Hide comment
@rcurtin

rcurtin Jul 12, 2016

Member

Looks good to me. This fixes #721.

Member

rcurtin commented Jul 12, 2016

Looks good to me. This fixes #721.

@rcurtin rcurtin closed this Jul 12, 2016

@rcurtin rcurtin added this to the mlpack 2.0.3 milestone Jul 12, 2016

@lozhnikov

This comment has been minimized.

Show comment
Hide comment
@lozhnikov

lozhnikov Jul 12, 2016

Contributor

Do you mean #712? :)

Contributor

lozhnikov commented Jul 12, 2016

Do you mean #712? :)

@rcurtin

This comment has been minimized.

Show comment
Hide comment
@rcurtin

rcurtin Jul 12, 2016

Member

Yep, I must have mistyped... :)

Member

rcurtin commented Jul 12, 2016

Yep, I must have mistyped... :)

@lozhnikov

This comment has been minimized.

Show comment
Hide comment
@lozhnikov

lozhnikov Jul 13, 2016

Contributor

I mean to say that if the code looks good, did you forget to merge the PR?

Contributor

lozhnikov commented Jul 13, 2016

I mean to say that if the code looks good, did you forget to merge the PR?

@rcurtin

This comment has been minimized.

Show comment
Hide comment
@rcurtin

rcurtin Jul 13, 2016

Member

Oh, yes, so I not only mistyped, I also hit the wrong button!

Member

rcurtin commented Jul 13, 2016

Oh, yes, so I not only mistyped, I also hit the wrong button!

@rcurtin rcurtin reopened this Jul 13, 2016

@rcurtin rcurtin merged commit 81c14d9 into mlpack:master Jul 13, 2016

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment