Skip to content

Commit

Permalink
Merge pull request #19 from NFFT/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
passscoed authored Aug 14, 2024
2 parents 24a1adb + 173575b commit 4a7b3e3
Show file tree
Hide file tree
Showing 43 changed files with 1,105 additions and 48 deletions.
18 changes: 17 additions & 1 deletion Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.4"
manifest_format = "2.0"
project_hash = "6a0dbf49b9f181ea3bc8882243fdc78ded95cdb7"
project_hash = "d9ad1fa52dc8a8a415fe050e4fcf94ccb8acb79a"

[[deps.Aqua]]
deps = ["Compat", "Pkg", "Test"]
Expand Down Expand Up @@ -88,6 +88,22 @@ uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[deps.LinearMaps]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "ee79c3208e55786de58f8dcccca098ced79f743f"
uuid = "7a12625a-238d-50fd-b39a-03d52299707e"
version = "3.11.3"

[deps.LinearMaps.extensions]
LinearMapsChainRulesCoreExt = "ChainRulesCore"
LinearMapsSparseArraysExt = "SparseArrays"
LinearMapsStatisticsExt = "Statistics"

[deps.LinearMaps.weakdeps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[[deps.Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

Expand Down
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ version = "1.2.2"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
CpuId = "adafc99b-e345-5852-983c-f28acb93d879"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearMaps = "7a12625a-238d-50fd-b39a-03d52299707e"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Aqua = "0.5 - 0.8"
CpuId = "0.3"
LinearAlgebra = "1"
LinearMaps = "3"
Test = "1"
julia = "1"
20 changes: 15 additions & 5 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@ using CpuId
# file ending for OS
ending = ".so"
path = "/../src/lib/"
glibcversion = ""

if Sys.iswindows()
ending = ".dll"
path = "\\..\\src\\lib\\"
elseif Sys.isapple()
ending = ".dylib"
else
glibcversion = "glibc2.40/"
if VersionNumber(
unsafe_string(
@ccall string(@__DIR__, path, "glibc-version.so").glibc_version()::Cstring
),
) < v"2.35"
glibcversion = "glibc2.22/"
end
end

if cpufeature(:AVX2)
Expand All @@ -19,12 +29,12 @@ else
flag = "SSE2/"
end

lib_path_nfft = string(@__DIR__, path, flag, "libnfftjulia", ending)
lib_path_nfct = string(@__DIR__, path, flag, "libnfctjulia", ending)
lib_path_nfst = string(@__DIR__, path, flag, "libnfstjulia", ending)
lib_path_fastsum = string(@__DIR__, path, flag, "libfastsumjulia", ending)
lib_path_nfft = string(@__DIR__, path, flag, glibcversion, "libnfftjulia", ending)
lib_path_nfct = string(@__DIR__, path, flag, glibcversion, "libnfctjulia", ending)
lib_path_nfst = string(@__DIR__, path, flag, glibcversion, "libnfstjulia", ending)
lib_path_fastsum = string(@__DIR__, path, flag, glibcversion, "libfastsumjulia", ending)

println( lib_path_nfft )
println(lib_path_nfft)

chmod(lib_path_nfft, filemode(lib_path_nfft) | 0o755)
chmod(lib_path_nfct, filemode(lib_path_nfct) | 0o755)
Expand Down
12 changes: 7 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ makedocs(
pages = [
"Home" => "index.md",
"About" => "about.md",
"Transformations" =>
["NFFT" => "NFFT.md", "NFST" => "NFST.md", "NFCT" => "NFCT.md"],
"Applications" =>
["fastsum" => "fastsum.md",],
"Flags" => "Flags.md",
"Transformations" => [
"NFFT" => "NFFT.md",
"NFST" => "NFST.md",
"NFCT" => "NFCT.md",
"NFMT" => "NFMT.md",
],
"Applications" => ["fastsum" => "fastsum.md"],
],
)

Expand Down
61 changes: 61 additions & 0 deletions docs/src/NFMT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# [Nonequispaced Fast Cosine Transform (NFMT)](@id NFMT_site)

```@meta
CurrentModule = NFFT3
```

## NDMT and NFMT

We consider for $\pmb{d}\in\{\exp,\cos,\mathrm{alg}\}^d$ the trigonometric polynomial

$$f^{\pmb{d}}(\pmb{x}) \coloneqq \sum_{\pmb{k} \in I_{\pmb{N},\pmb{d}}^d} \hat{f}_{\pmb{k}}^{\pmb{d}} \, \phi_{\pmb{k}}^{\pmb{d}}(\pmb{x}), \quad \pmb{x} \in \mathbb{R}^d,$$

with

$$\phi_{\pmb{k}}^{\pmb{d}}(\pmb{x})=\prod_{j=1}^d\begin{cases}1,&k_j=0\\\exp(2\pi\mathrm{i}k_jx_j),&d_j=\exp,\;k_j\neq0\\
\sqrt{2}\cos(\pi k_jx_j),&d_j=\cos,\;k_j\neq0\\
\sqrt{2}\cos(k_j\arccos(2x_j-1)),&d_j=\mathrm{alg},\;k_j\neq0\end{cases} $$

and multibandlimit $\pmb{N} \in (2\mathbb{N})^d$ and index set

$$I_{\pmb{N},\pmb{d}}^d \coloneqq \overset{d}{\underset{j=1}{\vphantom{\mathop{\raisebox{-.5ex}{\hbox{\huge{$\times$}}}}}⨉}}\begin{cases}\Big\{-\frac{N_j}{2},-\frac{N_j}{2}+1,\ldots,\frac{N_j}{2}\Big\},&d_j=\exp\\\Big\{0,1,\ldots,\frac{N_j}{2}\Big\},&d_j\neq\exp\end{cases}.$$

The NDMT is the evaluation of

$$f^{\pmb{d}}(\pmb{x}_j) \coloneqq \sum_{\pmb{k} \in I_{\pmb{N},\pmb{d}}^d} \hat{f}_{\pmb{k}}^{\pmb{d}} \, \phi_{\pmb{k}}^{\pmb{d}}(\pmb{x}_j)$$

at arbitrary nodes $\pmb{x}_j \in [0,1]^d$ for given coefficients $\hat{f}_{\pmb{k}}^{\pmb{d}} \in \mathbb{R}, \pmb{k} \in I_{\pmb{N},\pmb{d}}^d$. Similarly to the NDFT, the transposed NDMT is the evaluation of

$$\hat{h}^{\pmb{d}}_{\pmb{k}} = \sum_{j=1}^M f^{\pmb{d}}_j \, \phi_{\pmb{k}}^{\pmb{d}}(\pmb{x}_j)$$

for the frequencies $\pmb{k} \in I_{\pmb{N},\pmb{d}}^d$ with given coefficients $f^{\pmb{d}}_j \in \mathbb{R}, j = 1,2,\ldots,M$.

We modify the [NFFT](@ref NFFT_site) in order to derive a fast algorithm for the computation of the NDMT and transposed NDMT, obtaining the NFMT and its transposed counterpart. For details we refer to [[Potts, Schröter, 2024](#PottsSchröter2024)].

## Plan structure

```@docs
NFMT{D}
```

## Functions

```@docs
nfmt_trafo
nfmt_trafo_direct
nfmt_transposed
nfmt_transposed_direct
nfmt_finalize_plan
nfmt_init
```

## Literature

```@raw html
<ul>
<li id="PottsSchröetr2024">[<a>Potts, Schröter, 2024</a>]
D. Potts, P.Schröter. Linear Algebra Appl.</emph>
arXiv: <a href="https://arxiv.org/abs/2306.09174">2306.09174</a>.
</li>
</ul>
```
40 changes: 40 additions & 0 deletions docs/src/fastsum.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,46 @@ where the inner sum can be computed by an adjoint NFFT which is then followed by
fastsum_trafo_exact
```

## Supported kernel functions

- `gaussian`
$${K}(x)=\exp\Big(-\frac{x^2}{c^2}\Big)$$
- `multiquadratic`
$${K}(x)=\sqrt{x^2+c^2}$$
- `inverse_multiquadratic`
$${K}(x)=\sqrt{\frac{1}{x^2+c^2}}$$
- `logarithm`
$${K}(x)=\log(\vert x\vert)$$
- `thinplate_spline`
$${K}(x)=x^2\log(\vert x\vert)$$
- `one_over_square`
$${K}(x)=\frac{1}{x^2}$$
- `one_over_modulus`
$${K}(x)=\frac{1}{\vert x\vert}$$
- `one_over_x`
$${K}(x)=\frac{1}{x}$$
- `one_over_multiquadric3`
$${K}(x)=\Big(\frac{1}{x^2+c^2}\Big)^\frac{3}{2}$$
- `sinc_kernel`
$${K}(x)=\frac{\sin(cx)}{x}$$
- `cosc`
$${K}(x)=\frac{\cos(cx)}{x}$$
- `kcot`
$${K}(x)=\cot(cx)$$
- `one_over_cube`
$${K}(x)=\frac{1}{x^3}$$
- `log_sin`
$${K}(x)=\log(\vert\sin(cx)\vert)$$
- `laplacian_rbf`
$${K}(x)=\exp\Big(-\frac{\vert x\vert}{c}\Big)$$
- `der_laplacian_rbf`
$${K}(x)=\frac{\vert x\vert}{c}\exp\Big(-\frac{\vert x\vert}{c}\Big)$$
- `xx_gaussian`
$${K}(x)=\frac{x^2}{c^2}\exp\Big(-\frac{x^2}{c^2}\Big)$$
- `absx`
$${K}(x)=\vert x\vert$$


## Literature

```@raw html
Expand Down
Loading

0 comments on commit 4a7b3e3

Please sign in to comment.