Skip to content

Commit

Permalink
Merge pull request #8 from Clonkk/fftshift
Browse files Browse the repository at this point in the history
fftshift in its own file
  • Loading branch information
Clonkk authored Feb 3, 2021
2 parents 764ac72 + 53b3b41 commit 67ca361
Show file tree
Hide file tree
Showing 10 changed files with 319 additions and 150 deletions.
52 changes: 3 additions & 49 deletions docs/fftw3.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ <h1 class="title">fftw3</h1>
title="fftw_execute_dft_c2r(p: fftw_plan; input: Tensor[Complex64];
output: Tensor[float64])">fftw_execute_dft_c2r,<wbr>fftw_plan,<wbr>Tensor[Complex64],<wbr>Tensor[float64]</a></li>

</ul>
<ul class="simple nested-toc-section">circshift
<li><a class="reference" href="#circshift%2CTensor%5BT%5D%2Cseq%5Bint%5D"
title="circshift[T](t: Tensor[T]; shift: seq[int]): Tensor[T]">circshift,<wbr>Tensor[T],<wbr>seq[int]</a></li>

</ul>
<ul class="simple nested-toc-section">fftw_plan_many_dft_r2c
<li><a class="reference" href="#fftw_plan_many_dft_r2c%2Ccint%2Cptr.cint%2Ccint%2Cptr.cdouble%2Cptr.cint%2Ccint%2Ccint%2Cptr.Complex64%2Cptr.cint%2Ccint%2Ccint%2Ccuint"
Expand All @@ -184,11 +179,6 @@ <h1 class="title">fftw3</h1>
title="fftw_plan_dft_2d(input: Tensor[Complex64]; output: Tensor[Complex64];
sign: cint; flags: cuint = FFTW_MEASURE): fftw_plan">fftw_plan_dft_2d,<wbr>Tensor[Complex64],<wbr>Tensor[Complex64],<wbr>cint,<wbr>cuint</a></li>

</ul>
<ul class="simple nested-toc-section">ifftshift
<li><a class="reference" href="#ifftshift%2CTensor%5BT%5D"
title="ifftshift[T](t: Tensor[T]): Tensor[T]">ifftshift,<wbr>Tensor[T]</a></li>

</ul>
<ul class="simple nested-toc-section">fftw_execute_dft
<li><a class="reference" href="#fftw_execute_dft%2Cfftw_plan%2Cptr.Complex64%2Cptr.Complex64"
Expand Down Expand Up @@ -250,11 +240,6 @@ <h1 class="title">fftw3</h1>
title="fftw_plan_dft_r2c(input: Tensor[float64]; output: Tensor[Complex64];
flags: cuint = FFTW_MEASURE): fftw_plan">fftw_plan_dft_r2c,<wbr>Tensor[float64],<wbr>Tensor[Complex64],<wbr>cuint</a></li>

</ul>
<ul class="simple nested-toc-section">fftshift
<li><a class="reference" href="#fftshift%2CTensor%5BT%5D"
title="fftshift[T](t: Tensor[T]): Tensor[T]">fftshift,<wbr>Tensor[T]</a></li>

</ul>
<ul class="simple nested-toc-section">fftw_plan_dft_3d
<li><a class="reference" href="#fftw_plan_dft_3d%2Ccint%2Ccint%2Ccint%2Cptr.Complex64%2Cptr.Complex64%2Ccint%2Ccuint"
Expand Down Expand Up @@ -419,7 +404,7 @@ <h1><a class="toc-backref" id="planner-flags" href="#planner-flags">Planner flag
<div class="section" id="6">
<h1><a class="toc-backref" href="#6">Imports</a></h1>
<dl class="item">
<a class="reference external" href="fftw3/libutils.html">fftw3/libutils</a>, <a class="reference external" href="fftw3/guru.html">fftw3/guru</a>, <a class="reference external" href="fftw3/wisdom.html">fftw3/wisdom</a>
<a class="reference external" href="fftw3/libutils.html">fftw3/libutils</a>, <a class="reference external" href="fftw3/guru.html">fftw3/guru</a>, <a class="reference external" href="fftw3/wisdom.html">fftw3/wisdom</a>, <a class="reference external" href="fftw3/fftshift.html">fftw3/fftshift</a>
</dl></div>
<div class="section" id="10">
<h1><a class="toc-backref" href="#10">Consts</a></h1>
Expand Down Expand Up @@ -526,37 +511,6 @@ <h1><a class="toc-backref" href="#10">Consts</a></h1>
<div class="section" id="12">
<h1><a class="toc-backref" href="#12">Procs</a></h1>
<dl class="item">
<a id="circshift,Tensor[T],seq[int]"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#circshift%2CTensor%5BT%5D%2Cseq%5Bint%5D"><span class="Identifier">circshift</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <span class="Identifier">Tensor</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">shift</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">int</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Tensor</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span></pre></dt>
<dd>

