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

#600 - Specialized support function for Ball1 and Ballp #3274

Merged
merged 3 commits into from
May 5, 2023

Conversation

schillic
Copy link
Member

@schillic schillic commented Apr 7, 2023

See #600.

The default implementation needs to allocate the support vector, which can be avoided.

julia> B1 = rand(Ball1, dim=100); d = rand(100);

julia> @time ρ_old(d, B1)
  0.000010 seconds (2 allocations: 912 bytes)
8.280132936590725

julia> @time ρ_new(d, B1)
  0.000013 seconds (1 allocation: 16 bytes)
8.280132936590725

###

julia> Bp = rand(Ballp, dim=100); d = rand(100);

julia> @time ρ_old(d, Bp)
  0.000023 seconds (3 allocations: 1.766 KiB)
11.071392754318621

julia> @time ρ_new(d, Bp)
  0.000016 seconds (1 allocation: 16 bytes)
11.071392754318621

@schillic schillic marked this pull request as ready for review April 7, 2023 20:33
@schillic schillic merged commit 61a8696 into master May 5, 2023
@schillic schillic deleted the schillic/600 branch May 5, 2023 14:45
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