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

Replace AbstractFloat with Real, working on #13 #14

Closed
wants to merge 1 commit into from
Closed

Replace AbstractFloat with Real, working on #13 #14

wants to merge 1 commit into from

Conversation

tlnagy
Copy link
Contributor

@tlnagy tlnagy commented Dec 21, 2015

Went through and replaced the AbstractFloat type with Real. Still need to implement new tests.

@KristofferC
Copy link
Owner

Thanks for looking into this. I believe @testloop got merged into @testset at https://github.com/IainNZ/BaseTestNext.jl so we should update those.

@tlnagy
Copy link
Contributor Author

tlnagy commented Dec 21, 2015

Yup. I saw that too. I'll open a new PR for that and then rebase this.

@tlnagy
Copy link
Contributor Author

tlnagy commented Dec 21, 2015

Where would you recommend putting test cases for integers? In test/test_monkey.jl?

@KristofferC
Copy link
Owner

For deterministic tests maybe either in the ``knnorinrange` test file. The monkey file is mostly for "random" test.

@tlnagy
Copy link
Contributor Author

tlnagy commented Dec 21, 2015

Okay. I'm getting the following error when using my example from #13:

data = rand(1:4, (10, 10^4))
balltree = BallTree(data, Hamming())
LoadError: InexactError()
while loading In[6], in expression starting on line 2

 in generic_scale! at linalg/generic.jl:12
 in create_bsphere at /Users/tamasnagy/.julia/v0.4/NearestNeighbors/src/hyperspheres.jl:33
 in build_BallTree at /Users/tamasnagy/.julia/v0.4/NearestNeighbors/src/ball_tree.jl:98
 in build_BallTree at /Users/tamasnagy/.julia/v0.4/NearestNeighbors/src/ball_tree.jl:113 (repeats 10 times)
 in BallTree at /Users/tamasnagy/.julia/v0.4/NearestNeighbors/src/ball_tree.jl:67

Which I tracked down to here: JuliaLang/julia#12912. I'm using 0.4.1 which doesn't have this patch (JuliaLang/julia@ab0db5c) yet.

@KristofferC
Copy link
Owner

I guess the hyper spheres are created with Int parameter so that the center and radius are of integer type. These will of course not in general be integral even if the input data is integers.

For input data of integer the type of the hyper spheres should probably just be float64s.

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.

2 participants