Skip to content

Commit

Permalink
build based on 685cf91
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Jul 4, 2024
1 parent 8e1c323 commit bff4692
Show file tree
Hide file tree
Showing 24 changed files with 20,693 additions and 0 deletions.
1 change: 1 addition & 0 deletions stable
1 change: 1 addition & 0 deletions v0.13
12 changes: 12 additions & 0 deletions v0.13.4/abstract/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>AbstractNFFTs · NFFT</title><link rel="canonical" href="https://tknopp.github.io/NFFT.jl/abstract/"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="NFFT logo"/></a><div class="docs-package-name"><span class="docs-autofit">NFFT</span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../background/">Background</a></li><li><a class="tocitem" href="../overview/">Overview</a></li><li><a class="tocitem" href="../performance/">Performance</a></li><li><a class="tocitem" href="../tools/">Tools</a></li><li class="is-active"><a class="tocitem" href>AbstractNFFTs</a><ul class="internal"><li><a class="tocitem" href="#Implementations"><span>Implementations</span></a></li><li><a class="tocitem" href="#Interface"><span>Interface</span></a></li><li><a class="tocitem" href="#Plan-Interface"><span>Plan Interface</span></a></li><li><a class="tocitem" href="#Derived-Interface"><span>Derived Interface</span></a></li></ul></li><li><a class="tocitem" href="../api/">API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>AbstractNFFTs</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>AbstractNFFTs</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/JuliaMath/NFFT.jl/blob/master/docs/src/abstract.md#" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Abstract-Interface-for-NFFTs"><a class="docs-heading-anchor" href="#Abstract-Interface-for-NFFTs">Abstract Interface for NFFTs</a><a id="Abstract-Interface-for-NFFTs-1"></a><a class="docs-heading-anchor-permalink" href="#Abstract-Interface-for-NFFTs" title="Permalink"></a></h1><p>The package <code>AbstractNFFTs</code> provides the abstract interface for NFFT implementations. Defining an abstract interface has the advantage that different implementations can be used and exchanging requires only small effort.</p><p>An overview about the current packages and their dependencies is shown in the following package tree:</p><p><img src="../assets/NFFTPackages.svg" alt="NFFT.jl package family structure"/></p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>If you are not an expert user, you likely do not require different NFFT implementations and we therefore recommend to just use <code>NFFT.jl</code> and not worry about the abstract interface. </p></div></div><h2 id="Implementations"><a class="docs-heading-anchor" href="#Implementations">Implementations</a><a id="Implementations-1"></a><a class="docs-heading-anchor-permalink" href="#Implementations" title="Permalink"></a></h2><p>Currently, there are four implementations of the <code>AbstractNFFTs</code> interface:</p><ol><li><strong>NFFT.jl</strong>: This is the reference implementation running und the CPU.</li><li><strong>CuNFFT.jl</strong>: An implementation running on graphics hardware of Nvidia exploiting CUDA.jl</li><li><strong>NFFT3.jl</strong>: In the <code>Wrapper</code> directory of <code>NFFT.jl</code> there is a wrapper around the <code>NFFT3.jl</code> package following the <code>AbstractNFFTs</code> interface. <code>NFFT3.jl</code> is itself a wrapper around the high performance C library <a href="http://www.nfft.org">NFFT3</a>.</li><li><strong>FINUFFT.jl</strong>: In the <code>Wrapper</code> directory of <code>NFFT.jl</code> there is a wrapper around the <code>FINUFFT.jl</code> package. <code>FINUFFT.jl</code> is itself a wrapper around the high performance C++ library <a href="https://finufft.readthedocs.io">FINUFFT</a>.</li></ol><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>Right now one needs to install <code>NFFT.jl</code> and manually include the wrapper files. In the future we hope to integrate the wrappers in <code>NFFT3.jl</code> and <code>FINUFFT.jl</code> directly such that it is much more convenient to switch libraries.</p></div></div><h2 id="Interface"><a class="docs-heading-anchor" href="#Interface">Interface</a><a id="Interface-1"></a><a class="docs-heading-anchor-permalink" href="#Interface" title="Permalink"></a></h2><p>An NFFT implementation needs to define a new type that is a subtype of <code>AbstractNFFTPlan{T,D,R}</code>. Here</p><ul><li><code>T</code> is the real-valued element type of the nodes, i.e. a transform operating on <code>Complex{Float64}</code> values and <code>Float64</code> nodes uses the type <code>T=Float64</code>.</li><li><code>D</code> is the size of the input vector</li><li><code>R</code> is the size of the output vector. Usually this will be <code>R=1</code> unless a directional NFFT is implemented.</li></ul><p>For instance the <code>CuNFFTPlan</code> is defined like this</p><pre><code class="language-julia">mutable struct CuNFFTPlan{T,D} &lt;: AbstractNFFTPlan{T,D,1}
...
end</code></pre><p>In addition to the plan, the following functions need to be implemented: </p><pre><code class="language-julia">size_out(p)
size_out(p)
mul!(fHat, p, f) -&gt; fHat
mul!(f, p::Adjoint{Complex{T},&lt;:AbstractNFFTPlan{T}}, fHat) -&gt; f
nodes!(p, k) -&gt; p</code></pre><p>All these functions are exported from <code>AbstractNFFTs</code> and we recommend to implement them using the explicit <code>AbstractNFFTs.</code> prefix:</p><pre><code class="language-none">function AbstractNFFTs.size_out(p:MyNFFTPlan)
...
end</code></pre><p>We next outline all of the aforementioned functions and describe their behavior:</p><pre><code class="language-julia"> size_in(p)</code></pre><p>Size of the input array for an NFFT operation. The returned tuple has <code>D</code> entries. Note that this will be the output array for an adjoint NFFT.</p><pre><code class="language-julia"> size_out(p)</code></pre><p>Size of the output array for an NFFT operation. The returned tuple has <code>R</code> entries. Note that this will be the input array for an adjoint NFFT.</p><pre><code class="language-julia"> mul!(fHat, p, f) -&gt; fHat</code></pre><p>Inplace NFFT transforming the <code>D</code> dimensional array <code>f</code> to the <code>R</code> dimensional array <code>fHat</code>. The transformation is applied along <code>D-R+1</code> dimensions specified in the plan <code>p</code>. Both <code>f</code> and <code>fHat</code> must be complex arrays of element type <code>Complex{T}</code>.</p><pre><code class="language-julia"> mul!(f, p::Adjoint{Complex{T},&lt;:AbstractNFFTPlan{T}}, fHat) -&gt; f</code></pre><p>Inplace adjoint NFFT transforming the <code>R</code> dimensional array <code>fHat</code> to the <code>D</code> dimensional array <code>f</code>. The transformation is applied along <code>D-R+1</code> dimensions specified in the plan <code>p</code>. Both <code>f</code> and <code>fHat</code> must be complex arrays of element type <code>Complex{T}</code>.</p><pre><code class="language-julia"> nodes!(p, k)</code></pre><p>Exchange the nodes <code>k</code> in the plan <code>p</code> and return the plan. The implementation of this function is optional.</p><h2 id="Plan-Interface"><a class="docs-heading-anchor" href="#Plan-Interface">Plan Interface</a><a id="Plan-Interface-1"></a><a class="docs-heading-anchor-permalink" href="#Plan-Interface" title="Permalink"></a></h2><p>The constructor for a plan also has a defined interface. It should be implemented in this way:</p><pre><code class="language-none">function MyNFFTPlan(k::Matrix{T}, N::NTuple{D,Int}; kwargs...) where {T,D}
...
end</code></pre><p>All parameters are put into keyword arguments that have to match as well. We describe the keyword arguments in more detail in the overview page. Using the same plan interface allows to load several NFFT libraries simultaneously and exchange the constructor dynamically by storing the constructor in a function object. This is how the unit tests of <code>NFFT.jl</code> run.</p><p>Additionally, to the type-specific constructor one can provide the factory</p><pre><code class="language-none">plan_nfft(Q::Type, k::Matrix{T}, N::NTuple{D,Int}; kargs...) where {D}</code></pre><p>where <code>Q</code> is the Array type, e.g. <code>Array</code>. The reason to require the array type is, that this allows for GPU implementations, which would use for instance <code>CuArray</code> here.</p><p>The package <code>AbstractNFFTs</code> provides a convenient constructor</p><pre><code class="language-none">plan_nfft(k::Matrix{T}, N::NTuple{D,Int}; kargs...) where {D}</code></pre><p>defaulting to the <code>Array</code> type.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>Different packages implementing <code>plan_nfft</code> will conflict if the same <code>Q</code> is implemented. In case of <code>NFFT.jl</code> and <code>CuNFFT.jl</code> there is no conflict since the array type is different.</p></div></div><h2 id="Derived-Interface"><a class="docs-heading-anchor" href="#Derived-Interface">Derived Interface</a><a id="Derived-Interface-1"></a><a class="docs-heading-anchor-permalink" href="#Derived-Interface" title="Permalink"></a></h2><p>Based on the core low-level interface that an <code>AbstractNFFTPlan</code> needs to provide, the package <code>AbstractNFFT.jl</code> also provides high-level functions like <code>*</code>, <code>nfft</code>, and <code>nfft_adjoint</code>, which internally use the low-level interface. Thus, the implementation of high-level function is shared among all <code>AbstractNFFT.jl</code> implementations.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../tools/">« Tools</a><a class="docs-footer-nextpage" href="../api/">API »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Thursday 4 July 2024 08:11">Thursday 4 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
111 changes: 111 additions & 0 deletions v0.13.4/api/index.html

Large diffs are not rendered by default.

Binary file added v0.13.4/assets/NFFTPackages.pdf
Binary file not shown.
Loading

0 comments on commit bff4692

Please sign in to comment.