Skip to content

Commit

Permalink
fix precompile statements
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebeggs committed Oct 14, 2023
1 parent 5d0a1ee commit becba04
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
2 changes: 0 additions & 2 deletions LocalPreferences.toml

This file was deleted.

1 change: 0 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890"
NearestNeighbors = "b8a86587-4115-5ab1-83bc-aa920d37bbce"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Expand Down
53 changes: 28 additions & 25 deletions src/RadialBasisFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,33 +60,36 @@ export ∂test, ∂exponents, build_monomial_basis, pascals_triangle, monomial_r
using PrecompileTools
@setup_workload begin
f(x) = 1 + sin(4 * x[1]) + cos(3 * x[1]) + sin(2 * x[2])
x = map(x -> SVector{2}(rand(2)), 1:100)
z = f.(x)
@compile_workload begin
x = map(x -> SVector{2}(rand(2)), 1:100)
z = f.(x)

# partial
= partial(x, 1, 1)
∂x = (z)

# gradient
= gradient(x)
∇z = (z)

# laplacian
∇² = laplacian(x)
∇²z = ∇²(z)

# interpolation
interp = RadialBasisInterp(x, y)
yy = interp([SVector(rand(2)), SVector(rand(2))])

# basis functions
imq = IMQ(1)
g = Gaussian(1)
phs1 = PHS(1; poly_deg=-1)
phs3 = PHS(3; poly_deg=0)
phs5 = PHS(5; poly_deg=1)
phs7 = PHS(7; poly_deg=2)
basis_funcs = [
IMQ(1),
Gaussian(1),
PHS(1; poly_deg=-1),
PHS(3; poly_deg=0),
PHS(5; poly_deg=1),
PHS(7; poly_deg=2),
]

for b in basis_funcs
# partial
= partial(x, 1, 1, b)
∂x = (z)

# gradient
= gradient(x, b)
∇z = (z)

# laplacian
∇² = laplacian(x, b)
∇²z = ∇²(z)

# interpolation
interp = RadialBasisInterp(x, z, b)
zz = interp([SVector{2}(rand(2)), SVector{2}(rand(2))])
end
end
end

Expand Down

0 comments on commit becba04

Please sign in to comment.