Generic Circshift

</dd>
<a id="fftshift,Tensor[T]"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#fftshift%2CTensor%5BT%5D"><span class="Identifier">fftshift</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <span class="Identifier">Tensor</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Tensor</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span></pre></dt>
<dd>

Common fftshift function. Use Nim's openMP operator (<tt class="docutils literal"><span class="pre">||</span></tt>) for rank &lt;= 3
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Keyword">import</span><span class="Whitespace"> </span><span class="Identifier">arraymancer</span><span class="Whitespace">
</span><span class="Keyword">let</span><span class="Whitespace"> </span><span class="Identifier">input_tensor</span><span class="Whitespace"> </span><span class="Operator">=</span><span class="Whitespace"> </span><span class="Identifier">randomTensor</span><span class="Punctuation">[</span><span class="Identifier">float64</span><span class="Punctuation">]</span><span class="Punctuation">(</span><span class="DecNumber">10</span><span class="Punctuation">,</span><span class="Whitespace"> </span><span class="DecNumber">10</span><span class="Punctuation">,</span><span class="Whitespace"> </span><span class="DecNumber">10</span><span class="Punctuation">,</span><span class="Whitespace"> </span><span class="FloatNumber">10.0</span><span class="Punctuation">)</span><span class="Whitespace">
</span><span class="Comment"># output_tensor is the fftshift of input_tensor</span><span class="Whitespace">
</span><span class="Keyword">var</span><span class="Whitespace"> </span><span class="Identifier">output_tensor</span><span class="Whitespace"> </span><span class="Operator">=</span><span class="Whitespace"> </span><span class="Identifier">fftshift</span><span class="Punctuation">(</span><span class="Identifier">input_tensor</span><span class="Punctuation">)</span></pre>

</dd>
<a id="ifftshift,Tensor[T]"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#ifftshift%2CTensor%5BT%5D"><span class="Identifier">ifftshift</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <span class="Identifier">Tensor</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Tensor</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span></pre></dt>
<dd>

Common ifftshift function. Use Nim's openMP operator (<tt class="docutils literal"><span class="pre">||</span></tt>) for rank &lt;= 3
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Keyword">import</span><span class="Whitespace"> </span><span class="Identifier">arraymancer</span><span class="Whitespace">
</span><span class="Keyword">let</span><span class="Whitespace"> </span><span class="Identifier">input_tensor</span><span class="Whitespace"> </span><span class="Operator">=</span><span class="Whitespace"> </span><span class="Identifier">randomTensor</span><span class="Punctuation">[</span><span class="Identifier">float64</span><span class="Punctuation">]</span><span class="Punctuation">(</span><span class="DecNumber">10</span><span class="Punctuation">,</span><span class="Whitespace"> </span><span class="DecNumber">10</span><span class="Punctuation">,</span><span class="Whitespace"> </span><span class="DecNumber">10</span><span class="Punctuation">,</span><span class="Whitespace"> </span><span class="FloatNumber">10.0</span><span class="Punctuation">)</span><span class="Whitespace">
</span><span class="Comment"># output_tensor is the fftshift of input_tensor</span><span class="Whitespace">
</span><span class="Keyword">var</span><span class="Whitespace"> </span><span class="Identifier">output_tensor</span><span class="Whitespace"> </span><span class="Operator">=</span><span class="Whitespace"> </span><span class="Identifier">ifftshift</span><span class="Punctuation">(</span><span class="Identifier">input_tensor</span><span class="Punctuation">)</span></pre>

