Skip to content

Commit

Permalink
Add inbounds to make_rows
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Anklesaria committed Mar 27, 2024
1 parent 0c5f4bb commit acc8fb1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/NearestNeighborsModule.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module NearestNeighborsModule
using ..API
using ChainRulesCore
using KernelFunctions, LinearAlgebra, SparseArrays, AbstractGPs

"""
Expand All @@ -21,7 +20,7 @@ function make_B(pts::AbstractVector{T}, k::Int, kern::Kernel) where {T}
end

function make_rows(pts::AbstractVector{T}, k::Int, kern::Kernel) where {T}
[make_row(kern, pts[max(1, i-k):i-1], pts[i]) for i in 2:length(pts)]
@inbounds [make_row(kern, pts[max(1, i-k):i-1], pts[i]) for i in 2:length(pts)]
end

function make_row(kern::Kernel, ns::AbstractVector{T}, p::T) where {T}
Expand Down

0 comments on commit acc8fb1

Please sign in to comment.