diff --git a/Manifest.toml b/Manifest.toml index f2e9754..fd26162 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.10.4" manifest_format = "2.0" -project_hash = "36e187d43e77647e256f56fe9d041a485e8c6c7a" +project_hash = "6a0dbf49b9f181ea3bc8882243fdc78ded95cdb7" [[deps.Aqua]] deps = ["Compat", "Pkg", "Test"] diff --git a/Project.toml b/Project.toml index 33e23a3..c21e4b7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "NFFT3" uuid = "53104703-03e8-40a5-ab01-812303a44cae" authors = ["Michael Schmischke for the julia package and other contributors for the NFFT (see nfft.org)"] -version = "1.2.0" +version = "1.2.1" [deps] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" @@ -10,7 +10,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] -Aqua = "0.8" +Aqua = "0.5 - 0.8" CpuId = "0.3" LinearAlgebra = "1" Test = "1" diff --git a/src/NFFT3.jl b/src/NFFT3.jl index c265266..8f2899d 100644 --- a/src/NFFT3.jl +++ b/src/NFFT3.jl @@ -38,7 +38,26 @@ include("NFMT.jl") include("fastsum.jl") include("flags.jl") - +kernels = Dict( + "gaussian" => 1, + "multiquadric" => 1, + "inverse_multiquadric" => 1, + "logarithm" => 0, + "thinplate_spline" => 0, + "one_over_square" => 0, + "one_over_modulus" => 0, + "one_over_x" => 0, + "inverse_multiquadric3" => 1, + "sinc_kernel" => 1, + "cosc" => 1, + "kcot" => 1, + "one_over_cube" => 0, + "log_sin" => 1, + "laplacian_rbf" => 1, + "der_laplacian_rbf" => 1, + "xx_gaussian" => 1, + "absx" => 0, +) # plan structures export NFFT, NFCT, NFST, FASTSUM, NFMT diff --git a/src/fastsum.jl b/src/fastsum.jl index a57d658..880d767 100644 --- a/src/fastsum.jl +++ b/src/fastsum.jl @@ -131,16 +131,45 @@ function FASTSUM( N::Integer, M::Integer, kernel::String, - c::Real, + c::Vector{<:Real}, n::Integer = 256, p::Integer = 8, - eps_I::Real = 8/256, - eps_B::Real = 1/16, + eps_I::Real = 8 / 256, + eps_B::Real = 1 / 16, nn::Integer = 512, m::Integer = 8, ) - cv = Vector{Float64}(undef, 1) - cv[1] = Float64(c) + + if length(c) != kernels[kernel] + error("Kernel parameter vector has wrong length.") + end + + FASTSUM(d, N, M, n, p, kernel, c, eps_I, eps_B, nn, nn, m, m, UInt32(0)) +end #constructor + +function FASTSUM( + d::Integer, + N::Integer, + M::Integer, + kernel::String, + c::Union{Real,UndefInitializer} = undef, + n::Integer = 256, + p::Integer = 8, + eps_I::Real = 8 / 256, + eps_B::Real = 1 / 16, + nn::Integer = 512, + m::Integer = 8, +) + if kernels[kernel] == 0 || c == undef + cv = Vector{Float64}() #Only compatibility will be removed in the next major upgrade + else + cv = Vector{Float64}(undef, 1) + cv[1] = Float64(c) + end + + if length(cv) != kernels[kernel] + error("Kernel parameter vector has wrong length.") + end FASTSUM(d, N, M, n, p, kernel, cv, eps_I, eps_B, nn, nn, m, m, UInt32(0)) end #constructor diff --git a/src/lib/AVX/libfastsumjulia.dll b/src/lib/AVX/libfastsumjulia.dll index 3ce8c8e..8b32932 100644 Binary files a/src/lib/AVX/libfastsumjulia.dll and b/src/lib/AVX/libfastsumjulia.dll differ diff --git a/src/lib/AVX/libfastsumjulia.dylib b/src/lib/AVX/libfastsumjulia.dylib index 4e070ec..8512b10 100644 Binary files a/src/lib/AVX/libfastsumjulia.dylib and b/src/lib/AVX/libfastsumjulia.dylib differ diff --git a/src/lib/AVX/libfastsumjulia.so b/src/lib/AVX/libfastsumjulia.so index 47c0eea..7297f3a 100644 Binary files a/src/lib/AVX/libfastsumjulia.so and b/src/lib/AVX/libfastsumjulia.so differ diff --git a/src/lib/AVX2/libfastsumjulia.dll b/src/lib/AVX2/libfastsumjulia.dll index cff5b27..fce7920 100644 Binary files a/src/lib/AVX2/libfastsumjulia.dll and b/src/lib/AVX2/libfastsumjulia.dll differ diff --git a/src/lib/AVX2/libfastsumjulia.dylib b/src/lib/AVX2/libfastsumjulia.dylib index 8182efe..10777d4 100644 Binary files a/src/lib/AVX2/libfastsumjulia.dylib and b/src/lib/AVX2/libfastsumjulia.dylib differ diff --git a/src/lib/AVX2/libfastsumjulia.so b/src/lib/AVX2/libfastsumjulia.so index 57ee5e2..e583447 100644 Binary files a/src/lib/AVX2/libfastsumjulia.so and b/src/lib/AVX2/libfastsumjulia.so differ diff --git a/src/lib/SSE2/libfastsumjulia.dll b/src/lib/SSE2/libfastsumjulia.dll index b1c13f5..cc61b9a 100644 Binary files a/src/lib/SSE2/libfastsumjulia.dll and b/src/lib/SSE2/libfastsumjulia.dll differ diff --git a/src/lib/SSE2/libfastsumjulia.dylib b/src/lib/SSE2/libfastsumjulia.dylib index 109f6c1..545e346 100644 Binary files a/src/lib/SSE2/libfastsumjulia.dylib and b/src/lib/SSE2/libfastsumjulia.dylib differ diff --git a/src/lib/SSE2/libfastsumjulia.so b/src/lib/SSE2/libfastsumjulia.so index d8a1916..9f65347 100644 Binary files a/src/lib/SSE2/libfastsumjulia.so and b/src/lib/SSE2/libfastsumjulia.so differ diff --git a/test/Manifest.toml b/test/Manifest.toml index 3b8a754..b251aa0 100644 --- a/test/Manifest.toml +++ b/test/Manifest.toml @@ -1,14 +1,14 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.10.0" +julia_version = "1.10.4" manifest_format = "2.0" project_hash = "4e0b3b0d2022a69f1ec1c6a13d6a85ccb16e5694" [[deps.Aqua]] deps = ["Compat", "Pkg", "Test"] -git-tree-sha1 = "497d933e5998358c2626f782c99a8d4b90af2dd0" +git-tree-sha1 = "12e575f31a6f233ba2485ed86b9325b85df37c61" uuid = "4c88cf16-eb10-579e-8560-4a9242c79595" -version = "0.8.4" +version = "0.8.7" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" @@ -22,9 +22,9 @@ uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" [[deps.Compat]] deps = ["TOML", "UUIDs"] -git-tree-sha1 = "75bd5b6fc5089df449b5d35fa501c846c9b6549b" +git-tree-sha1 = "b1c55339b7c6c350ee89f2c1604299660525b248" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.12.0" +version = "4.15.0" weakdeps = ["Dates", "LinearAlgebra"] [deps.Compat.extensions] @@ -33,7 +33,7 @@ weakdeps = ["Dates", "LinearAlgebra"] [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.0.5+1" +version = "1.1.1+0" [[deps.Dates]] deps = ["Printf"] @@ -105,7 +105,7 @@ version = "1.2.0" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.23+2" +version = "0.3.23+4" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]