</dd>
<a id="fftw_execute,fftw_plan"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#fftw_execute%2Cfftw_plan"><span class="Identifier">fftw_execute</span></a><span class="Other">(</span><span class="Identifier">p</span><span class="Other">:</span> <a href="fftw3/libutils.html#fftw_plan"><span class="Identifier">fftw_plan</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">cdecl</span><span class="Other">,</span> <span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;fftw_execute&quot;</span><span class="Other">,</span>
<span class="Identifier">dynlib</span><span class="Other">:</span> <span class="Identifier">Fftw3Lib</span></span><span class="Other">.}</span></span></pre></dt>
Expand Down Expand Up @@ -1015,7 +969,7 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>
<div class="section" id="19">
<h1><a class="toc-backref" href="#19">Exports</a></h1>
<dl class="item">
<a href="fftw3/libutils.html#fftw_plan"><span class="Identifier">fftw_plan</span></a>, <a href="fftw3/libutils.html#fftw_r2r_kind"><span class="Identifier">fftw_r2r_kind</span></a>
<a href="fftw3/libutils.html#fftw_plan"><span class="Identifier">fftw_plan</span></a>, <a href="fftw3/libutils.html#fftw_r2r_kind"><span class="Identifier">fftw_r2r_kind</span></a>, <a href="fftw3/fftshift.html#ifftshift,Tensor[T]"><span class="Identifier">ifftshift</span></a>, <a href="fftw3/fftshift.html#fftshift,Tensor[T]"><span class="Identifier">fftshift</span></a>, <a href="fftw3/fftshift.html#circshift,Tensor[T],seq[int]"><span class="Identifier">circshift</span></a>
</dl></div>

</div>
Expand All @@ -1025,7 +979,7 @@ <h1><a class="toc-backref" href="#19">Exports</a></h1>
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small style="color: var(--hint);">Made with Nim. Generated: 2020-12-10 16:50:09 UTC</small>
<small style="color: var(--hint);">Made with Nim. Generated: 2021-02-03 11:12:49 UTC</small>
</div>
</div>
</div>
Expand Down
3 changes: 0 additions & 3 deletions docs/fftw3.idx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ FFTW_UNALIGNED fftw3.html#FFTW_UNALIGNED fftw3: FFTW_UNALIGNED
FFTW_CONSERVE_MEMORY fftw3.html#FFTW_CONSERVE_MEMORY fftw3: FFTW_CONSERVE_MEMORY
FFTW_FORWARD fftw3.html#FFTW_FORWARD fftw3: FFTW_FORWARD
FFTW_BACKWARD fftw3.html#FFTW_BACKWARD fftw3: FFTW_BACKWARD
circshift fftw3.html#circshift,Tensor[T],seq[int] fftw3: circshift[T](t: Tensor[T]; shift: seq[int]): Tensor[T]
fftshift fftw3.html#fftshift,Tensor[T] fftw3: fftshift[T](t: Tensor[T]): Tensor[T]
ifftshift fftw3.html#ifftshift,Tensor[T] fftw3: ifftshift[T](t: Tensor[T]): Tensor[T]
fftw_execute fftw3.html#fftw_execute,fftw_plan fftw3: fftw_execute(p: fftw_plan)
fftw_execute_dft fftw3.html#fftw_execute_dft,fftw_plan,ptr.Complex64,ptr.Complex64 fftw3: fftw_execute_dft(p: fftw_plan; inptr: ptr Complex64; outptr: ptr Complex64)
fftw_execute_dft fftw3.html#fftw_execute_dft,fftw_plan,Tensor[Complex64],Tensor[Complex64] fftw3: fftw_execute_dft(p: fftw_plan; input: Tensor[Complex64];\n output: Tensor[Complex64])
Expand Down
Loading

0 comments on commit 67ca361

Please sign in to comment.