Compare commits
merge into: warricksothr:master
warricksothr:gh-pages
warricksothr:master
pull from: warricksothr:gh-pages
warricksothr:gh-pages
warricksothr:master
No commits in common. 'master' and 'gh-pages' have entirely different histories.
63 changed files with 5125 additions and 1112 deletions
-
2.gitignore
-
0.lock
-
0.nojekyll
-
12.travis.yml
-
16Cargo.toml
-
BINFiraSans-Medium.woff
-
BINFiraSans-Regular.woff
-
BINHeuristica-Italic.woff
-
21LICENSE.txt
-
20README.md
-
BINSourceCodePro-Regular.woff
-
BINSourceCodePro-Semibold.woff
-
BINSourceSerifPro-Bold.woff
-
BINSourceSerifPro-Regular.woff
-
32benches/lib.rs
-
149complex/index.html
-
1complex/sidebar-items.js
-
136complex/struct.c32.html
-
136complex/struct.c64.html
-
142complex/trait.Complex.html
-
111complex/trait.Number.html
-
109complex/trait.Real.html
-
104dft/complex/fn.backward.html
-
104dft/complex/fn.forward.html
-
104dft/complex/fn.inverse.html
-
130dft/complex/index.html
-
1dft/complex/sidebar-items.js
-
121dft/index.html
-
105dft/real/fn.backward.html
-
115dft/real/fn.forward.html
-
105dft/real/fn.inverse.html
-
102dft/real/fn.unpack.html
-
139dft/real/index.html
-
1dft/real/sidebar-items.js
-
1dft/sidebar-items.js
-
10implementors/complex/trait.Complex.js
-
10implementors/complex/trait.Number.js
-
10implementors/complex/trait.Real.js
-
10implementors/core/clone/trait.Clone.js
-
10implementors/core/cmp/trait.PartialEq.js
-
10implementors/core/fmt/trait.Debug.js
-
10implementors/core/marker/trait.Copy.js
-
10implementors/core/ops/trait.Add.js
-
10implementors/core/ops/trait.Div.js
-
10implementors/core/ops/trait.Mul.js
-
10implementors/core/ops/trait.Neg.js
-
10implementors/core/ops/trait.Sub.js
-
4index.html
-
4jquery.js
-
660main.css
-
915main.js
-
1normalize.css
-
27playpen.js
-
4search-index.js
-
81src/complex.rs
-
759src/complex/lib.rs.html
-
259src/dft/complex.rs.html
-
133src/dft/lib.rs.html
-
323src/dft/real.rs.html
-
18src/lib.rs
-
113src/real.rs
-
721tests/fixtures.rs
-
76tests/lib.rs
@ -1,2 +0,0 @@ |
|||
Cargo.lock |
|||
target |
@ -1,12 +0,0 @@ |
|||
language: rust |
|||
sudo: false |
|||
|
|||
after_success: |
|||
- curl https://stainless-steel.github.io/travis/after_success.sh | bash |
|||
|
|||
env: |
|||
global: |
|||
secure: iwJM3WKH92yxKSdRkab/R8nO3BRzxyxK3QvyPBH2gEUhd1/ZTjLQcWbpF9Gv0Kpkbm1hNAAPTNN787qNFv8qJ/Ebr+VTkxpAQrh1wX37fMF1gqWdaSeZQM0xeCzptoOrIz/FgbBcTV7ndx+Fc4g0dwtfBPZf2/blwg4F9CjqbYpnc5M3iNN9GuLwBU3FCM4nr5OyqZji+EweoxAN3bk17lmlCoTlggap2MY5MHGo+vslMvlAvd7vj1dNCo8ytQC4VyfUriXSQKmKSFl7WHsEQm6hIWvMLVDx6zyUvYfZfYqtmuthiAAj56tVpXCzNoI/v2bjMDlAajoQsn3arTEmL21CugsEsc6nvmEpbuziw9WPLBKdgBALepbHDncLLo4vLXexJOwZgZKoAK/DqboFjW9nevxbJh6Qz0LyRMKdSNUgxe90i/yNxcQaEJHoonB5QjAgTfzMmHCm+4tAiwp8S6sqg8GNKIaTo7Tt40mxFycXIC73YnIe5whLDbrcyJIozntL03B+VeMZMCKNfl+Q63O3NCnxSpog6rQSNYNXazUk2CzT7PonQ72j0b8WFpl1kBtuG4zctN2+t7toi0rJnd7vPfUMs0G2p4LRZ5VESoqOrFHKwEtSS7xIKUuscfCPNUcVvb9aWoAJNTdw/ouLARVQMOk/jscf6SU50zuszhU= |
|||
|
|||
notifications: |
|||
email: false |
@ -1,16 +0,0 @@ |
|||
[package] |
|||
name = "dft" |
|||
version = "0.2.1" |
|||
authors = ["Ivan Ukhov <ivan.ukhov@gmail.com>"] |
|||
license = "MIT" |
|||
repository = "https://github.com/stainless-steel/dft" |
|||
homepage = "https://github.com/stainless-steel/dft" |
|||
documentation = "https://stainless-steel.github.io/dft" |
|||
description = """ |
|||
The package provides an algorithm to compute the discrete Fourier transform.""" |
|||
|
|||
[dependencies] |
|||
complex = "*" |
|||
|
|||
[dev-dependencies] |
|||
assert = "*" |
@ -1,21 +0,0 @@ |
|||
The MIT License (MIT) |
|||
|
|||
Copyright 2015 Ivan Ukhov |
|||
|
|||
Permission is hereby granted, free of charge, to any person obtaining a copy |
|||
of this software and associated documentation files (the "Software"), to deal |
|||
in the Software without restriction, including without limitation the rights |
|||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|||
copies of the Software, and to permit persons to whom the Software is |
|||
furnished to do so, subject to the following conditions: |
|||
|
|||
The above copyright notice and this permission notice shall be included in |
|||
all copies or substantial portions of the Software. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|||
THE SOFTWARE. |
@ -1,20 +0,0 @@ |
|||
# DFT [![Version][version-img]][version-url] [![Status][status-img]][status-url] |
|||
|
|||
The package provides an algorithm to compute the [discrete Fourier |
|||
transform][1]. |
|||
|
|||
## [Documentation][doc] |
|||
|
|||
## Contributing |
|||
|
|||
1. Fork the project. |
|||
2. Implement your idea. |
|||
3. Open a pull request. |
|||
|
|||
[1]: https://en.wikipedia.org/wiki/Discrete_Fourier_transform |
|||
|
|||
[version-img]: http://stainless-steel.github.io/images/crates.svg |
|||
[version-url]: https://crates.io/crates/dft |
|||
[status-img]: https://travis-ci.org/stainless-steel/dft.svg?branch=master |
|||
[status-url]: https://travis-ci.org/stainless-steel/dft |
|||
[doc]: https://stainless-steel.github.io/dft |
@ -1,32 +0,0 @@ |
|||
#![feature(test)]
|
|||
|
|||
extern crate complex;
|
|||
extern crate dft;
|
|||
extern crate test;
|
|||
|
|||
use complex::c64;
|
|||
use test::{Bencher, black_box};
|
|||
|
|||
#[bench] fn complex_forward_0004(bencher: &mut Bencher) { complex_forward( 4, bencher); }
|
|||
#[bench] fn complex_forward_0016(bencher: &mut Bencher) { complex_forward( 16, bencher); }
|
|||
#[bench] fn complex_forward_0064(bencher: &mut Bencher) { complex_forward( 64, bencher); }
|
|||
#[bench] fn complex_forward_0256(bencher: &mut Bencher) { complex_forward( 256, bencher); }
|
|||
#[bench] fn complex_forward_1024(bencher: &mut Bencher) { complex_forward(1024, bencher); }
|
|||
#[bench] fn complex_forward_4096(bencher: &mut Bencher) { complex_forward(4096, bencher); }
|
|||
|
|||
#[bench] fn real_forward_0004(bencher: &mut Bencher) { real_forward( 4, bencher); }
|
|||
#[bench] fn real_forward_0016(bencher: &mut Bencher) { real_forward( 16, bencher); }
|
|||
#[bench] fn real_forward_0064(bencher: &mut Bencher) { real_forward( 64, bencher); }
|
|||
#[bench] fn real_forward_0256(bencher: &mut Bencher) { real_forward( 256, bencher); }
|
|||
#[bench] fn real_forward_1024(bencher: &mut Bencher) { real_forward(1024, bencher); }
|
|||
#[bench] fn real_forward_4096(bencher: &mut Bencher) { real_forward(4096, bencher); }
|
|||
|
|||
fn complex_forward(size: usize, bencher: &mut Bencher) {
|
|||
let mut data = vec![c64(42.0, 69.0); size];
|
|||
bencher.iter(|| black_box(dft::complex::forward(&mut data)));
|
|||
}
|
|||
|
|||
fn real_forward(size: usize, bencher: &mut Bencher) {
|
|||
let mut data = vec![42.0; 2 * size];
|
|||
bencher.iter(|| black_box(dft::real::forward(&mut data)));
|
|||
}
|
@ -0,0 +1,149 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `complex` crate."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, complex"> |
|||
|
|||
<title>complex - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'></p><script>window.sidebarCurrent = {name: 'complex', ty: 'mod', relpath: '../'};</script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content mod"> |
|||
<h1 class='fqn'><span class='in-band'>Crate <a class='mod' href=''>complex</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-0' class='srclink' href='../src/complex/lib.rs.html#1-331' title='goto source code'>[src]</a></span></h1> |
|||
<div class='docblock'><p><a href="https://en.wikipedia.org/wiki/Complex_number">Complex numbers</a>.</p> |
|||
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2> |
|||
<table> |
|||
<tr class=' module-item'> |
|||
<td><a class='struct' href='struct.c32.html' |
|||
title='complex::c32'>c32</a></td> |
|||
<td class='docblock short'> |
|||
<p>A complex number with 32-bit parts.</p> |
|||
|
|||
</td> |
|||
</tr> |
|||
|
|||
<tr class=' module-item'> |
|||
<td><a class='struct' href='struct.c64.html' |
|||
title='complex::c64'>c64</a></td> |
|||
<td class='docblock short'> |
|||
<p>A complex number with 64-bit parts.</p> |
|||
|
|||
</td> |
|||
</tr> |
|||
</table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2> |
|||
<table> |
|||
<tr class=' module-item'> |
|||
<td><a class='trait' href='trait.Complex.html' |
|||
title='complex::Complex'>Complex</a></td> |
|||
<td class='docblock short'> |
|||
<p>A complex number.</p> |
|||
|
|||
</td> |
|||
</tr> |
|||
|
|||
<tr class=' module-item'> |
|||
<td><a class='trait' href='trait.Number.html' |
|||
title='complex::Number'>Number</a></td> |
|||
<td class='docblock short'> |
|||
<p>A number.</p> |
|||
|
|||
</td> |
|||
</tr> |
|||
|
|||
<tr class=' module-item'> |
|||
<td><a class='trait' href='trait.Real.html' |
|||
title='complex::Real'>Real</a></td> |
|||
<td class='docblock short'> |
|||
<p>A real number.</p> |
|||
|
|||
</td> |
|||
</tr> |
|||
</table></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../"; |
|||
window.currentCrate = "complex"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../jquery.js"></script> |
|||
<script src="../main.js"></script> |
|||
|
|||
<script async src="../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1 @@ |
|||
initSidebarItems({"struct":[["c32","A complex number with 32-bit parts."],["c64","A complex number with 64-bit parts."]],"trait":[["Complex","A complex number."],["Number","A number."],["Real","A real number."]]}); |
@ -0,0 +1,136 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `c32` struct in crate `complex`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, c32"> |
|||
|
|||
<title>complex::c32 - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'><a href='index.html'>complex</a></p><script>window.sidebarCurrent = {name: 'c32', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content struct"> |
|||
<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>complex</a>::<wbr><a class='struct' href=''>c32</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-123' class='srclink' href='../src/complex/lib.rs.html#66' title='goto source code'>[src]</a></span></h1> |
|||
<pre class='rust struct'>pub struct c32(pub <a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>, pub <a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>);</pre><div class='docblock'><p>A complex number with 32-bit parts.</p> |
|||
</div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl <a class='trait' href='../complex/trait.Number.html' title='complex::Number'>Number</a> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl <a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Complex</a> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'><h4 id='assoc_type.Real' class='type'><code>type Real = <a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a></code></h4> |
|||
<h4 id='method.new' class='method'><code>fn <a href='../complex/trait.Complex.html#method.new' class='fnname'>new</a>(re: Self::Real, im: Self::Real) -> <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h4> |
|||
<h4 id='method.from_polar' class='method'><code>fn <a href='../complex/trait.Complex.html#method.from_polar' class='fnname'>from_polar</a>(abs: Self::Real, arg: Self::Real) -> Self</code></h4> |
|||
<h4 id='method.re' class='method'><code>fn <a href='../complex/trait.Complex.html#method.re' class='fnname'>re</a>(&self) -> Self::Real</code></h4> |
|||
<h4 id='method.re_mut' class='method'><code>fn <a href='../complex/trait.Complex.html#method.re_mut' class='fnname'>re_mut</a>(&mut self) -> &mut Self::Real</code></h4> |
|||
<h4 id='method.im' class='method'><code>fn <a href='../complex/trait.Complex.html#method.im' class='fnname'>im</a>(&self) -> Self::Real</code></h4> |
|||
<h4 id='method.im_mut' class='method'><code>fn <a href='../complex/trait.Complex.html#method.im_mut' class='fnname'>im_mut</a>(&mut self) -> &mut Self::Real</code></h4> |
|||
<h4 id='method.abs' class='method'><code>fn <a href='../complex/trait.Complex.html#method.abs' class='fnname'>abs</a>(&self) -> Self::Real</code></h4> |
|||
<h4 id='method.arg' class='method'><code>fn <a href='../complex/trait.Complex.html#method.arg' class='fnname'>arg</a>(&self) -> Self::Real</code></h4> |
|||
<h4 id='method.to_polar' class='method'><code>fn <a href='../complex/trait.Complex.html#method.to_polar' class='fnname'>to_polar</a>(&self) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>, Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>)</a></code></h4> |
|||
<h4 id='method.conj' class='method'><code>fn <a href='../complex/trait.Complex.html#method.conj' class='fnname'>conj</a>(&self) -> Self</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html' title='core::ops::Add'>Add</a> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.add' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html#method.add' class='fnname'>add</a>(self, rhs: Self) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html' title='core::ops::Add'>Add</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.add' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html#method.add' class='fnname'>add</a>(self, rhs: <a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html' title='core::ops::Div'>Div</a> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.div' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html#method.div' class='fnname'>div</a>(self, rhs: Self) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html' title='core::ops::Div'>Div</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.div' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html#method.div' class='fnname'>div</a>(self, rhs: <a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html' title='core::ops::Mul'>Mul</a> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.mul' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html#method.mul' class='fnname'>mul</a>(self, rhs: Self) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html' title='core::ops::Mul'>Mul</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.mul' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html#method.mul' class='fnname'>mul</a>(self, rhs: <a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Neg.html' title='core::ops::Neg'>Neg</a> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.neg' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Neg.html#method.neg' class='fnname'>neg</a>(self) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html' title='core::ops::Sub'>Sub</a> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.sub' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html#method.sub' class='fnname'>sub</a>(self, rhs: Self) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html' title='core::ops::Sub'>Sub</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.sub' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html#method.sub' class='fnname'>sub</a>(self, rhs: <a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>) -> Self::Output</code></h4> |
|||
</div><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, __arg_0: &<a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> |
|||
<h4 id='method.ne' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, __arg_0: &<a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#method.fmt' class='fnname'>fmt</a>(&self, __arg_0: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='http://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone' class='fnname'>clone</a>(&self) -> <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></h4> |
|||
<h4 id='method.clone_from' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code></h4> |
|||
</div></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../"; |
|||
window.currentCrate = "complex"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../jquery.js"></script> |
|||
<script src="../main.js"></script> |
|||
|
|||
<script async src="../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,136 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `c64` struct in crate `complex`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, c64"> |
|||
|
|||
<title>complex::c64 - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'><a href='index.html'>complex</a></p><script>window.sidebarCurrent = {name: 'c64', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content struct"> |
|||
<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>complex</a>::<wbr><a class='struct' href=''>c64</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-284' class='srclink' href='../src/complex/lib.rs.html#71' title='goto source code'>[src]</a></span></h1> |
|||
<pre class='rust struct'>pub struct c64(pub <a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>, pub <a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>);</pre><div class='docblock'><p>A complex number with 64-bit parts.</p> |
|||
</div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl <a class='trait' href='../complex/trait.Number.html' title='complex::Number'>Number</a> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl <a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Complex</a> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'><h4 id='assoc_type.Real' class='type'><code>type Real = <a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a></code></h4> |
|||
<h4 id='method.new' class='method'><code>fn <a href='../complex/trait.Complex.html#method.new' class='fnname'>new</a>(re: Self::Real, im: Self::Real) -> <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h4> |
|||
<h4 id='method.from_polar' class='method'><code>fn <a href='../complex/trait.Complex.html#method.from_polar' class='fnname'>from_polar</a>(abs: Self::Real, arg: Self::Real) -> Self</code></h4> |
|||
<h4 id='method.re' class='method'><code>fn <a href='../complex/trait.Complex.html#method.re' class='fnname'>re</a>(&self) -> Self::Real</code></h4> |
|||
<h4 id='method.re_mut' class='method'><code>fn <a href='../complex/trait.Complex.html#method.re_mut' class='fnname'>re_mut</a>(&mut self) -> &mut Self::Real</code></h4> |
|||
<h4 id='method.im' class='method'><code>fn <a href='../complex/trait.Complex.html#method.im' class='fnname'>im</a>(&self) -> Self::Real</code></h4> |
|||
<h4 id='method.im_mut' class='method'><code>fn <a href='../complex/trait.Complex.html#method.im_mut' class='fnname'>im_mut</a>(&mut self) -> &mut Self::Real</code></h4> |
|||
<h4 id='method.abs' class='method'><code>fn <a href='../complex/trait.Complex.html#method.abs' class='fnname'>abs</a>(&self) -> Self::Real</code></h4> |
|||
<h4 id='method.arg' class='method'><code>fn <a href='../complex/trait.Complex.html#method.arg' class='fnname'>arg</a>(&self) -> Self::Real</code></h4> |
|||
<h4 id='method.to_polar' class='method'><code>fn <a href='../complex/trait.Complex.html#method.to_polar' class='fnname'>to_polar</a>(&self) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>, Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>)</a></code></h4> |
|||
<h4 id='method.conj' class='method'><code>fn <a href='../complex/trait.Complex.html#method.conj' class='fnname'>conj</a>(&self) -> Self</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html' title='core::ops::Add'>Add</a> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.add' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html#method.add' class='fnname'>add</a>(self, rhs: Self) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html' title='core::ops::Add'>Add</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.add' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html#method.add' class='fnname'>add</a>(self, rhs: <a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html' title='core::ops::Div'>Div</a> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.div' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html#method.div' class='fnname'>div</a>(self, rhs: Self) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html' title='core::ops::Div'>Div</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.div' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html#method.div' class='fnname'>div</a>(self, rhs: <a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html' title='core::ops::Mul'>Mul</a> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.mul' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html#method.mul' class='fnname'>mul</a>(self, rhs: Self) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html' title='core::ops::Mul'>Mul</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.mul' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html#method.mul' class='fnname'>mul</a>(self, rhs: <a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Neg.html' title='core::ops::Neg'>Neg</a> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.neg' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Neg.html#method.neg' class='fnname'>neg</a>(self) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html' title='core::ops::Sub'>Sub</a> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.sub' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html#method.sub' class='fnname'>sub</a>(self, rhs: Self) -> Self::Output</code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html' title='core::ops::Sub'>Sub</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'><h4 id='assoc_type.Output' class='type'><code>type Output = Self</code></h4> |
|||
<h4 id='method.sub' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html#method.sub' class='fnname'>sub</a>(self, rhs: <a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>) -> Self::Output</code></h4> |
|||
</div><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, __arg_0: &<a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> |
|||
<h4 id='method.ne' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, __arg_0: &<a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#method.fmt' class='fnname'>fmt</a>(&self, __arg_0: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='http://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4> |
|||
</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone' class='fnname'>clone</a>(&self) -> <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></h4> |
|||
<h4 id='method.clone_from' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code></h4> |
|||
</div></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../"; |
|||
window.currentCrate = "complex"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../jquery.js"></script> |
|||
<script src="../main.js"></script> |
|||
|
|||
<script async src="../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,142 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `Complex` trait in crate `complex`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, Complex"> |
|||
|
|||
<title>complex::Complex - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'><a href='index.html'>complex</a></p><script>window.sidebarCurrent = {name: 'Complex', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content trait"> |
|||
<h1 class='fqn'><span class='in-band'>Trait <a href='index.html'>complex</a>::<wbr><a class='trait' href=''>Complex</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-34' class='srclink' href='../src/complex/lib.rs.html#22-61' title='goto source code'>[src]</a></span></h1> |
|||
<pre class='rust trait'>pub trait Complex: <a class='trait' href='../complex/trait.Number.html' title='complex::Number'>Number</a> { |
|||
type Real: <a class='trait' href='../complex/trait.Real.html' title='complex::Real'>Real</a>; |
|||
fn <a href='#tymethod.new' class='fnname'>new</a>(Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>, Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>) -> Self; |
|||
fn <a href='#tymethod.from_polar' class='fnname'>from_polar</a>(Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>, Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>) -> Self; |
|||
fn <a href='#tymethod.re' class='fnname'>re</a>(&self) -> Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>; |
|||
fn <a href='#tymethod.re_mut' class='fnname'>re_mut</a>(&mut self) -> &mut Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>; |
|||
fn <a href='#tymethod.im' class='fnname'>im</a>(&self) -> Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>; |
|||
fn <a href='#tymethod.im_mut' class='fnname'>im_mut</a>(&mut self) -> &mut Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>; |
|||
fn <a href='#tymethod.abs' class='fnname'>abs</a>(&self) -> Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>; |
|||
fn <a href='#tymethod.arg' class='fnname'>arg</a>(&self) -> Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>; |
|||
|
|||
fn <a href='#method.to_polar' class='fnname'>to_polar</a>(&self) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>, Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>)</a> { ... } |
|||
fn <a href='#method.conj' class='fnname'>conj</a>(&self) -> Self { ... } |
|||
}</pre><div class='docblock'><p>A complex number.</p> |
|||
</div> |
|||
<h2 id='associated-types'>Associated Types</h2> |
|||
<div class='methods'> |
|||
<h3 id='associatedtype.Real' class='method stab '><code>type Real: <a class='trait' href='../complex/trait.Real.html' title='complex::Real'>Real</a></code></h3><div class='docblock'><p>A real number.</p> |
|||
</div></div> |
|||
<h2 id='required-methods'>Required Methods</h2> |
|||
<div class='methods'> |
|||
<h3 id='tymethod.new' class='method stab '><code>fn <a href='#tymethod.new' class='fnname'>new</a>(Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>, Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>) -> Self</code></h3><div class='docblock'><p>Create a complex number from a real and an imaginary part.</p> |
|||
</div><h3 id='tymethod.from_polar' class='method stab '><code>fn <a href='#tymethod.from_polar' class='fnname'>from_polar</a>(Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>, Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>) -> Self</code></h3><div class='docblock'><p>Create a complex number from a modulus and an argument.</p> |
|||
</div><h3 id='tymethod.re' class='method stab '><code>fn <a href='#tymethod.re' class='fnname'>re</a>(&self) -> Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a></code></h3><div class='docblock'><p>Return the real part.</p> |
|||
</div><h3 id='tymethod.re_mut' class='method stab '><code>fn <a href='#tymethod.re_mut' class='fnname'>re_mut</a>(&mut self) -> &mut Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a></code></h3><div class='docblock'><p>Return the real part as a mutable reference.</p> |
|||
</div><h3 id='tymethod.im' class='method stab '><code>fn <a href='#tymethod.im' class='fnname'>im</a>(&self) -> Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a></code></h3><div class='docblock'><p>Return the imaginary part.</p> |
|||
</div><h3 id='tymethod.im_mut' class='method stab '><code>fn <a href='#tymethod.im_mut' class='fnname'>im_mut</a>(&mut self) -> &mut Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a></code></h3><div class='docblock'><p>Return the imaginary part as a mutable reference.</p> |
|||
</div><h3 id='tymethod.abs' class='method stab '><code>fn <a href='#tymethod.abs' class='fnname'>abs</a>(&self) -> Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a></code></h3><div class='docblock'><p>Compute the modulus.</p> |
|||
</div><h3 id='tymethod.arg' class='method stab '><code>fn <a href='#tymethod.arg' class='fnname'>arg</a>(&self) -> Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a></code></h3><div class='docblock'><p>Compute the argument.</p> |
|||
</div></div> |
|||
<h2 id='provided-methods'>Provided Methods</h2> |
|||
<div class='methods'> |
|||
<h3 id='method.to_polar' class='method stab '><code>fn <a href='#method.to_polar' class='fnname'>to_polar</a>(&self) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>, Self::<a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Real</a>)</a></code></h3><div class='docblock'><p>Compute the modulus and the argument.</p> |
|||
</div><h3 id='method.conj' class='method stab '><code>fn <a href='#method.conj' class='fnname'>conj</a>(&self) -> Self</code></h3><div class='docblock'><p>Compute the complex conjugate.</p> |
|||
</div></div> |
|||
<h2 id='implementors'>Implementors</h2> |
|||
<ul class='item-list' id='implementors-list'> |
|||
<li><code>impl <a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Complex</a> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></li> |
|||
<li><code>impl <a class='trait' href='../complex/trait.Complex.html' title='complex::Complex'>Complex</a> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></li> |
|||
</ul><script type="text/javascript" async |
|||
src="../implementors/complex/trait.Complex.js"> |
|||
</script></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../"; |
|||
window.currentCrate = "complex"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../jquery.js"></script> |
|||
<script src="../main.js"></script> |
|||
|
|||
<script async src="../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,111 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `Number` trait in crate `complex`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, Number"> |
|||
|
|||
<title>complex::Number - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'><a href='index.html'>complex</a></p><script>window.sidebarCurrent = {name: 'Number', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content trait"> |
|||
<h1 class='fqn'><span class='in-band'>Trait <a href='index.html'>complex</a>::<wbr><a class='trait' href=''>Number</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-11' class='srclink' href='../src/complex/lib.rs.html#9-15' title='goto source code'>[src]</a></span></h1> |
|||
<pre class='rust trait'>pub trait Number: <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html' title='core::ops::Add'>Add</a><Output=Self> + <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html' title='core::ops::Div'>Div</a><Output=Self> + <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html' title='core::ops::Mul'>Mul</a><Output=Self> + <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Neg.html' title='core::ops::Neg'>Neg</a><Output=Self> + <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html' title='core::ops::Sub'>Sub</a><Output=Self> + <a class='trait' href='http://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> + <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> + <a class='trait' href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> { }</pre><div class='docblock'><p>A number.</p> |
|||
</div> |
|||
<h2 id='implementors'>Implementors</h2> |
|||
<ul class='item-list' id='implementors-list'> |
|||
<li><code>impl <a class='trait' href='../complex/trait.Number.html' title='complex::Number'>Number</a> for <a class='struct' href='../complex/struct.c32.html' title='complex::c32'>c32</a></code></li> |
|||
<li><code>impl <a class='trait' href='../complex/trait.Number.html' title='complex::Number'>Number</a> for <a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a></code></li> |
|||
<li><code>impl <a class='trait' href='../complex/trait.Number.html' title='complex::Number'>Number</a> for <a class='struct' href='../complex/struct.c64.html' title='complex::c64'>c64</a></code></li> |
|||
<li><code>impl <a class='trait' href='../complex/trait.Number.html' title='complex::Number'>Number</a> for <a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a></code></li> |
|||
</ul><script type="text/javascript" async |
|||
src="../implementors/complex/trait.Number.js"> |
|||
</script></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../"; |
|||
window.currentCrate = "complex"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../jquery.js"></script> |
|||
<script src="../main.js"></script> |
|||
|
|||
<script async src="../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,109 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `Real` trait in crate `complex`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, Real"> |
|||
|
|||
<title>complex::Real - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'><a href='index.html'>complex</a></p><script>window.sidebarCurrent = {name: 'Real', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content trait"> |
|||
<h1 class='fqn'><span class='in-band'>Trait <a href='index.html'>complex</a>::<wbr><a class='trait' href=''>Real</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-31' class='srclink' href='../src/complex/lib.rs.html#18-19' title='goto source code'>[src]</a></span></h1> |
|||
<pre class='rust trait'>pub trait Real: <a class='trait' href='../complex/trait.Number.html' title='complex::Number'>Number</a> { }</pre><div class='docblock'><p>A real number.</p> |
|||
</div> |
|||
<h2 id='implementors'>Implementors</h2> |
|||
<ul class='item-list' id='implementors-list'> |
|||
<li><code>impl <a class='trait' href='../complex/trait.Real.html' title='complex::Real'>Real</a> for <a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a></code></li> |
|||
<li><code>impl <a class='trait' href='../complex/trait.Real.html' title='complex::Real'>Real</a> for <a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a></code></li> |
|||
</ul><script type="text/javascript" async |
|||
src="../implementors/complex/trait.Real.js"> |
|||
</script></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../"; |
|||
window.currentCrate = "complex"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../jquery.js"></script> |
|||
<script src="../main.js"></script> |
|||
|
|||
<script async src="../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,104 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `backward` fn in crate `dft`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, backward"> |
|||
|
|||
<title>dft::complex::backward - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'><a href='../index.html'>dft</a>::<wbr><a href='index.html'>complex</a></p><script>window.sidebarCurrent = {name: 'backward', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content fn"> |
|||
<h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>dft</a>::<wbr><a href='index.html'>complex</a>::<wbr><a class='fn' href=''>backward</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-64' class='srclink' href='../../src/dft/complex.rs.html#20-24' title='goto source code'>[src]</a></span></h1> |
|||
<pre class='rust fn'>pub fn backward(data: <a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>&mut [</a><a class='struct' href='../../complex/struct.c64.html' title='complex::c64'>c64</a><a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>)</pre><div class='docblock'><p>Perform the backward transform.</p> |
|||
|
|||
<p>The number of points should be a power of two.</p> |
|||
</div></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../../"; |
|||
window.currentCrate = "dft"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../../jquery.js"></script> |
|||
<script src="../../main.js"></script> |
|||
|
|||
<script async src="../../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,104 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `forward` fn in crate `dft`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, forward"> |
|||
|
|||
<title>dft::complex::forward - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'><a href='../index.html'>dft</a>::<wbr><a href='index.html'>complex</a></p><script>window.sidebarCurrent = {name: 'forward', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content fn"> |
|||
<h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>dft</a>::<wbr><a href='index.html'>complex</a>::<wbr><a class='fn' href=''>forward</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-8' class='srclink' href='../../src/dft/complex.rs.html#11-15' title='goto source code'>[src]</a></span></h1> |
|||
<pre class='rust fn'>pub fn forward(data: <a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>&mut [</a><a class='struct' href='../../complex/struct.c64.html' title='complex::c64'>c64</a><a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>)</pre><div class='docblock'><p>Perform the forward transform.</p> |
|||
|
|||
<p>The number of points should be a power of two.</p> |
|||
</div></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../../"; |
|||
window.currentCrate = "dft"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../../jquery.js"></script> |
|||
<script src="../../main.js"></script> |
|||
|
|||
<script async src="../../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,104 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `inverse` fn in crate `dft`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, inverse"> |
|||
|
|||
<title>dft::complex::inverse - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'><a href='../index.html'>dft</a>::<wbr><a href='index.html'>complex</a></p><script>window.sidebarCurrent = {name: 'inverse', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content fn"> |
|||
<h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>dft</a>::<wbr><a href='index.html'>complex</a>::<wbr><a class='fn' href=''>inverse</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-120' class='srclink' href='../../src/dft/complex.rs.html#29-34' title='goto source code'>[src]</a></span></h1> |
|||
<pre class='rust fn'>pub fn inverse(data: <a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>&mut [</a><a class='struct' href='../../complex/struct.c64.html' title='complex::c64'>c64</a><a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>)</pre><div class='docblock'><p>Perform the inverse transform.</p> |
|||
|
|||
<p>The number of points should be a power of two.</p> |
|||
</div></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../../"; |
|||
window.currentCrate = "dft"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../../jquery.js"></script> |
|||
<script src="../../main.js"></script> |
|||
|
|||
<script async src="../../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,130 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `complex` mod in crate `dft`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, complex"> |
|||
|
|||
<title>dft::complex - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'><a href='../index.html'>dft</a></p><script>window.sidebarCurrent = {name: 'complex', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content mod"> |
|||
<h1 class='fqn'><span class='in-band'>Module <a href='../index.html'>dft</a>::<wbr><a class='mod' href=''>complex</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-5' class='srclink' href='../../src/dft/complex.rs.html#1-81' title='goto source code'>[src]</a></span></h1> |
|||
<div class='docblock'><p>Transformation of complex data.</p> |
|||
</div><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2> |
|||
<table> |
|||
<tr class=' module-item'> |
|||
<td><a class='fn' href='fn.backward.html' |
|||
title='dft::complex::backward'>backward</a></td> |
|||
<td class='docblock short'> |
|||
<p>Perform the backward transform.</p> |
|||
|
|||
</td> |
|||
</tr> |
|||
|
|||
<tr class=' module-item'> |
|||
<td><a class='fn' href='fn.forward.html' |
|||
title='dft::complex::forward'>forward</a></td> |
|||
<td class='docblock short'> |
|||
<p>Perform the forward transform.</p> |
|||
|
|||
</td> |
|||
</tr> |
|||
|
|||
<tr class=' module-item'> |
|||
<td><a class='fn' href='fn.inverse.html' |
|||
title='dft::complex::inverse'>inverse</a></td> |
|||
<td class='docblock short'> |
|||
<p>Perform the inverse transform.</p> |
|||
|
|||
</td> |
|||
</tr> |
|||
</table></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../../"; |
|||
window.currentCrate = "dft"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../../jquery.js"></script> |
|||
<script src="../../main.js"></script> |
|||
|
|||
<script async src="../../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1 @@ |
|||
initSidebarItems({"fn":[["backward","Perform the backward transform."],["forward","Perform the forward transform."],["inverse","Perform the inverse transform."]]}); |
@ -0,0 +1,121 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `dft` crate."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, dft"> |
|||
|
|||
<title>dft - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'></p><script>window.sidebarCurrent = {name: 'dft', ty: 'mod', relpath: '../'};</script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content mod"> |
|||
<h1 class='fqn'><span class='in-band'>Crate <a class='mod' href=''>dft</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-0' class='srclink' href='../src/dft/lib.rs.html#1-18' title='goto source code'>[src]</a></span></h1> |
|||
<div class='docblock'><p><a href="https://en.wikipedia.org/wiki/Discrete_Fourier_transform">Discrete Fourier transform</a>.</p> |
|||
</div><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2> |
|||
<table> |
|||
<tr class=' module-item'> |
|||
<td><a class='mod' href='complex/index.html' |
|||
title='dft::complex'>complex</a></td> |
|||
<td class='docblock short'> |
|||
<p>Transformation of complex data.</p> |
|||
|
|||
</td> |
|||
</tr> |
|||
|
|||
<tr class=' module-item'> |
|||
<td><a class='mod' href='real/index.html' |
|||
title='dft::real'>real</a></td> |
|||
<td class='docblock short'> |
|||
<p>Transformation of real data.</p> |
|||
|
|||
</td> |
|||
</tr> |
|||
</table></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../"; |
|||
window.currentCrate = "dft"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../jquery.js"></script> |
|||
<script src="../main.js"></script> |
|||
|
|||
<script async src="../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,105 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `backward` fn in crate `dft`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, backward"> |
|||
|
|||
<title>dft::real::backward - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'><a href='../index.html'>dft</a>::<wbr><a href='index.html'>real</a></p><script>window.sidebarCurrent = {name: 'backward', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content fn"> |
|||
<h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>dft</a>::<wbr><a href='index.html'>real</a>::<wbr><a class='fn' href=''>backward</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-563' class='srclink' href='../../src/dft/real.rs.html#35-39' title='goto source code'>[src]</a></span></h1> |
|||
<pre class='rust fn'>pub fn backward(data: <a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>&mut [</a><a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a><a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>)</pre><div class='docblock'><p>Perform the backward transform.</p> |
|||
|
|||
<p>The number of points should be a power of two. The data should be packed as |
|||
described in <code>real::forward</code>.</p> |
|||
</div></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../../"; |
|||
window.currentCrate = "dft"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../../jquery.js"></script> |
|||
<script src="../../main.js"></script> |
|||
|
|||
<script async src="../../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,115 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `forward` fn in crate `dft`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, forward"> |
|||
|
|||
<title>dft::real::forward - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'><a href='../index.html'>dft</a>::<wbr><a href='index.html'>real</a></p><script>window.sidebarCurrent = {name: 'forward', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content fn"> |
|||
<h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>dft</a>::<wbr><a href='index.html'>real</a>::<wbr><a class='fn' href=''>forward</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-485' class='srclink' href='../../src/dft/real.rs.html#25-29' title='goto source code'>[src]</a></span></h1> |
|||
<pre class='rust fn'>pub fn forward(data: <a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>&mut [</a><a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a><a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>)</pre><div class='docblock'><p>Perform the forward transform.</p> |
|||
|
|||
<p>The number of points should be a power of two. The data are replaced by the |
|||
positive frequency half of their complex Fourier transform. The real-valued |
|||
first and last components of the complex transform are returned as elements |
|||
<code>data[0]</code> and <code>data[1]</code>, respectively.</p> |
|||
|
|||
<h2 id="references" class='section-header'><a |
|||
href="#references">References</a></h2> |
|||
<ol> |
|||
<li>William H. Press, Saul A. Teukolsky, William T. Vetterling, Brian P. |
|||
Flannery, “Numerical Recipes 3rd Edition: The Art of Scientific |
|||
Computing,” Cambridge University Press, 2007.</li> |
|||
</ol> |
|||
</div></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../../"; |
|||
window.currentCrate = "dft"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../../jquery.js"></script> |
|||
<script src="../../main.js"></script> |
|||
|
|||
<script async src="../../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,105 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `inverse` fn in crate `dft`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, inverse"> |
|||
|
|||
<title>dft::real::inverse - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'><a href='../index.html'>dft</a>::<wbr><a href='index.html'>real</a></p><script>window.sidebarCurrent = {name: 'inverse', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content fn"> |
|||
<h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>dft</a>::<wbr><a href='index.html'>real</a>::<wbr><a class='fn' href=''>inverse</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-641' class='srclink' href='../../src/dft/real.rs.html#45-49' title='goto source code'>[src]</a></span></h1> |
|||
<pre class='rust fn'>pub fn inverse(data: <a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>&mut [</a><a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a><a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>)</pre><div class='docblock'><p>Perform the inverse transform.</p> |
|||
|
|||
<p>The number of points should be a power of two. The data should be packed as |
|||
described in <code>real::forward</code>.</p> |
|||
</div></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../../"; |
|||
window.currentCrate = "dft"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../../jquery.js"></script> |
|||
<script src="../../main.js"></script> |
|||
|
|||
<script async src="../../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,102 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `unpack` fn in crate `dft`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, unpack"> |
|||
|
|||
<title>dft::real::unpack - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'><a href='../index.html'>dft</a>::<wbr><a href='index.html'>real</a></p><script>window.sidebarCurrent = {name: 'unpack', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content fn"> |
|||
<h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>dft</a>::<wbr><a href='index.html'>real</a>::<wbr><a class='fn' href=''>unpack</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-719' class='srclink' href='../../src/dft/real.rs.html#52-68' title='goto source code'>[src]</a></span></h1> |
|||
<pre class='rust fn'>pub fn unpack(data: <a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>&[</a><a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a><a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>) -> <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><<a class='struct' href='../../complex/struct.c64.html' title='complex::c64'>c64</a>></pre><div class='docblock'><p>Unpack a compressed representation produced by <code>real::forward</code>.</p> |
|||
</div></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../../"; |
|||
window.currentCrate = "dft"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../../jquery.js"></script> |
|||
<script src="../../main.js"></script> |
|||
|
|||
<script async src="../../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,139 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="API documentation for the Rust `real` mod in crate `dft`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang, real"> |
|||
|
|||
<title>dft::real - Rust</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
<p class='location'><a href='../index.html'>dft</a></p><script>window.sidebarCurrent = {name: 'real', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script> |
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content mod"> |
|||
<h1 class='fqn'><span class='in-band'>Module <a href='../index.html'>dft</a>::<wbr><a class='mod' href=''>real</a></span><span class='out-of-band'><span id='render-detail'> |
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> |
|||
[<span class='inner'>−</span>] |
|||
</a> |
|||
</span><a id='src-480' class='srclink' href='../../src/dft/real.rs.html#1-113' title='goto source code'>[src]</a></span></h1> |
|||
<div class='docblock'><p>Transformation of real data.</p> |
|||
</div><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2> |
|||
<table> |
|||
<tr class=' module-item'> |
|||
<td><a class='fn' href='fn.backward.html' |
|||
title='dft::real::backward'>backward</a></td> |
|||
<td class='docblock short'> |
|||
<p>Perform the backward transform.</p> |
|||
|
|||
</td> |
|||
</tr> |
|||
|
|||
<tr class=' module-item'> |
|||
<td><a class='fn' href='fn.forward.html' |
|||
title='dft::real::forward'>forward</a></td> |
|||
<td class='docblock short'> |
|||
<p>Perform the forward transform.</p> |
|||
|
|||
</td> |
|||
</tr> |
|||
|
|||
<tr class=' module-item'> |
|||
<td><a class='fn' href='fn.inverse.html' |
|||
title='dft::real::inverse'>inverse</a></td> |
|||
<td class='docblock short'> |
|||
<p>Perform the inverse transform.</p> |
|||
|
|||
</td> |
|||
</tr> |
|||
|
|||
<tr class=' module-item'> |
|||
<td><a class='fn' href='fn.unpack.html' |
|||
title='dft::real::unpack'>unpack</a></td> |
|||
<td class='docblock short'> |
|||
<p>Unpack a compressed representation produced by <code>real::forward</code>.</p> |
|||
|
|||
</td> |
|||
</tr> |
|||
</table></section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../../"; |
|||
window.currentCrate = "dft"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../../jquery.js"></script> |
|||
<script src="../../main.js"></script> |
|||
|
|||
<script async src="../../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1 @@ |
|||
initSidebarItems({"fn":[["backward","Perform the backward transform."],["forward","Perform the forward transform."],["inverse","Perform the inverse transform."],["unpack","Unpack a compressed representation produced by `real::forward`."]]}); |
@ -0,0 +1 @@ |
|||
initSidebarItems({"mod":[["complex","Transformation of complex data."],["real","Transformation of real data."]]}); |
@ -0,0 +1,10 @@ |
|||
(function() {var implementors = {}; |
|||
implementors['complex'] = []; |
|||
|
|||
if (window.register_implementors) { |
|||
window.register_implementors(implementors); |
|||
} else { |
|||
window.pending_implementors = implementors; |
|||
} |
|||
|
|||
})() |
@ -0,0 +1,10 @@ |
|||
(function() {var implementors = {}; |
|||
implementors['complex'] = []; |
|||
|
|||
if (window.register_implementors) { |
|||
window.register_implementors(implementors); |
|||
} else { |
|||
window.pending_implementors = implementors; |
|||
} |
|||
|
|||
})() |
@ -0,0 +1,10 @@ |
|||
(function() {var implementors = {}; |
|||
implementors['complex'] = []; |
|||
|
|||
if (window.register_implementors) { |
|||
window.register_implementors(implementors); |
|||
} else { |
|||
window.pending_implementors = implementors; |
|||
} |
|||
|
|||
})() |
@ -0,0 +1,10 @@ |
|||
(function() {var implementors = {}; |
|||
implementors['complex'] = ["impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>",]; |
|||
|
|||
if (window.register_implementors) { |
|||
window.register_implementors(implementors); |
|||
} else { |
|||
window.pending_implementors = implementors; |
|||
} |
|||
|
|||
})() |
@ -0,0 +1,10 @@ |
|||
(function() {var implementors = {}; |
|||
implementors['complex'] = ["impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>",]; |
|||
|
|||
if (window.register_implementors) { |
|||
window.register_implementors(implementors); |
|||
} else { |
|||
window.pending_implementors = implementors; |
|||
} |
|||
|
|||
})() |
@ -0,0 +1,10 @@ |
|||
(function() {var implementors = {}; |
|||
implementors['complex'] = ["impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>",]; |
|||
|
|||
if (window.register_implementors) { |
|||
window.register_implementors(implementors); |
|||
} else { |
|||
window.pending_implementors = implementors; |
|||
} |
|||
|
|||
})() |
@ -0,0 +1,10 @@ |
|||
(function() {var implementors = {}; |
|||
implementors['complex'] = ["impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>",]; |
|||
|
|||
if (window.register_implementors) { |
|||
window.register_implementors(implementors); |
|||
} else { |
|||
window.pending_implementors = implementors; |
|||
} |
|||
|
|||
})() |
@ -0,0 +1,10 @@ |
|||
(function() {var implementors = {}; |
|||
implementors['complex'] = ["impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html' title='core::ops::Add'>Add</a> for <a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html' title='core::ops::Add'>Add</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>> for <a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html' title='core::ops::Add'>Add</a><<a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>> for <a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html' title='core::ops::Add'>Add</a> for <a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html' title='core::ops::Add'>Add</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>> for <a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Add.html' title='core::ops::Add'>Add</a><<a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>> for <a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>",]; |
|||
|
|||
if (window.register_implementors) { |
|||
window.register_implementors(implementors); |
|||
} else { |
|||
window.pending_implementors = implementors; |
|||
} |
|||
|
|||
})() |
@ -0,0 +1,10 @@ |
|||
(function() {var implementors = {}; |
|||
implementors['complex'] = ["impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html' title='core::ops::Div'>Div</a> for <a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html' title='core::ops::Div'>Div</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>> for <a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html' title='core::ops::Div'>Div</a><<a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>> for <a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html' title='core::ops::Div'>Div</a> for <a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html' title='core::ops::Div'>Div</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>> for <a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Div.html' title='core::ops::Div'>Div</a><<a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>> for <a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>",]; |
|||
|
|||
if (window.register_implementors) { |
|||
window.register_implementors(implementors); |
|||
} else { |
|||
window.pending_implementors = implementors; |
|||
} |
|||
|
|||
})() |
@ -0,0 +1,10 @@ |
|||
(function() {var implementors = {}; |
|||
implementors['complex'] = ["impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html' title='core::ops::Mul'>Mul</a> for <a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html' title='core::ops::Mul'>Mul</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>> for <a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html' title='core::ops::Mul'>Mul</a><<a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>> for <a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html' title='core::ops::Mul'>Mul</a> for <a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html' title='core::ops::Mul'>Mul</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>> for <a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Mul.html' title='core::ops::Mul'>Mul</a><<a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>> for <a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>",]; |
|||
|
|||
if (window.register_implementors) { |
|||
window.register_implementors(implementors); |
|||
} else { |
|||
window.pending_implementors = implementors; |
|||
} |
|||
|
|||
})() |
@ -0,0 +1,10 @@ |
|||
(function() {var implementors = {}; |
|||
implementors['complex'] = ["impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Neg.html' title='core::ops::Neg'>Neg</a> for <a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Neg.html' title='core::ops::Neg'>Neg</a> for <a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>",]; |
|||
|
|||
if (window.register_implementors) { |
|||
window.register_implementors(implementors); |
|||
} else { |
|||
window.pending_implementors = implementors; |
|||
} |
|||
|
|||
})() |
@ -0,0 +1,10 @@ |
|||
(function() {var implementors = {}; |
|||
implementors['complex'] = ["impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html' title='core::ops::Sub'>Sub</a> for <a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html' title='core::ops::Sub'>Sub</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>> for <a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html' title='core::ops::Sub'>Sub</a><<a class='struct' href='complex/struct.c32.html' title='complex::c32'>c32</a>> for <a href='http://doc.rust-lang.org/nightly/std/primitive.f32.html'>f32</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html' title='core::ops::Sub'>Sub</a> for <a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html' title='core::ops::Sub'>Sub</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>> for <a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>","impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Sub.html' title='core::ops::Sub'>Sub</a><<a class='struct' href='complex/struct.c64.html' title='complex::c64'>c64</a>> for <a href='http://doc.rust-lang.org/nightly/std/primitive.f64.html'>f64</a>",]; |
|||
|
|||
if (window.register_implementors) { |
|||
window.register_implementors(implementors); |
|||
} else { |
|||
window.pending_implementors = implementors; |
|||
} |
|||
|
|||
})() |
@ -0,0 +1,4 @@ |
|||
<!DOCTYPE html> |
|||
<link rel='canonical' href='dft/index.html'> |
|||
<meta http-equiv='refresh' content='0; url=dft/index.html'> |
|||
<script>window.location='dft/index.html'</script> |
4
jquery.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,660 @@ |
|||
/** |
|||
* Copyright 2013 The Rust Project Developers. See the COPYRIGHT |
|||
* file at the top-level directory of this distribution and at |
|||
* http://rust-lang.org/COPYRIGHT. |
|||
* |
|||
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
|||
* http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
|||
* <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
|||
* option. This file may not be copied, modified, or distributed |
|||
* except according to those terms. |
|||
*/ |
|||
@font-face { |
|||
font-family: 'Fira Sans'; |
|||
font-style: normal; |
|||
font-weight: 400; |
|||
src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff'); |
|||
} |
|||
@font-face { |
|||
font-family: 'Fira Sans'; |
|||
font-style: normal; |
|||
font-weight: 500; |
|||
src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff'); |
|||
} |
|||
@font-face { |
|||
font-family: 'Source Serif Pro'; |
|||
font-style: normal; |
|||
font-weight: 400; |
|||
src: local('Source Serif Pro'), url("SourceSerifPro-Regular.woff") format('woff'); |
|||
} |
|||
@font-face { |
|||
font-family: 'Source Serif Pro'; |
|||
font-style: italic; |
|||
font-weight: 400; |
|||
src: url("Heuristica-Italic.woff") format('woff'); |
|||
} |
|||
@font-face { |
|||
font-family: 'Source Serif Pro'; |
|||
font-style: normal; |
|||
font-weight: 700; |
|||
src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.woff") format('woff'); |
|||
} |
|||
@font-face { |
|||
font-family: 'Source Code Pro'; |
|||
font-style: normal; |
|||
font-weight: 400; |
|||
src: local('Source Code Pro'), url("SourceCodePro-Regular.woff") format('woff'); |
|||
} |
|||
@font-face { |
|||
font-family: 'Source Code Pro'; |
|||
font-style: normal; |
|||
font-weight: 600; |
|||
src: local('Source Code Pro Semibold'), url("SourceCodePro-Semibold.woff") format('woff'); |
|||
} |
|||
|
|||
@import "normalize.css"; |
|||
|
|||
* { |
|||
-webkit-box-sizing: border-box; |
|||
-moz-box-sizing: border-box; |
|||
box-sizing: border-box; |
|||
} |
|||
|
|||
/* General structure and fonts */ |
|||
|
|||
body { |
|||
color: #333; |
|||
font: 16px/1.4 "Source Serif Pro", Georgia, Times, "Times New Roman", serif; |
|||
margin: 0; |
|||
position: relative; |
|||
padding: 10px 15px 20px 15px; |
|||
|
|||
-webkit-font-feature-settings: "kern", "liga"; |
|||
-moz-font-feature-settings: "kern", "liga"; |
|||
font-feature-settings: "kern", "liga"; |
|||
} |
|||
|
|||
h1 { |
|||
font-size: 1.5em; |
|||
} |
|||
h2 { |
|||
font-size: 1.4em; |
|||
} |
|||
h3 { |
|||
font-size: 1.3em; |
|||
} |
|||
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { |
|||
color: black; |
|||
font-weight: 500; |
|||
margin: 20px 0 15px 0; |
|||
padding-bottom: 6px; |
|||
} |
|||
h1.fqn { |
|||
border-bottom: 1px dashed #D5D5D5; |
|||
margin-top: 0; |
|||
} |
|||
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { |
|||
border-bottom: 1px solid #DDDDDD; |
|||
} |
|||
h3.impl, h3.method, h4.method, h3.type, h4.type { |
|||
font-weight: 600; |
|||
margin-top: 10px; |
|||
margin-bottom: 10px; |
|||
} |
|||
h3.impl, h3.method, h3.type { |
|||
margin-top: 15px; |
|||
} |
|||
h1, h2, h3, h4, section.sidebar, a.source, .search-input, .content table :not(code)>a, .collapse-toggle { |
|||
font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; |
|||
} |
|||
|
|||
ol, ul { |
|||
padding-left: 25px; |
|||
} |
|||
ul ul, ol ul, ul ol, ol ol { |
|||
margin-bottom: 0; |
|||
} |
|||
|
|||
p { |
|||
margin: 0 0 .6em 0; |
|||
} |
|||
|
|||
code, pre { |
|||
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace; |
|||
white-space: pre-wrap; |
|||
} |
|||
.docblock code { |
|||
background-color: #F5F5F5; |
|||
border-radius: 3px; |
|||
padding: 0 0.2em; |
|||
} |
|||
pre { |
|||
background-color: #F5F5F5; |
|||
padding: 14px; |
|||
} |
|||
|
|||
.source pre { |
|||
padding: 20px; |
|||
} |
|||
|
|||
.content.source { |
|||
margin-top: 50px; |
|||
max-width: none; |
|||
overflow: visible; |
|||
margin-left: 0px; |
|||
min-width: 70em; |
|||
} |
|||
|
|||
nav.sub { |
|||
font-size: 16px; |
|||
text-transform: uppercase; |
|||
} |
|||
|
|||
.sidebar { |
|||
width: 200px; |
|||
position: absolute; |
|||
left: 0; |
|||
top: 0; |
|||
min-height: 100%; |
|||
} |
|||
|
|||
.content, nav { max-width: 960px; } |
|||
|
|||
/* Everything else */ |
|||
|
|||
.js-only, .hidden { display: none; } |
|||
|
|||
.sidebar { |
|||
padding: 10px; |
|||
} |
|||
.sidebar img { |
|||
margin: 20px auto; |
|||
display: block; |
|||
} |
|||
|
|||
.sidebar .location { |
|||
font-size: 17px; |
|||
margin: 30px 0 20px 0; |
|||
background: #e1e1e1; |
|||
text-align: center; |
|||
color: #333; |
|||
} |
|||
|
|||
.location a:first-child { font-weight: 500; } |
|||
|
|||
.block { |
|||
padding: 0 10px; |
|||
margin-bottom: 14px; |
|||
} |
|||
.block h2 { |
|||
margin-top: 0; |
|||
margin-bottom: 8px; |
|||
text-align: center; |
|||
} |
|||
|
|||
.block a { |
|||
display: block; |
|||
text-overflow: ellipsis; |
|||
overflow: hidden; |
|||
line-height: 15px; |
|||
padding: 7px 5px; |
|||
font-size: 14px; |
|||
font-weight: 300; |
|||
transition: border 500ms ease-out; |
|||
} |
|||
|
|||
.block a:hover { |
|||
background: #F5F5F5; |
|||
} |
|||
|
|||
.content { |
|||
padding: 15px 0; |
|||
} |
|||
|
|||
.content.source pre.rust { |
|||
white-space: pre; |
|||
overflow: auto; |
|||
padding-left: 0; |
|||
} |
|||
.content pre.line-numbers { |
|||
float: left; |
|||
border: none; |
|||
position: relative; |
|||
|
|||
-webkit-user-select: none; |
|||
-moz-user-select: none; |
|||
-ms-user-select: none; |
|||
user-select: none; |
|||
} |
|||
.line-numbers span { color: #c67e2d; cursor: pointer; } |
|||
.line-numbers .line-highlighted { |
|||
background-color: #f6fdb0 !important; |
|||
} |
|||
|
|||
.content .highlighted { |
|||
color: #000 !important; |
|||
background-color: #ccc; |
|||
} |
|||
.content .highlighted a, .content .highlighted span { color: #000 !important; } |
|||
.content .highlighted.trait { background-color: #fece7e; } |
|||
.content .highlighted.mod { background-color: #afc6e4; } |
|||
.content .highlighted.enum { background-color: #b4d1b9; } |
|||
.content .highlighted.struct { background-color: #e7b1a0; } |
|||
.content .highlighted.fn { background-color: #c6afb3; } |
|||
.content .highlighted.method { background-color: #c6afb3; } |
|||
.content .highlighted.tymethod { background-color: #c6afb3; } |
|||
.content .highlighted.type { background-color: #c6afb3; } |
|||
|
|||
.docblock.short p { |
|||
display: inline; |
|||
} |
|||
|
|||
.docblock.short.nowrap { |
|||
display: block; |
|||
overflow: hidden; |
|||
white-space: nowrap; |
|||
text-overflow: ellipsis; |
|||
} |
|||
|
|||
.docblock.short p { |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
margin: 0; |
|||
} |
|||
.docblock.short code { white-space: nowrap; } |
|||
|
|||
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 { |
|||
border-bottom: 1px solid #DDD; |
|||
} |
|||
|
|||
.docblock h1 { font-size: 1.3em; } |
|||
.docblock h2 { font-size: 1.15em; } |
|||
.docblock h3, .docblock h4, .docblock h5 { font-size: 1em; } |
|||
|
|||
.content .out-of-band { |
|||
font-size: 23px; |
|||
width: 40%; |
|||
margin: 0px; |
|||
padding: 0px; |
|||
text-align: right; |
|||
display: inline-block; |
|||
} |
|||
|
|||
.content .in-band { |
|||
width: 60%; |
|||
margin: 0px; |
|||
padding: 0px; |
|||
display: inline-block; |
|||
} |
|||
|
|||
.content table { |
|||
border-spacing: 0 5px; |
|||
border-collapse: separate; |
|||
} |
|||
.content td { vertical-align: top; } |
|||
.content td:first-child { padding-right: 20px; } |
|||
.content td p:first-child { margin-top: 0; } |
|||
.content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; } |
|||
|
|||
.docblock table { |
|||
border: 1px solid #ddd; |
|||
margin: .5em 0; |
|||
border-collapse: collapse; |
|||
width: 100%; |
|||
} |
|||
|
|||
.docblock table td { |
|||
padding: .5em; |
|||
border-top: 1px dashed #ddd; |
|||
border-bottom: 1px dashed #ddd; |
|||
|
|||
} |
|||
|
|||
.docblock table th { |
|||
padding: .5em; |
|||
text-align: left; |
|||
border-top: 1px solid #ddd; |
|||
border-bottom: 1px solid #ddd; |
|||
} |
|||
|
|||
.content .item-list { |
|||
list-style-type: none; |
|||
padding: 0; |
|||
} |
|||
|
|||
.content .item-list li { margin-bottom: 3px; } |
|||
|
|||
.content .multi-column { |
|||
-moz-column-count: 5; |
|||
-moz-column-gap: 2.5em; |
|||
-webkit-column-count: 5; |
|||
-webkit-column-gap: 2.5em; |
|||
column-count: 5; |
|||
column-gap: 2.5em; |
|||
} |
|||
.content .multi-column li { width: 100%; display: inline-block; } |
|||
|
|||
.content .method { |
|||
font-size: 1em; |
|||
position: relative; |
|||
} |
|||
/* Shift "where ..." part of method definition down a line */ |
|||
.content .method .where { display: block; } |
|||
/* Bit of whitespace to indent it */ |
|||
.content .method .where::before { content: ' '; } |
|||
|
|||
.content .methods > div { margin-left: 40px; } |
|||
|
|||
.content .impl-items .docblock, .content .impl-items .stability { |
|||
margin-left: 40px; |
|||
} |
|||
.content .impl-items .method, .content .impl-items .type { |
|||
margin-left: 20px; |
|||
} |
|||
|
|||
nav { |
|||
border-bottom: 1px solid #e0e0e0; |
|||
padding-bottom: 10px; |
|||
margin-bottom: 10px; |
|||
} |
|||
nav.main { |
|||
padding: 20px 0; |
|||
text-align: center; |
|||
} |
|||
nav.main .current { |
|||
border-top: 1px solid #000; |
|||
border-bottom: 1px solid #000; |
|||
} |
|||
nav.main .separator { |
|||
border: 1px solid #000; |
|||
display: inline-block; |
|||
height: 23px; |
|||
margin: 0 20px; |
|||
} |
|||
nav.sum { text-align: right; } |
|||
nav.sub form { display: inline; } |
|||
|
|||
nav, .content { |
|||
margin-left: 230px; |
|||
} |
|||
|
|||
a { |
|||
text-decoration: none; |
|||
color: #000; |
|||
background: transparent; |
|||
} |
|||
|
|||
.docblock a { |
|||
color: #4e8bca; |
|||
} |
|||
|
|||
.docblock a:hover { |
|||
text-decoration: underline; |
|||
} |
|||
|
|||
.content span.trait, .content a.trait, .block a.current.trait { color: #8866ff; } |
|||
.content span.mod, .content a.mod, block a.current.mod { color: #4d76ae; } |
|||
.content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; } |
|||
.content span.struct, .content a.struct, .block a.current.struct { color: #e53700; } |
|||
.content span.fn, .content a.fn, .block a.current.fn { color: #8c6067; } |
|||
.content span.method, .content a.method, .block a.current.method { color: #8c6067; } |
|||
.content span.tymethod, .content a.tymethod, .block a.current.tymethod { color: #8c6067; } |
|||
.content .fnname { color: #8c6067; } |
|||
|
|||
.search-input { |
|||
width: 100%; |
|||
/* Override Normalize.css: we have margins and do |
|||
not want to overflow - the `moz` attribute is necessary |
|||
until Firefox 29, too early to drop at this point */ |
|||
-moz-box-sizing: border-box !important; |
|||
box-sizing: border-box !important; |
|||
outline: none; |
|||
border: none; |
|||
border-radius: 1px; |
|||
color: #555; |
|||
margin-top: 5px; |
|||
padding: 10px 16px; |
|||
font-size: 17px; |
|||
box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent; |
|||
transition: border-color 300ms ease; |
|||
transition: border-radius 300ms ease-in-out; |
|||
transition: box-shadow 300ms ease-in-out; |
|||
} |
|||
|
|||
.search-input:focus { |
|||
border-color: #66afe9; |
|||
border-radius: 2px; |
|||
border: 0; |
|||
outline: 0; |
|||
box-shadow: 0 0 8px #078dd8; |
|||
} |
|||
|
|||
.search-results .desc { |
|||
white-space: nowrap; |
|||
text-overflow: ellipsis; |
|||
overflow: hidden; |
|||
display: block; |
|||
} |
|||
|
|||
.search-results a { |
|||
display: block; |
|||
} |
|||
|
|||
.content .search-results td:first-child { padding-right: 0; } |
|||
.content .search-results td:first-child a { padding-right: 10px; } |
|||
|
|||
#help { |
|||
background: #e9e9e9; |
|||
border-radius: 4px; |
|||
box-shadow: 0 0 6px rgba(0,0,0,.2); |
|||
position: absolute; |
|||
top: 300px; |
|||
left: 50%; |
|||
margin-top: -125px; |
|||
margin-left: -275px; |
|||
width: 550px; |
|||
height: 300px; |
|||
border: 1px solid #bfbfbf; |
|||
} |
|||
|
|||
#help dt { |
|||
float: left; |
|||
border-radius: 3px; |
|||
border: 1px solid #bfbfbf; |
|||
background: #fff; |
|||
width: 23px; |
|||
text-align: center; |
|||
clear: left; |
|||
display: block; |
|||
margin-top: -1px; |
|||
} |
|||
#help dd { margin: 5px 33px; } |
|||
#help .infos { padding-left: 0; } |
|||
#help h1 { margin-top: 0; } |
|||
#help div { |
|||
width: 50%; |
|||
float: left; |
|||
padding: 20px; |
|||
} |
|||
|
|||
em.stab.unstable { background: #FFF5D6; border-color: #FFC600; } |
|||
em.stab.deprecated { background: #F3DFFF; border-color: #7F0087; } |
|||
em.stab { |
|||
display: inline-block; |
|||
border-width: 1px; |
|||
border-style: solid; |
|||
padding: 3px; |
|||
margin-bottom: 5px; |
|||
font-size: 90%; |
|||
font-style: normal; |
|||
} |
|||
em.stab p { |
|||
display: inline; |
|||
} |
|||
|
|||
.module-item .stab { |
|||
border-width: 0; |
|||
padding: 0; |
|||
margin: 0; |
|||
background: inherit !important; |
|||
} |
|||
|
|||
.module-item.unstable { |
|||
opacity: 0.65; |
|||
} |
|||
|
|||
td.summary-column { |
|||
width: 100%; |
|||
} |
|||
|
|||
.summary { |
|||
padding-right: 0px; |
|||
} |
|||
|
|||
:target { background: #FDFFD3; } |
|||
.line-numbers :target { background-color: transparent; } |
|||
|
|||
/* Code highlighting */ |
|||
pre.rust .kw { color: #8959A8; } |
|||
pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; } |
|||
pre.rust .number, pre.rust .string { color: #718C00; } |
|||
pre.rust .self, pre.rust .boolval, pre.rust .prelude-val, |
|||
pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; } |
|||
pre.rust .comment { color: #8E908C; } |
|||
pre.rust .doccomment { color: #4D4D4C; } |
|||
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; } |
|||
pre.rust .lifetime { color: #B76514; } |
|||
|
|||
.rusttest { display: none; } |
|||
pre.rust { position: relative; } |
|||
.test-arrow { |
|||
display: inline-block; |
|||
position: absolute; |
|||
top: 0; |
|||
right: 10px; |
|||
font-size: 150%; |
|||
-webkit-transform: scaleX(-1); |
|||
transform: scaleX(-1); |
|||
} |
|||
|
|||
.methods .section-header { |
|||
/* Override parent class attributes. */ |
|||
border-bottom: none !important; |
|||
font-size: 1.1em !important; |
|||
margin: 0 0 -5px; |
|||
padding: 0; |
|||
} |
|||
|
|||
.section-header:hover a:after { |
|||
content: '\2002\00a7\2002'; |
|||
} |
|||
|
|||
.section-header:hover a { |
|||
text-decoration: none; |
|||
} |
|||
|
|||
.section-header a { |
|||
color: inherit; |
|||
} |
|||
|
|||
.collapse-toggle { |
|||
font-weight: 300; |
|||
position: absolute; |
|||
left: -23px; |
|||
color: #999; |
|||
top: 0; |
|||
} |
|||
|
|||
.toggle-wrapper > .collapse-toggle { |
|||
left: -24px; |
|||
margin-top: 0px; |
|||
} |
|||
|
|||
.toggle-wrapper { |
|||
position: relative; |
|||
} |
|||
|
|||
.toggle-wrapper.collapsed { |
|||
height: 1em; |
|||
transition: height .2s; |
|||
} |
|||
|
|||
.collapse-toggle > .inner { |
|||
display: inline-block; |
|||
width: 1.2ch; |
|||
text-align: center; |
|||
} |
|||
|
|||
.toggle-label { |
|||
color: #999; |
|||
} |
|||
|
|||
|
|||
|
|||
/* Media Queries */ |
|||
|
|||
@media (max-width: 700px) { |
|||
body { |
|||
padding-top: 0px; |
|||
} |
|||
|
|||
.sidebar { |
|||
height: 40px; |
|||
min-height: 40px; |
|||
width: 100%; |
|||
margin: 0px; |
|||
padding: 0px; |
|||
position: static; |
|||
} |
|||
|
|||
.sidebar .location { |
|||
float: left; |
|||
margin: 0px; |
|||
padding: 5px; |
|||
width: 60%; |
|||
background: inherit; |
|||
text-align: left; |
|||
font-size: 24px; |
|||
} |
|||
|
|||
.sidebar img { |
|||
width: 35px; |
|||
margin-top: 5px; |
|||
margin-bottom: 0px; |
|||
float: left; |
|||
} |
|||
|
|||
nav.sub { |
|||
margin: 0 auto; |
|||
} |
|||
|
|||
.sidebar .block { |
|||
display: none; |
|||
} |
|||
|
|||
.content { |
|||
margin-left: 0px; |
|||
} |
|||
|
|||
.content .in-band { |
|||
width: 100%; |
|||
} |
|||
|
|||
.content .out-of-band { |
|||
display: none; |
|||
} |
|||
|
|||
.toggle-wrapper > .collapse-toggle { |
|||
left: 0px; |
|||
} |
|||
|
|||
.toggle-wrapper { |
|||
height: 1.5em; |
|||
} |
|||
} |
|||
|
|||
@media print { |
|||
nav.sub, .content .out-of-band, .collapse-toggle { |
|||
display: none; |
|||
} |
|||
} |
@ -0,0 +1,915 @@ |
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
|||
// file at the top-level directory of this distribution and at
|
|||
// http://rust-lang.org/COPYRIGHT.
|
|||
//
|
|||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|||
// option. This file may not be copied, modified, or distributed
|
|||
// except according to those terms.
|
|||
|
|||
/*jslint browser: true, es5: true */ |
|||
/*globals $: true, rootPath: true */ |
|||
|
|||
(function() { |
|||
"use strict"; |
|||
var resizeTimeout, interval; |
|||
|
|||
// This mapping table should match the discriminants of
|
|||
// `rustdoc::html::item_type::ItemType` type in Rust.
|
|||
var itemTypes = ["mod", |
|||
"externcrate", |
|||
"import", |
|||
"struct", |
|||
"enum", |
|||
"fn", |
|||
"type", |
|||
"static", |
|||
"trait", |
|||
"impl", |
|||
"tymethod", |
|||
"method", |
|||
"structfield", |
|||
"variant", |
|||
"macro", |
|||
"primitive", |
|||
"associatedtype", |
|||
"constant", |
|||
"associatedconstant"]; |
|||
|
|||
$('.js-only').removeClass('js-only'); |
|||
|
|||
function getQueryStringParams() { |
|||
var params = {}; |
|||
window.location.search.substring(1).split("&"). |
|||
map(function(s) { |
|||
var pair = s.split("="); |
|||
params[decodeURIComponent(pair[0])] = |
|||
typeof pair[1] === "undefined" ? |
|||
null : decodeURIComponent(pair[1]); |
|||
}); |
|||
return params; |
|||
} |
|||
|
|||
function browserSupportsHistoryApi() { |
|||
return window.history && typeof window.history.pushState === "function"; |
|||
} |
|||
|
|||
function highlightSourceLines(ev) { |
|||
var i, from, to, match = window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/); |
|||
if (match) { |
|||
from = parseInt(match[1], 10); |
|||
to = Math.min(50000, parseInt(match[2] || match[1], 10)); |
|||
from = Math.min(from, to); |
|||
if ($('#' + from).length === 0) { |
|||
return; |
|||
} |
|||
if (ev === null) $('#' + from)[0].scrollIntoView(); |
|||
$('.line-numbers span').removeClass('line-highlighted'); |
|||
for (i = from; i <= to; ++i) { |
|||
$('#' + i).addClass('line-highlighted'); |
|||
} |
|||
} |
|||
} |
|||
highlightSourceLines(null); |
|||
$(window).on('hashchange', highlightSourceLines); |
|||
|
|||
$(document).on('keyup', function(e) { |
|||
if (document.activeElement.tagName === 'INPUT') { |
|||
return; |
|||
} |
|||
|
|||
if (e.which === 191) { // question mark
|
|||
if (e.shiftKey && $('#help').hasClass('hidden')) { |
|||
e.preventDefault(); |
|||
$('#help').removeClass('hidden'); |
|||
} |
|||
} else if (e.which === 27) { // esc
|
|||
if (!$('#help').hasClass('hidden')) { |
|||
e.preventDefault(); |
|||
$('#help').addClass('hidden'); |
|||
} else if (!$('#search').hasClass('hidden')) { |
|||
e.preventDefault(); |
|||
$('#search').addClass('hidden'); |
|||
$('#main').removeClass('hidden'); |
|||
} |
|||
} else if (e.which === 83) { // S
|
|||
e.preventDefault(); |
|||
$('.search-input').focus(); |
|||
} |
|||
}).on('click', function(e) { |
|||
if (!$(e.target).closest('#help').length) { |
|||
$('#help').addClass('hidden'); |
|||
} |
|||
}); |
|||
|
|||
$('.version-selector').on('change', function() { |
|||
var i, match, |
|||
url = document.location.href, |
|||
stripped = '', |
|||
len = rootPath.match(/\.\.\//g).length + 1; |
|||
|
|||
for (i = 0; i < len; ++i) { |
|||
match = url.match(/\/[^\/]*$/); |
|||
if (i < len - 1) { |
|||
stripped = match[0] + stripped; |
|||
} |
|||
url = url.substring(0, url.length - match[0].length); |
|||
} |
|||
|
|||
url += '/' + $('.version-selector').val() + stripped; |
|||
|
|||
document.location.href = url; |
|||
}); |
|||
/** |
|||
* A function to compute the Levenshtein distance between two strings |
|||
* Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported |
|||
* Full License can be found at http://creativecommons.org/licenses/by-sa/3.0/legalcode
|
|||
* This code is an unmodified version of the code written by Marco de Wit |
|||
* and was found at http://stackoverflow.com/a/18514751/745719
|
|||
*/ |
|||
var levenshtein = (function() { |
|||
var row2 = []; |
|||
return function(s1, s2) { |
|||
if (s1 === s2) { |
|||
return 0; |
|||
} else { |
|||
var s1_len = s1.length, s2_len = s2.length; |
|||
if (s1_len && s2_len) { |
|||
var i1 = 0, i2 = 0, a, b, c, c2, row = row2; |
|||
while (i1 < s1_len) |
|||
row[i1] = ++i1; |
|||
while (i2 < s2_len) { |
|||
c2 = s2.charCodeAt(i2); |
|||
a = i2; |
|||
++i2; |
|||
b = i2; |
|||
for (i1 = 0; i1 < s1_len; ++i1) { |
|||
c = a + (s1.charCodeAt(i1) !== c2 ? 1 : 0); |
|||
a = row[i1]; |
|||
b = b < a ? (b < c ? b + 1 : c) : (a < c ? a + 1 : c); |
|||
row[i1] = b; |
|||
} |
|||
} |
|||
return b; |
|||
} else { |
|||
return s1_len + s2_len; |
|||
} |
|||
} |
|||
}; |
|||
})(); |
|||
|
|||
function initSearch(rawSearchIndex) { |
|||
var currentResults, index, searchIndex; |
|||
var MAX_LEV_DISTANCE = 3; |
|||
var params = getQueryStringParams(); |
|||
|
|||
// Populate search bar with query string search term when provided,
|
|||
// but only if the input bar is empty. This avoid the obnoxious issue
|
|||
// where you start trying to do a search, and the index loads, and
|
|||
// suddenly your search is gone!
|
|||
if ($(".search-input")[0].value === "") { |
|||
$(".search-input")[0].value = params.search || ''; |
|||
} |
|||
|
|||
/** |
|||
* Executes the query and builds an index of results |
|||
* @param {[Object]} query [The user query] |
|||
* @param {[type]} max [The maximum results returned] |
|||
* @param {[type]} searchWords [The list of search words to query |
|||
* against] |
|||
* @return {[type]} [A search index of results] |
|||
*/ |
|||
function execQuery(query, max, searchWords) { |
|||
var valLower = query.query.toLowerCase(), |
|||
val = valLower, |
|||
typeFilter = itemTypeFromName(query.type), |
|||
results = [], |
|||
split = valLower.split("::"); |
|||
|
|||
//remove empty keywords
|
|||
for (var j = 0; j < split.length; ++j) { |
|||
split[j].toLowerCase(); |
|||
if (split[j] === "") { |
|||
split.splice(j, 1); |
|||
} |
|||
} |
|||
|
|||
// quoted values mean literal search
|
|||
var nSearchWords = searchWords.length; |
|||
if ((val.charAt(0) === "\"" || val.charAt(0) === "'") && |
|||
val.charAt(val.length - 1) === val.charAt(0)) |
|||
{ |
|||
val = val.substr(1, val.length - 2); |
|||
for (var i = 0; i < nSearchWords; ++i) { |
|||
if (searchWords[i] === val) { |
|||
// filter type: ... queries
|
|||
if (typeFilter < 0 || typeFilter === searchIndex[i].ty) { |
|||
results.push({id: i, index: -1}); |
|||
} |
|||
} |
|||
if (results.length === max) { |
|||
break; |
|||
} |
|||
} |
|||
// searching by type
|
|||
} else if (val.search("->") > -1) { |
|||
var trimmer = function (s) { return s.trim(); }; |
|||
var parts = val.split("->").map(trimmer); |
|||
var input = parts[0]; |
|||
// sort inputs so that order does not matter
|
|||
var inputs = input.split(",").map(trimmer).sort(); |
|||
var output = parts[1]; |
|||
|
|||
for (var i = 0; i < nSearchWords; ++i) { |
|||
var type = searchIndex[i].type; |
|||
if (!type) { |
|||
continue; |
|||
} |
|||
|
|||
// sort index inputs so that order does not matter
|
|||
var typeInputs = type.inputs.map(function (input) { |
|||
return input.name; |
|||
}).sort(); |
|||
|
|||
// allow searching for void (no output) functions as well
|
|||
var typeOutput = type.output ? type.output.name : ""; |
|||
if (inputs.toString() === typeInputs.toString() && |
|||
output == typeOutput) { |
|||
results.push({id: i, index: -1, dontValidate: true}); |
|||
} |
|||
} |
|||
} else { |
|||
// gather matching search results up to a certain maximum
|
|||
val = val.replace(/\_/g, ""); |
|||
for (var i = 0; i < split.length; ++i) { |
|||
for (var j = 0; j < nSearchWords; ++j) { |
|||
var lev_distance; |
|||
if (searchWords[j].indexOf(split[i]) > -1 || |
|||
searchWords[j].indexOf(val) > -1 || |
|||
searchWords[j].replace(/_/g, "").indexOf(val) > -1) |
|||
{ |
|||
// filter type: ... queries
|
|||
if (typeFilter < 0 || typeFilter === searchIndex[j].ty) { |
|||
results.push({ |
|||
id: j, |
|||
index: searchWords[j].replace(/_/g, "").indexOf(val), |
|||
lev: 0, |
|||
}); |
|||
} |
|||
} else if ( |
|||
(lev_distance = levenshtein(searchWords[j], val)) <= |
|||
MAX_LEV_DISTANCE) { |
|||
if (typeFilter < 0 || typeFilter === searchIndex[j].ty) { |
|||
results.push({ |
|||
id: j, |
|||
index: 0, |
|||
// we want lev results to go lower than others
|
|||
lev: lev_distance, |
|||
}); |
|||
} |
|||
} |
|||
if (results.length === max) { |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
var nresults = results.length; |
|||
for (var i = 0; i < nresults; ++i) { |
|||
results[i].word = searchWords[results[i].id]; |
|||
results[i].item = searchIndex[results[i].id] || {}; |
|||
} |
|||
// if there are no results then return to default and fail
|
|||
if (results.length === 0) { |
|||
return []; |
|||
} |
|||
|
|||
results.sort(function(aaa, bbb) { |
|||
var a, b; |
|||
|
|||
// Sort by non levenshtein results and then levenshtein results by the distance
|
|||
// (less changes required to match means higher rankings)
|
|||
a = (aaa.lev); |
|||
b = (bbb.lev); |
|||
if (a !== b) return a - b; |
|||
|
|||
// sort by crate (non-current crate goes later)
|
|||
a = (aaa.item.crate !== window.currentCrate); |
|||
b = (bbb.item.crate !== window.currentCrate); |
|||
if (a !== b) return a - b; |
|||
|
|||
// sort by exact match (mismatch goes later)
|
|||
a = (aaa.word !== valLower); |
|||
b = (bbb.word !== valLower); |
|||
if (a !== b) return a - b; |
|||
|
|||
// sort by item name length (longer goes later)
|
|||
a = aaa.word.length; |
|||
b = bbb.word.length; |
|||
if (a !== b) return a - b; |
|||
|
|||
// sort by item name (lexicographically larger goes later)
|
|||
a = aaa.word; |
|||
b = bbb.word; |
|||
if (a !== b) return (a > b ? +1 : -1); |
|||
|
|||
// sort by index of keyword in item name (no literal occurrence goes later)
|
|||
a = (aaa.index < 0); |
|||
b = (bbb.index < 0); |
|||
if (a !== b) return a - b; |
|||
// (later literal occurrence, if any, goes later)
|
|||
a = aaa.index; |
|||
b = bbb.index; |
|||
if (a !== b) return a - b; |
|||
|
|||
// sort by description (no description goes later)
|
|||
a = (aaa.item.desc === ''); |
|||
b = (bbb.item.desc === ''); |
|||
if (a !== b) return a - b; |
|||
|
|||
// sort by type (later occurrence in `itemTypes` goes later)
|
|||
a = aaa.item.ty; |
|||
b = bbb.item.ty; |
|||
if (a !== b) return a - b; |
|||
|
|||
// sort by path (lexicographically larger goes later)
|
|||
a = aaa.item.path; |
|||
b = bbb.item.path; |
|||
if (a !== b) return (a > b ? +1 : -1); |
|||
|
|||
// que sera, sera
|
|||
return 0; |
|||
}); |
|||
|
|||
// remove duplicates, according to the data provided
|
|||
for (var i = results.length - 1; i > 0; i -= 1) { |
|||
if (results[i].word === results[i - 1].word && |
|||
results[i].item.ty === results[i - 1].item.ty && |
|||
results[i].item.path === results[i - 1].item.path && |
|||
(results[i].item.parent || {}).name === (results[i - 1].item.parent || {}).name) |
|||
{ |
|||
results[i].id = -1; |
|||
} |
|||
} |
|||
for (var i = 0; i < results.length; ++i) { |
|||
var result = results[i], |
|||
name = result.item.name.toLowerCase(), |
|||
path = result.item.path.toLowerCase(), |
|||
parent = result.item.parent; |
|||
|
|||
// this validation does not make sense when searching by types
|
|||
if (result.dontValidate) { |
|||
continue; |
|||
} |
|||
|
|||
var valid = validateResult(name, path, split, parent); |
|||
if (!valid) { |
|||
result.id = -1; |
|||
} |
|||
} |
|||
return results; |
|||
} |
|||
|
|||
/** |
|||
* Validate performs the following boolean logic. For example: |
|||
* "File::open" will give IF A PARENT EXISTS => ("file" && "open") |
|||
* exists in (name || path || parent) OR => ("file" && "open") exists in |
|||
* (name || path ) |
|||
* |
|||
* This could be written functionally, but I wanted to minimise |
|||
* functions on stack. |
|||
* |
|||
* @param {[string]} name [The name of the result] |
|||
* @param {[string]} path [The path of the result] |
|||
* @param {[string]} keys [The keys to be used (["file", "open"])] |
|||
* @param {[object]} parent [The parent of the result] |
|||
* @return {[boolean]} [Whether the result is valid or not] |
|||
*/ |
|||
function validateResult(name, path, keys, parent) { |
|||
for (var i=0; i < keys.length; ++i) { |
|||
// each check is for validation so we negate the conditions and invalidate
|
|||
if (!( |
|||
// check for an exact name match
|
|||
name.toLowerCase().indexOf(keys[i]) > -1 || |
|||
// then an exact path match
|
|||
path.toLowerCase().indexOf(keys[i]) > -1 || |
|||
// next if there is a parent, check for exact parent match
|
|||
(parent !== undefined && |
|||
parent.name.toLowerCase().indexOf(keys[i]) > -1) || |
|||
// lastly check to see if the name was a levenshtein match
|
|||
levenshtein(name.toLowerCase(), keys[i]) <= |
|||
MAX_LEV_DISTANCE)) { |
|||
return false; |
|||
} |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
function getQuery() { |
|||
var matches, type, query, raw = $('.search-input').val(); |
|||
query = raw; |
|||
|
|||
matches = query.match(/^(fn|mod|struct|enum|trait|t(ype)?d(ef)?)\s*:\s*/i); |
|||
if (matches) { |
|||
type = matches[1].replace(/^td$/, 'typedef') |
|||
.replace(/^tdef$/, 'typedef') |
|||
.replace(/^typed$/, 'typedef'); |
|||
query = query.substring(matches[0].length); |
|||
} |
|||
|
|||
return { |
|||
raw: raw, |
|||
query: query, |
|||
type: type, |
|||
id: query + type, |
|||
}; |
|||
} |
|||
|
|||
function initSearchNav() { |
|||
var hoverTimeout, $results = $('.search-results .result'); |
|||
|
|||
$results.on('click', function() { |
|||
var dst = $(this).find('a')[0]; |
|||
if (window.location.pathname == dst.pathname) { |
|||
$('#search').addClass('hidden'); |
|||
$('#main').removeClass('hidden'); |
|||
document.location.href = dst.href; |
|||
} |
|||
}).on('mouseover', function() { |
|||
var $el = $(this); |
|||
clearTimeout(hoverTimeout); |
|||
hoverTimeout = setTimeout(function() { |
|||
$results.removeClass('highlighted'); |
|||
$el.addClass('highlighted'); |
|||
}, 20); |
|||
}); |
|||
|
|||
$(document).off('keydown.searchnav'); |
|||
$(document).on('keydown.searchnav', function(e) { |
|||
var $active = $results.filter('.highlighted'); |
|||
|
|||
if (e.which === 38) { // up
|
|||
e.preventDefault(); |
|||
if (!$active.length || !$active.prev()) { |
|||
return; |
|||
} |
|||
|
|||
$active.prev().addClass('highlighted'); |
|||
$active.removeClass('highlighted'); |
|||
} else if (e.which === 40) { // down
|
|||
e.preventDefault(); |
|||
if (!$active.length) { |
|||
$results.first().addClass('highlighted'); |
|||
} else if ($active.next().length) { |
|||
$active.next().addClass('highlighted'); |
|||
$active.removeClass('highlighted'); |
|||
} |
|||
} else if (e.which === 13) { // return
|
|||
e.preventDefault(); |
|||
if ($active.length) { |
|||
document.location.href = $active.find('a').prop('href'); |
|||
} |
|||
} else { |
|||
$active.removeClass('highlighted'); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
function escape(content) { |
|||
return $('<h1/>').text(content).html(); |
|||
} |
|||
|
|||
function showResults(results) { |
|||
var output, shown, query = getQuery(); |
|||
|
|||
currentResults = query.id; |
|||
output = '<h1>Results for ' + escape(query.query) + |
|||
(query.type ? ' (type: ' + escape(query.type) + ')' : '') + '</h1>'; |
|||
output += '<table class="search-results">'; |
|||
|
|||
if (results.length > 0) { |
|||
shown = []; |
|||
|
|||
results.forEach(function(item) { |
|||
var name, type, href, displayPath; |
|||
|
|||
if (shown.indexOf(item) !== -1) { |
|||
return; |
|||
} |
|||
|
|||
shown.push(item); |
|||
name = item.name; |
|||
type = itemTypes[item.ty]; |
|||
|
|||
if (type === 'mod') { |
|||
displayPath = item.path + '::'; |
|||
href = rootPath + item.path.replace(/::/g, '/') + '/' + |
|||
name + '/index.html'; |
|||
} else if (type === 'static' || type === 'reexport') { |
|||
displayPath = item.path + '::'; |
|||
href = rootPath + item.path.replace(/::/g, '/') + |
|||
'/index.html'; |
|||
} else if (item.parent !== undefined) { |
|||
var myparent = item.parent; |
|||
var anchor = '#' + type + '.' + name; |
|||
displayPath = item.path + '::' + myparent.name + '::'; |
|||
href = rootPath + item.path.replace(/::/g, '/') + |
|||
'/' + itemTypes[myparent.ty] + |
|||
'.' + myparent.name + |
|||
'.html' + anchor; |
|||
} else { |
|||
displayPath = item.path + '::'; |
|||
href = rootPath + item.path.replace(/::/g, '/') + |
|||
'/' + type + '.' + name + '.html'; |
|||
} |
|||
|
|||
output += '<tr class="' + type + ' result"><td>' + |
|||
'<a href="' + href + '">' + |
|||
displayPath + '<span class="' + type + '">' + |
|||
name + '</span></a></td><td>' + |
|||
'<a href="' + href + '">' + |
|||
'<span class="desc">' + item.desc + |
|||
' </span></a></td></tr>'; |
|||
}); |
|||
} else { |
|||
output += 'No results :( <a href="https://duckduckgo.com/?q=' + |
|||
encodeURIComponent('rust ' + query.query) + |
|||
'">Try on DuckDuckGo?</a>'; |
|||
} |
|||
|
|||
output += "</p>"; |
|||
$('#main.content').addClass('hidden'); |
|||
$('#search.content').removeClass('hidden').html(output); |
|||
$('#search .desc').width($('#search').width() - 40 - |
|||
$('#search td:first-child').first().width()); |
|||
initSearchNav(); |
|||
} |
|||
|
|||
function search(e) { |
|||
var query, |
|||
filterdata = [], |
|||
obj, i, len, |
|||
results = [], |
|||
maxResults = 200, |
|||
resultIndex; |
|||
var params = getQueryStringParams(); |
|||
|
|||
query = getQuery(); |
|||
if (e) { |
|||
e.preventDefault(); |
|||
} |
|||
|
|||
if (!query.query || query.id === currentResults) { |
|||
return; |
|||
} |
|||
|
|||
// Because searching is incremental by character, only the most
|
|||
// recent search query is added to the browser history.
|
|||
if (browserSupportsHistoryApi()) { |
|||
if (!history.state && !params.search) { |
|||
history.pushState(query, "", "?search=" + |
|||
encodeURIComponent(query.raw)); |
|||
} else { |
|||
history.replaceState(query, "", "?search=" + |
|||
encodeURIComponent(query.raw)); |
|||
} |
|||
} |
|||
|
|||
resultIndex = execQuery(query, 20000, index); |
|||
len = resultIndex.length; |
|||
for (i = 0; i < len; ++i) { |
|||
if (resultIndex[i].id > -1) { |
|||
obj = searchIndex[resultIndex[i].id]; |
|||
filterdata.push([obj.name, obj.ty, obj.path, obj.desc]); |
|||
results.push(obj); |
|||
} |
|||
if (results.length >= maxResults) { |
|||
break; |
|||
} |
|||
} |
|||
|
|||
showResults(results); |
|||
} |
|||
|
|||
function itemTypeFromName(typename) { |
|||
for (var i = 0; i < itemTypes.length; ++i) { |
|||
if (itemTypes[i] === typename) return i; |
|||
} |
|||
return -1; |
|||
} |
|||
|
|||
function buildIndex(rawSearchIndex) { |
|||
searchIndex = []; |
|||
var searchWords = []; |
|||
for (var crate in rawSearchIndex) { |
|||
if (!rawSearchIndex.hasOwnProperty(crate)) { continue } |
|||
|
|||
// an array of [(Number) item type,
|
|||
// (String) name,
|
|||
// (String) full path or empty string for previous path,
|
|||
// (String) description,
|
|||
// (Number | null) the parent path index to `paths`]
|
|||
// (Object | null) the type of the function (if any)
|
|||
var items = rawSearchIndex[crate].items; |
|||
// an array of [(Number) item type,
|
|||
// (String) name]
|
|||
var paths = rawSearchIndex[crate].paths; |
|||
|
|||
// convert `paths` into an object form
|
|||
var len = paths.length; |
|||
for (var i = 0; i < len; ++i) { |
|||
paths[i] = {ty: paths[i][0], name: paths[i][1]}; |
|||
} |
|||
|
|||
// convert `items` into an object form, and construct word indices.
|
|||
//
|
|||
// before any analysis is performed lets gather the search terms to
|
|||
// search against apart from the rest of the data. This is a quick
|
|||
// operation that is cached for the life of the page state so that
|
|||
// all other search operations have access to this cached data for
|
|||
// faster analysis operations
|
|||
var len = items.length; |
|||
var lastPath = ""; |
|||
for (var i = 0; i < len; ++i) { |
|||
var rawRow = items[i]; |
|||
var row = {crate: crate, ty: rawRow[0], name: rawRow[1], |
|||
path: rawRow[2] || lastPath, desc: rawRow[3], |
|||
parent: paths[rawRow[4]], type: rawRow[5]}; |
|||
searchIndex.push(row); |
|||
if (typeof row.name === "string") { |
|||
var word = row.name.toLowerCase(); |
|||
searchWords.push(word); |
|||
} else { |
|||
searchWords.push(""); |
|||
} |
|||
lastPath = row.path; |
|||
} |
|||
} |
|||
return searchWords; |
|||
} |
|||
|
|||
function startSearch() { |
|||
var keyUpTimeout; |
|||
$('.do-search').on('click', search); |
|||
$('.search-input').on('keyup', function() { |
|||
clearTimeout(keyUpTimeout); |
|||
keyUpTimeout = setTimeout(search, 500); |
|||
}); |
|||
|
|||
// Push and pop states are used to add search results to the browser
|
|||
// history.
|
|||
if (browserSupportsHistoryApi()) { |
|||
$(window).on('popstate', function(e) { |
|||
var params = getQueryStringParams(); |
|||
// When browsing back from search results the main page
|
|||
// visibility must be reset.
|
|||
if (!params.search) { |
|||
$('#main.content').removeClass('hidden'); |
|||
$('#search.content').addClass('hidden'); |
|||
} |
|||
// When browsing forward to search results the previous
|
|||
// search will be repeated, so the currentResults are
|
|||
// cleared to ensure the search is successful.
|
|||
currentResults = null; |
|||
// Synchronize search bar with query string state and
|
|||
// perform the search. This will empty the bar if there's
|
|||
// nothing there, which lets you really go back to a
|
|||
// previous state with nothing in the bar.
|
|||
$('.search-input').val(params.search); |
|||
// Some browsers fire 'onpopstate' for every page load
|
|||
// (Chrome), while others fire the event only when actually
|
|||
// popping a state (Firefox), which is why search() is
|
|||
// called both here and at the end of the startSearch()
|
|||
// function.
|
|||
search(); |
|||
}); |
|||
} |
|||
search(); |
|||
} |
|||
|
|||
function plainSummaryLine(markdown) { |
|||
var str = markdown.replace(/\n/g, ' ') |
|||
str = str.replace(/'/g, "\'") |
|||
str = str.replace(/^#+? (.+?)/, "$1") |
|||
str = str.replace(/\[(.*?)\]\(.*?\)/g, "$1") |
|||
str = str.replace(/\[(.*?)\]\[.*?\]/g, "$1") |
|||
return str; |
|||
} |
|||
|
|||
index = buildIndex(rawSearchIndex); |
|||
startSearch(); |
|||
|
|||
// Draw a convenient sidebar of known crates if we have a listing
|
|||
if (rootPath == '../') { |
|||
var sidebar = $('.sidebar'); |
|||
var div = $('<div>').attr('class', 'block crate'); |
|||
div.append($('<h2>').text('Crates')); |
|||
|
|||
var crates = []; |
|||
for (var crate in rawSearchIndex) { |
|||
if (!rawSearchIndex.hasOwnProperty(crate)) { continue } |
|||
crates.push(crate); |
|||
} |
|||
crates.sort(); |
|||
for (var i = 0; i < crates.length; ++i) { |
|||
var klass = 'crate'; |
|||
if (crates[i] == window.currentCrate) { |
|||
klass += ' current'; |
|||
} |
|||
if (rawSearchIndex[crates[i]].items[0]) { |
|||
var desc = rawSearchIndex[crates[i]].items[0][3]; |
|||
div.append($('<a>', {'href': '../' + crates[i] + '/index.html', |
|||
'title': plainSummaryLine(desc), |
|||
'class': klass}).text(crates[i])); |
|||
} |
|||
} |
|||
sidebar.append(div); |
|||
} |
|||
} |
|||
|
|||
window.initSearch = initSearch; |
|||
|
|||
// delayed sidebar rendering.
|
|||
function initSidebarItems(items) { |
|||
var sidebar = $('.sidebar'); |
|||
var current = window.sidebarCurrent; |
|||
|
|||
function block(shortty, longty) { |
|||
var filtered = items[shortty]; |
|||
if (!filtered) return; |
|||
|
|||
var div = $('<div>').attr('class', 'block ' + shortty); |
|||
div.append($('<h2>').text(longty)); |
|||
|
|||
for (var i = 0; i < filtered.length; ++i) { |
|||
var item = filtered[i]; |
|||
var name = item[0]; |
|||
var desc = item[1]; // can be null
|
|||
|
|||
var klass = shortty; |
|||
if (name === current.name && shortty == current.ty) { |
|||
klass += ' current'; |
|||
} |
|||
var path; |
|||
if (shortty === 'mod') { |
|||
path = name + '/index.html'; |
|||
} else { |
|||
path = shortty + '.' + name + '.html'; |
|||
} |
|||
div.append($('<a>', {'href': current.relpath + path, |
|||
'title': desc, |
|||
'class': klass}).text(name)); |
|||
} |
|||
sidebar.append(div); |
|||
} |
|||
|
|||
block("mod", "Modules"); |
|||
block("struct", "Structs"); |
|||
block("enum", "Enums"); |
|||
block("trait", "Traits"); |
|||
block("fn", "Functions"); |
|||
block("macro", "Macros"); |
|||
} |
|||
|
|||
window.initSidebarItems = initSidebarItems; |
|||
|
|||
window.register_implementors = function(imp) { |
|||
var list = $('#implementors-list'); |
|||
var libs = Object.getOwnPropertyNames(imp); |
|||
for (var i = 0; i < libs.length; ++i) { |
|||
if (libs[i] == currentCrate) continue; |
|||
var structs = imp[libs[i]]; |
|||
for (var j = 0; j < structs.length; ++j) { |
|||
var code = $('<code>').append(structs[j]); |
|||
$.each(code.find('a'), function(idx, a) { |
|||
var href = $(a).attr('href'); |
|||
if (href && href.indexOf('http') !== 0) { |
|||
$(a).attr('href', rootPath + href); |
|||
} |
|||
}); |
|||
var li = $('<li>').append(code); |
|||
list.append(li); |
|||
} |
|||
} |
|||
}; |
|||
if (window.pending_implementors) { |
|||
window.register_implementors(window.pending_implementors); |
|||
} |
|||
|
|||
// See documentation in html/render.rs for what this is doing.
|
|||
var query = getQueryStringParams(); |
|||
if (query['gotosrc']) { |
|||
window.location = $('#src-' + query['gotosrc']).attr('href'); |
|||
} |
|||
if (query['gotomacrosrc']) { |
|||
window.location = $('.srclink').attr('href'); |
|||
} |
|||
|
|||
function labelForToggleButton(sectionIsCollapsed) { |
|||
if (sectionIsCollapsed) { |
|||
// button will expand the section
|
|||
return "+"; |
|||
} else { |
|||
// button will collapse the section
|
|||
// note that this text is also set in the HTML template in render.rs
|
|||
return "\u2212"; // "\u2212" is '−' minus sign
|
|||
} |
|||
} |
|||
|
|||
$("#toggle-all-docs").on("click", function() { |
|||
var toggle = $("#toggle-all-docs"); |
|||
if (toggle.hasClass("will-expand")) { |
|||
toggle.removeClass("will-expand"); |
|||
toggle.children(".inner").text(labelForToggleButton(false)); |
|||
toggle.attr("title", "collapse all docs"); |
|||
$(".docblock").show(); |
|||
$(".toggle-label").hide(); |
|||
$(".toggle-wrapper").removeClass("collapsed"); |
|||
$(".collapse-toggle").children(".inner").text(labelForToggleButton(false)); |
|||
} else { |
|||
toggle.addClass("will-expand"); |
|||
toggle.children(".inner").text(labelForToggleButton(true)); |
|||
toggle.attr("title", "expand all docs"); |
|||
$(".docblock").hide(); |
|||
$(".toggle-label").show(); |
|||
$(".toggle-wrapper").addClass("collapsed"); |
|||
$(".collapse-toggle").children(".inner").text(labelForToggleButton(true)); |
|||
} |
|||
}); |
|||
|
|||
$(document).on("click", ".collapse-toggle", function() { |
|||
var toggle = $(this); |
|||
var relatedDoc = toggle.parent().next(); |
|||
if (relatedDoc.is(".stability")) { |
|||
relatedDoc = relatedDoc.next(); |
|||
} |
|||
if (relatedDoc.is(".docblock")) { |
|||
if (relatedDoc.is(":visible")) { |
|||
relatedDoc.slideUp({duration:'fast', easing:'linear'}); |
|||
toggle.parent(".toggle-wrapper").addClass("collapsed"); |
|||
toggle.children(".inner").text(labelForToggleButton(true)); |
|||
toggle.children(".toggle-label").fadeIn(); |
|||
} else { |
|||
relatedDoc.slideDown({duration:'fast', easing:'linear'}); |
|||
toggle.parent(".toggle-wrapper").removeClass("collapsed"); |
|||
toggle.children(".inner").text(labelForToggleButton(false)); |
|||
toggle.children(".toggle-label").hide(); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
$(function() { |
|||
var toggle = $("<a/>", {'href': 'javascript:void(0)', 'class': 'collapse-toggle'}) |
|||
.html("[<span class='inner'></span>]"); |
|||
toggle.children(".inner").text(labelForToggleButton(false)); |
|||
|
|||
$(".method").each(function() { |
|||
if ($(this).next().is(".docblock") || |
|||
($(this).next().is(".stability") && $(this).next().next().is(".docblock"))) { |
|||
$(this).children().first().after(toggle.clone()); |
|||
} |
|||
}); |
|||
|
|||
var mainToggle = |
|||
$(toggle).append( |
|||
$('<span/>', {'class': 'toggle-label'}) |
|||
.css('display', 'none') |
|||
.html(' Expand description')); |
|||
var wrapper = $("<div class='toggle-wrapper'>").append(mainToggle); |
|||
$("#main > .docblock").before(wrapper); |
|||
}); |
|||
|
|||
$('pre.line-numbers').on('click', 'span', function() { |
|||
var prev_id = 0; |
|||
|
|||
function set_fragment(name) { |
|||
if (history.replaceState) { |
|||
history.replaceState(null, null, '#' + name); |
|||
$(window).trigger('hashchange'); |
|||
} else { |
|||
location.replace('#' + name); |
|||
} |
|||
} |
|||
|
|||
return function(ev) { |
|||
var cur_id = parseInt(ev.target.id); |
|||
|
|||
if (ev.shiftKey && prev_id) { |
|||
if (prev_id > cur_id) { |
|||
var tmp = prev_id; |
|||
prev_id = cur_id; |
|||
cur_id = tmp; |
|||
} |
|||
|
|||
set_fragment(prev_id + '-' + cur_id); |
|||
} else { |
|||
prev_id = cur_id; |
|||
|
|||
set_fragment(cur_id); |
|||
} |
|||
}; |
|||
}()); |
|||
|
|||
}()); |
@ -0,0 +1 @@ |
|||
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0} |
@ -0,0 +1,27 @@ |
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
|||
// file at the top-level directory of this distribution and at
|
|||
// http://rust-lang.org/COPYRIGHT.
|
|||
//
|
|||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|||
// option. This file may not be copied, modified, or distributed
|
|||
// except according to those terms.
|
|||
|
|||
/*jslint browser: true, es5: true */ |
|||
/*globals $: true, rootPath: true */ |
|||
|
|||
(function() { |
|||
if (window.playgroundUrl) { |
|||
$('pre.rust').hover(function() { |
|||
var a = $('<a>').text('⇱').attr('class', 'test-arrow'); |
|||
var code = $(this).prev(".rusttest").text(); |
|||
a.attr('href', window.playgroundUrl + '?code=' + |
|||
encodeURIComponent(code)); |
|||
a.attr('target', '_blank'); |
|||
$(this).append(a); |
|||
}, function() { |
|||
$(this).find('a.test-arrow').remove(); |
|||
}); |
|||
} |
|||
}()); |
4
search-index.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,81 +0,0 @@ |
|||
//! Transformation of complex data.
|
|||
|
|||
// The implementation is based on:
|
|||
// http://www.librow.com/articles/article-10
|
|||
|
|||
use number::c64;
|
|||
|
|||
/// Perform the forward transform.
|
|||
///
|
|||
/// The number of points should be a power of two.
|
|||
pub fn forward(data: &mut [c64]) {
|
|||
let n = power_of_two!(data);
|
|||
rearrange(data, n);
|
|||
transform(data, n, false);
|
|||
}
|
|||
|
|||
/// Perform the backward transform.
|
|||
///
|
|||
/// The number of points should be a power of two.
|
|||
pub fn backward(data: &mut [c64]) {
|
|||
let n = power_of_two!(data);
|
|||
rearrange(data, n);
|
|||
transform(data, n, true);
|
|||
}
|
|||
|
|||
/// Perform the inverse transform.
|
|||
///
|
|||
/// The number of points should be a power of two.
|
|||
pub fn inverse(data: &mut [c64]) {
|
|||
let n = power_of_two!(data);
|
|||
rearrange(data, n);
|
|||
transform(data, n, true);
|
|||
scale(data, n);
|
|||
}
|
|||
|
|||
fn rearrange(data: &mut [c64], n: usize) {
|
|||
let mut j = 0;
|
|||
for i in 0..n {
|
|||
if j > i {
|
|||
data.swap(i, j);
|
|||
}
|
|||
let mut mask = n >> 1;
|
|||
while j & mask != 0 {
|
|||
j &= !mask;
|
|||
mask >>= 1;
|
|||
}
|
|||
j |= mask;
|
|||
}
|
|||
}
|
|||
|
|||
fn transform(data: &mut [c64], n: usize, inverse: bool) {
|
|||
let sign = if inverse { 1.0 } else { -1.0 };
|
|||
let mut step = 1;
|
|||
while step < n {
|
|||
let jump = step << 1;
|
|||
let (multiplier, mut factor) = {
|
|||
use std::f64::consts::PI;
|
|||
let theta = sign * PI / step as f64;
|
|||
let sine = (0.5 * theta).sin();
|
|||
(c64(-2.0 * sine * sine, theta.sin()), c64(1.0, 0.0))
|
|||
};
|
|||
for mut i in 0..step {
|
|||
while i < n {
|
|||
let j = i + step;
|
|||
let product = factor * data[j];
|
|||
data[j] = data[i] - product;
|
|||
data[i] = data[i] + product;
|
|||
i += jump;
|
|||
}
|
|||
factor = multiplier * factor + factor;
|
|||
}
|
|||
step <<= 1;
|
|||
}
|
|||
}
|
|||
|
|||
fn scale(data: &mut [c64], n: usize) {
|
|||
let factor = 1.0 / n as f64;
|
|||
for i in 0..n {
|
|||
data[i] = data[i] * factor;
|
|||
}
|
|||
}
|
@ -0,0 +1,759 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="Source to the Rust file `/home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/complex-0.7.5/src/lib.rs`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang"> |
|||
|
|||
<title>lib.rs.html -- source</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
|
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content source"><pre class="line-numbers"><span id="1"> 1</span> |
|||
<span id="2"> 2</span> |
|||
<span id="3"> 3</span> |
|||
<span id="4"> 4</span> |
|||
<span id="5"> 5</span> |
|||
<span id="6"> 6</span> |
|||
<span id="7"> 7</span> |
|||
<span id="8"> 8</span> |
|||
<span id="9"> 9</span> |
|||
<span id="10"> 10</span> |
|||
<span id="11"> 11</span> |
|||
<span id="12"> 12</span> |
|||
<span id="13"> 13</span> |
|||
<span id="14"> 14</span> |
|||
<span id="15"> 15</span> |
|||
<span id="16"> 16</span> |
|||
<span id="17"> 17</span> |
|||
<span id="18"> 18</span> |
|||
<span id="19"> 19</span> |
|||
<span id="20"> 20</span> |
|||
<span id="21"> 21</span> |
|||
<span id="22"> 22</span> |
|||
<span id="23"> 23</span> |
|||
<span id="24"> 24</span> |
|||
<span id="25"> 25</span> |
|||
<span id="26"> 26</span> |
|||
<span id="27"> 27</span> |
|||
<span id="28"> 28</span> |
|||
<span id="29"> 29</span> |
|||
<span id="30"> 30</span> |
|||
<span id="31"> 31</span> |
|||
<span id="32"> 32</span> |
|||
<span id="33"> 33</span> |
|||
<span id="34"> 34</span> |
|||
<span id="35"> 35</span> |
|||
<span id="36"> 36</span> |
|||
<span id="37"> 37</span> |
|||
<span id="38"> 38</span> |
|||
<span id="39"> 39</span> |
|||
<span id="40"> 40</span> |
|||
<span id="41"> 41</span> |
|||
<span id="42"> 42</span> |
|||
<span id="43"> 43</span> |
|||
<span id="44"> 44</span> |
|||
<span id="45"> 45</span> |
|||
<span id="46"> 46</span> |
|||
<span id="47"> 47</span> |
|||
<span id="48"> 48</span> |
|||
<span id="49"> 49</span> |
|||
<span id="50"> 50</span> |
|||
<span id="51"> 51</span> |
|||
<span id="52"> 52</span> |
|||
<span id="53"> 53</span> |
|||
<span id="54"> 54</span> |
|||
<span id="55"> 55</span> |
|||
<span id="56"> 56</span> |
|||
<span id="57"> 57</span> |
|||
<span id="58"> 58</span> |
|||
<span id="59"> 59</span> |
|||
<span id="60"> 60</span> |
|||
<span id="61"> 61</span> |
|||
<span id="62"> 62</span> |
|||
<span id="63"> 63</span> |
|||
<span id="64"> 64</span> |
|||
<span id="65"> 65</span> |
|||
<span id="66"> 66</span> |
|||
<span id="67"> 67</span> |
|||
<span id="68"> 68</span> |
|||
<span id="69"> 69</span> |
|||
<span id="70"> 70</span> |
|||
<span id="71"> 71</span> |
|||
<span id="72"> 72</span> |
|||
<span id="73"> 73</span> |
|||
<span id="74"> 74</span> |
|||
<span id="75"> 75</span> |
|||
<span id="76"> 76</span> |
|||
<span id="77"> 77</span> |
|||
<span id="78"> 78</span> |
|||
<span id="79"> 79</span> |
|||
<span id="80"> 80</span> |
|||
<span id="81"> 81</span> |
|||
<span id="82"> 82</span> |
|||
<span id="83"> 83</span> |
|||
<span id="84"> 84</span> |
|||
<span id="85"> 85</span> |
|||
<span id="86"> 86</span> |
|||
<span id="87"> 87</span> |
|||
<span id="88"> 88</span> |
|||
<span id="89"> 89</span> |
|||
<span id="90"> 90</span> |
|||
<span id="91"> 91</span> |
|||
<span id="92"> 92</span> |
|||
<span id="93"> 93</span> |
|||
<span id="94"> 94</span> |
|||
<span id="95"> 95</span> |
|||
<span id="96"> 96</span> |
|||
<span id="97"> 97</span> |
|||
<span id="98"> 98</span> |
|||
<span id="99"> 99</span> |
|||
<span id="100">100</span> |
|||
<span id="101">101</span> |
|||
<span id="102">102</span> |
|||
<span id="103">103</span> |
|||
<span id="104">104</span> |
|||
<span id="105">105</span> |
|||
<span id="106">106</span> |
|||
<span id="107">107</span> |
|||
<span id="108">108</span> |
|||
<span id="109">109</span> |
|||
<span id="110">110</span> |
|||
<span id="111">111</span> |
|||
<span id="112">112</span> |
|||
<span id="113">113</span> |
|||
<span id="114">114</span> |
|||
<span id="115">115</span> |
|||
<span id="116">116</span> |
|||
<span id="117">117</span> |
|||
<span id="118">118</span> |
|||
<span id="119">119</span> |
|||
<span id="120">120</span> |
|||
<span id="121">121</span> |
|||
<span id="122">122</span> |
|||
<span id="123">123</span> |
|||
<span id="124">124</span> |
|||
<span id="125">125</span> |
|||
<span id="126">126</span> |
|||
<span id="127">127</span> |
|||
<span id="128">128</span> |
|||
<span id="129">129</span> |
|||
<span id="130">130</span> |
|||
<span id="131">131</span> |
|||
<span id="132">132</span> |
|||
<span id="133">133</span> |
|||
<span id="134">134</span> |
|||
<span id="135">135</span> |
|||
<span id="136">136</span> |
|||
<span id="137">137</span> |
|||
<span id="138">138</span> |
|||
<span id="139">139</span> |
|||
<span id="140">140</span> |
|||
<span id="141">141</span> |
|||
<span id="142">142</span> |
|||
<span id="143">143</span> |
|||
<span id="144">144</span> |
|||
<span id="145">145</span> |
|||
<span id="146">146</span> |
|||
<span id="147">147</span> |
|||
<span id="148">148</span> |
|||
<span id="149">149</span> |
|||
<span id="150">150</span> |
|||
<span id="151">151</span> |
|||
<span id="152">152</span> |
|||
<span id="153">153</span> |
|||
<span id="154">154</span> |
|||
<span id="155">155</span> |
|||
<span id="156">156</span> |
|||
<span id="157">157</span> |
|||
<span id="158">158</span> |
|||
<span id="159">159</span> |
|||
<span id="160">160</span> |
|||
<span id="161">161</span> |
|||
<span id="162">162</span> |
|||
<span id="163">163</span> |
|||
<span id="164">164</span> |
|||
<span id="165">165</span> |
|||
<span id="166">166</span> |
|||
<span id="167">167</span> |
|||
<span id="168">168</span> |
|||
<span id="169">169</span> |
|||
<span id="170">170</span> |
|||
<span id="171">171</span> |
|||
<span id="172">172</span> |
|||
<span id="173">173</span> |
|||
<span id="174">174</span> |
|||
<span id="175">175</span> |
|||
<span id="176">176</span> |
|||
<span id="177">177</span> |
|||
<span id="178">178</span> |
|||
<span id="179">179</span> |
|||
<span id="180">180</span> |
|||
<span id="181">181</span> |
|||
<span id="182">182</span> |
|||
<span id="183">183</span> |
|||
<span id="184">184</span> |
|||
<span id="185">185</span> |
|||
<span id="186">186</span> |
|||
<span id="187">187</span> |
|||
<span id="188">188</span> |
|||
<span id="189">189</span> |
|||
<span id="190">190</span> |
|||
<span id="191">191</span> |
|||
<span id="192">192</span> |
|||
<span id="193">193</span> |
|||
<span id="194">194</span> |
|||
<span id="195">195</span> |
|||
<span id="196">196</span> |
|||
<span id="197">197</span> |
|||
<span id="198">198</span> |
|||
<span id="199">199</span> |
|||
<span id="200">200</span> |
|||
<span id="201">201</span> |
|||
<span id="202">202</span> |
|||
<span id="203">203</span> |
|||
<span id="204">204</span> |
|||
<span id="205">205</span> |
|||
<span id="206">206</span> |
|||
<span id="207">207</span> |
|||
<span id="208">208</span> |
|||
<span id="209">209</span> |
|||
<span id="210">210</span> |
|||
<span id="211">211</span> |
|||
<span id="212">212</span> |
|||
<span id="213">213</span> |
|||
<span id="214">214</span> |
|||
<span id="215">215</span> |
|||
<span id="216">216</span> |
|||
<span id="217">217</span> |
|||
<span id="218">218</span> |
|||
<span id="219">219</span> |
|||
<span id="220">220</span> |
|||
<span id="221">221</span> |
|||
<span id="222">222</span> |
|||
<span id="223">223</span> |
|||
<span id="224">224</span> |
|||
<span id="225">225</span> |
|||
<span id="226">226</span> |
|||
<span id="227">227</span> |
|||
<span id="228">228</span> |
|||
<span id="229">229</span> |
|||
<span id="230">230</span> |
|||
<span id="231">231</span> |
|||
<span id="232">232</span> |
|||
<span id="233">233</span> |
|||
<span id="234">234</span> |
|||
<span id="235">235</span> |
|||
<span id="236">236</span> |
|||
<span id="237">237</span> |
|||
<span id="238">238</span> |
|||
<span id="239">239</span> |
|||
<span id="240">240</span> |
|||
<span id="241">241</span> |
|||
<span id="242">242</span> |
|||
<span id="243">243</span> |
|||
<span id="244">244</span> |
|||
<span id="245">245</span> |
|||
<span id="246">246</span> |
|||
<span id="247">247</span> |
|||
<span id="248">248</span> |
|||
<span id="249">249</span> |
|||
<span id="250">250</span> |
|||
<span id="251">251</span> |
|||
<span id="252">252</span> |
|||
<span id="253">253</span> |
|||
<span id="254">254</span> |
|||
<span id="255">255</span> |
|||
<span id="256">256</span> |
|||
<span id="257">257</span> |
|||
<span id="258">258</span> |
|||
<span id="259">259</span> |
|||
<span id="260">260</span> |
|||
<span id="261">261</span> |
|||
<span id="262">262</span> |
|||
<span id="263">263</span> |
|||
<span id="264">264</span> |
|||
<span id="265">265</span> |
|||
<span id="266">266</span> |
|||
<span id="267">267</span> |
|||
<span id="268">268</span> |
|||
<span id="269">269</span> |
|||
<span id="270">270</span> |
|||
<span id="271">271</span> |
|||
<span id="272">272</span> |
|||
<span id="273">273</span> |
|||
<span id="274">274</span> |
|||
<span id="275">275</span> |
|||
<span id="276">276</span> |
|||
<span id="277">277</span> |
|||
<span id="278">278</span> |
|||
<span id="279">279</span> |
|||
<span id="280">280</span> |
|||
<span id="281">281</span> |
|||
<span id="282">282</span> |
|||
<span id="283">283</span> |
|||
<span id="284">284</span> |
|||
<span id="285">285</span> |
|||
<span id="286">286</span> |
|||
<span id="287">287</span> |
|||
<span id="288">288</span> |
|||
<span id="289">289</span> |
|||
<span id="290">290</span> |
|||
<span id="291">291</span> |
|||
<span id="292">292</span> |
|||
<span id="293">293</span> |
|||
<span id="294">294</span> |
|||
<span id="295">295</span> |
|||
<span id="296">296</span> |
|||
<span id="297">297</span> |
|||
<span id="298">298</span> |
|||
<span id="299">299</span> |
|||
<span id="300">300</span> |
|||
<span id="301">301</span> |
|||
<span id="302">302</span> |
|||
<span id="303">303</span> |
|||
<span id="304">304</span> |
|||
<span id="305">305</span> |
|||
<span id="306">306</span> |
|||
<span id="307">307</span> |
|||
<span id="308">308</span> |
|||
<span id="309">309</span> |
|||
<span id="310">310</span> |
|||
<span id="311">311</span> |
|||
<span id="312">312</span> |
|||
<span id="313">313</span> |
|||
<span id="314">314</span> |
|||
<span id="315">315</span> |
|||
<span id="316">316</span> |
|||
<span id="317">317</span> |
|||
<span id="318">318</span> |
|||
<span id="319">319</span> |
|||
<span id="320">320</span> |
|||
<span id="321">321</span> |
|||
<span id="322">322</span> |
|||
<span id="323">323</span> |
|||
<span id="324">324</span> |
|||
<span id="325">325</span> |
|||
<span id="326">326</span> |
|||
<span id="327">327</span> |
|||
<span id="328">328</span> |
|||
<span id="329">329</span> |
|||
<span id="330">330</span> |
|||
<span id="331">331</span> |
|||
</pre><pre class='rust '> |
|||
<span class='doccomment'>//! [Complex numbers][1].</span> |
|||
<span class='doccomment'>//!</span> |
|||
<span class='doccomment'>//! [1]: https://en.wikipedia.org/wiki/Complex_number</span> |
|||
|
|||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>fmt</span>::<span class='ident'>Debug</span>; |
|||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>ops</span>::{<span class='ident'>Add</span>, <span class='ident'>Div</span>, <span class='ident'>Mul</span>, <span class='ident'>Neg</span>, <span class='ident'>Sub</span>}; |
|||
|
|||
<span class='doccomment'>/// A number.</span> |
|||
<span class='kw'>pub</span> <span class='kw'>trait</span> <span class='ident'>Number</span>: <span class='ident'>Add</span><span class='op'><</span><span class='ident'>Output</span><span class='op'>=</span><span class='kw'>Self</span><span class='op'>></span> <span class='op'>+</span> |
|||
<span class='ident'>Div</span><span class='op'><</span><span class='ident'>Output</span><span class='op'>=</span><span class='kw'>Self</span><span class='op'>></span> <span class='op'>+</span> |
|||
<span class='ident'>Mul</span><span class='op'><</span><span class='ident'>Output</span><span class='op'>=</span><span class='kw'>Self</span><span class='op'>></span> <span class='op'>+</span> |
|||
<span class='ident'>Neg</span><span class='op'><</span><span class='ident'>Output</span><span class='op'>=</span><span class='kw'>Self</span><span class='op'>></span> <span class='op'>+</span> |
|||
<span class='ident'>Sub</span><span class='op'><</span><span class='ident'>Output</span><span class='op'>=</span><span class='kw'>Self</span><span class='op'>></span> <span class='op'>+</span> |
|||
<span class='ident'>Copy</span> <span class='op'>+</span> <span class='ident'>Debug</span> <span class='op'>+</span> <span class='ident'>PartialEq</span> { |
|||
} |
|||
|
|||
<span class='doccomment'>/// A real number.</span> |
|||
<span class='kw'>pub</span> <span class='kw'>trait</span> <span class='ident'>Real</span>: <span class='ident'>Number</span> { |
|||
} |
|||
|
|||
<span class='doccomment'>/// A complex number.</span> |
|||
<span class='kw'>pub</span> <span class='kw'>trait</span> <span class='ident'>Complex</span>: <span class='ident'>Number</span> { |
|||
<span class='doccomment'>/// A real number.</span> |
|||
<span class='kw'>type</span> <span class='ident'>Real</span>: <span class='ident'>Real</span>; |
|||
|
|||
<span class='doccomment'>/// Create a complex number from a real and an imaginary part.</span> |
|||
<span class='kw'>fn</span> <span class='ident'>new</span>(<span class='ident'>Self</span>::<span class='ident'>Real</span>, <span class='ident'>Self</span>::<span class='ident'>Real</span>) <span class='op'>-></span> <span class='kw'>Self</span>; |
|||
|
|||
<span class='doccomment'>/// Create a complex number from a modulus and an argument.</span> |
|||
<span class='kw'>fn</span> <span class='ident'>from_polar</span>(<span class='ident'>Self</span>::<span class='ident'>Real</span>, <span class='ident'>Self</span>::<span class='ident'>Real</span>) <span class='op'>-></span> <span class='kw'>Self</span>; |
|||
|
|||
<span class='doccomment'>/// Return the real part.</span> |
|||
<span class='kw'>fn</span> <span class='ident'>re</span>(<span class='kw-2'>&</span><span class='self'>self</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Real</span>; |
|||
|
|||
<span class='doccomment'>/// Return the real part as a mutable reference.</span> |
|||
<span class='kw'>fn</span> <span class='ident'>re_mut</span>(<span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>self</span>) <span class='op'>-></span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='ident'>Self</span>::<span class='ident'>Real</span>; |
|||
|
|||
<span class='doccomment'>/// Return the imaginary part.</span> |
|||
<span class='kw'>fn</span> <span class='ident'>im</span>(<span class='kw-2'>&</span><span class='self'>self</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Real</span>; |
|||
|
|||
<span class='doccomment'>/// Return the imaginary part as a mutable reference.</span> |
|||
<span class='kw'>fn</span> <span class='ident'>im_mut</span>(<span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>self</span>) <span class='op'>-></span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='ident'>Self</span>::<span class='ident'>Real</span>; |
|||
|
|||
<span class='doccomment'>/// Compute the modulus.</span> |
|||
<span class='kw'>fn</span> <span class='ident'>abs</span>(<span class='kw-2'>&</span><span class='self'>self</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Real</span>; |
|||
|
|||
<span class='doccomment'>/// Compute the argument.</span> |
|||
<span class='kw'>fn</span> <span class='ident'>arg</span>(<span class='kw-2'>&</span><span class='self'>self</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Real</span>; |
|||
|
|||
<span class='doccomment'>/// Compute the modulus and the argument.</span> |
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>to_polar</span>(<span class='kw-2'>&</span><span class='self'>self</span>) <span class='op'>-></span> (<span class='ident'>Self</span>::<span class='ident'>Real</span>, <span class='ident'>Self</span>::<span class='ident'>Real</span>) { |
|||
(<span class='self'>self</span>.<span class='ident'>abs</span>(), <span class='self'>self</span>.<span class='ident'>arg</span>()) |
|||
} |
|||
|
|||
<span class='doccomment'>/// Compute the complex conjugate.</span> |
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>conj</span>(<span class='kw-2'>&</span><span class='self'>self</span>) <span class='op'>-></span> <span class='kw'>Self</span> { |
|||
<span class='ident'>Complex</span>::<span class='ident'>new</span>(<span class='self'>self</span>.<span class='ident'>re</span>(), <span class='op'>-</span><span class='self'>self</span>.<span class='ident'>im</span>()) |
|||
} |
|||
} |
|||
|
|||
<span class='doccomment'>/// A complex number with 32-bit parts.</span> |
|||
<span class='attribute'>#[<span class='ident'>allow</span>(<span class='ident'>non_camel_case_types</span>)]</span> |
|||
<span class='attribute'>#[<span class='ident'>derive</span>(<span class='ident'>Clone</span>, <span class='ident'>Copy</span>, <span class='ident'>Debug</span>, <span class='ident'>PartialEq</span>)]</span> |
|||
<span class='kw'>pub</span> <span class='kw'>struct</span> <span class='ident'>c32</span>(<span class='kw'>pub</span> <span class='ident'>f32</span>, <span class='kw'>pub</span> <span class='ident'>f32</span>); |
|||
|
|||
<span class='doccomment'>/// A complex number with 64-bit parts.</span> |
|||
<span class='attribute'>#[<span class='ident'>allow</span>(<span class='ident'>non_camel_case_types</span>)]</span> |
|||
<span class='attribute'>#[<span class='ident'>derive</span>(<span class='ident'>Clone</span>, <span class='ident'>Copy</span>, <span class='ident'>Debug</span>, <span class='ident'>PartialEq</span>)]</span> |
|||
<span class='kw'>pub</span> <span class='kw'>struct</span> <span class='ident'>c64</span>(<span class='kw'>pub</span> <span class='ident'>f64</span>, <span class='kw'>pub</span> <span class='ident'>f64</span>); |
|||
|
|||
<span class='macro'>macro_rules</span><span class='macro'>!</span> <span class='ident'>implement</span>( |
|||
(<span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span>:<span class='ident'>ident</span>, <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span>:<span class='ident'>ty</span>) <span class='op'>=></span> ( |
|||
<span class='kw'>impl</span> <span class='ident'>Number</span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span> { |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Number</span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span> { |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Real</span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span> { |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Complex</span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span> { |
|||
<span class='kw'>type</span> <span class='ident'>Real</span> <span class='op'>=</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>new</span>(<span class='ident'>re</span>: <span class='ident'>Self</span>::<span class='ident'>Real</span>, <span class='ident'>im</span>: <span class='ident'>Self</span>::<span class='ident'>Real</span>) <span class='op'>-></span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span> { |
|||
<span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span>(<span class='ident'>re</span>, <span class='ident'>im</span>) |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>from_polar</span>(<span class='ident'>abs</span>: <span class='ident'>Self</span>::<span class='ident'>Real</span>, <span class='ident'>arg</span>: <span class='ident'>Self</span>::<span class='ident'>Real</span>) <span class='op'>-></span> <span class='kw'>Self</span> { |
|||
<span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span>(<span class='ident'>abs</span> <span class='op'>*</span> <span class='ident'>arg</span>.<span class='ident'>cos</span>(), <span class='ident'>abs</span> <span class='op'>*</span> <span class='ident'>arg</span>.<span class='ident'>sin</span>()) |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>re</span>(<span class='kw-2'>&</span><span class='self'>self</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Real</span> { |
|||
<span class='self'>self</span>.<span class='number'>0</span> |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>re_mut</span>(<span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>self</span>) <span class='op'>-></span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='ident'>Self</span>::<span class='ident'>Real</span> { |
|||
<span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>self</span>.<span class='number'>0</span> |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>im</span>(<span class='kw-2'>&</span><span class='self'>self</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Real</span> { |
|||
<span class='self'>self</span>.<span class='number'>1</span> |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>im_mut</span>(<span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>self</span>) <span class='op'>-></span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='ident'>Self</span>::<span class='ident'>Real</span> { |
|||
<span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>self</span>.<span class='number'>1</span> |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>abs</span>(<span class='kw-2'>&</span><span class='self'>self</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Real</span> { |
|||
<span class='self'>self</span>.<span class='ident'>re</span>().<span class='ident'>hypot</span>(<span class='self'>self</span>.<span class='ident'>im</span>()) |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>arg</span>(<span class='kw-2'>&</span><span class='self'>self</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Real</span> { |
|||
<span class='self'>self</span>.<span class='ident'>im</span>().<span class='ident'>atan2</span>(<span class='self'>self</span>.<span class='ident'>re</span>()) |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Add</span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span> { |
|||
<span class='kw'>type</span> <span class='ident'>Output</span> <span class='op'>=</span> <span class='kw'>Self</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>add</span>(<span class='self'>self</span>, <span class='ident'>rhs</span>: <span class='kw'>Self</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Output</span> { |
|||
<span class='ident'>Complex</span>::<span class='ident'>new</span>(<span class='self'>self</span>.<span class='ident'>re</span>() <span class='op'>+</span> <span class='ident'>rhs</span>.<span class='ident'>re</span>(), <span class='self'>self</span>.<span class='ident'>im</span>() <span class='op'>+</span> <span class='ident'>rhs</span>.<span class='ident'>im</span>()) |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Add</span><span class='op'><</span><span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span><span class='op'>></span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span> { |
|||
<span class='kw'>type</span> <span class='ident'>Output</span> <span class='op'>=</span> <span class='kw'>Self</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>add</span>(<span class='self'>self</span>, <span class='ident'>rhs</span>: <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Output</span> { |
|||
<span class='ident'>Complex</span>::<span class='ident'>new</span>(<span class='self'>self</span>.<span class='ident'>re</span>() <span class='op'>+</span> <span class='ident'>rhs</span>, <span class='self'>self</span>.<span class='ident'>im</span>()) |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Add</span><span class='op'><</span><span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span><span class='op'>></span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span> { |
|||
<span class='kw'>type</span> <span class='ident'>Output</span> <span class='op'>=</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>add</span>(<span class='self'>self</span>, <span class='ident'>rhs</span>: <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Output</span> { |
|||
<span class='ident'>Complex</span>::<span class='ident'>new</span>(<span class='self'>self</span> <span class='op'>+</span> <span class='ident'>rhs</span>.<span class='ident'>re</span>(), <span class='ident'>rhs</span>.<span class='ident'>im</span>()) |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Div</span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span> { |
|||
<span class='kw'>type</span> <span class='ident'>Output</span> <span class='op'>=</span> <span class='kw'>Self</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>div</span>(<span class='self'>self</span>, <span class='ident'>rhs</span>: <span class='kw'>Self</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Output</span> { |
|||
<span class='kw'>let</span> <span class='ident'>denominator</span> <span class='op'>=</span> <span class='ident'>rhs</span>.<span class='ident'>re</span>() <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>re</span>() <span class='op'>+</span> <span class='ident'>rhs</span>.<span class='ident'>im</span>() <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>im</span>(); |
|||
<span class='ident'>Complex</span>::<span class='ident'>new</span>((<span class='self'>self</span>.<span class='ident'>re</span>() <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>re</span>() <span class='op'>+</span> <span class='self'>self</span>.<span class='ident'>im</span>() <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>im</span>()) <span class='op'>/</span> <span class='ident'>denominator</span>, |
|||
(<span class='self'>self</span>.<span class='ident'>im</span>() <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>re</span>() <span class='op'>-</span> <span class='self'>self</span>.<span class='ident'>re</span>() <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>im</span>()) <span class='op'>/</span> <span class='ident'>denominator</span>) |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Div</span><span class='op'><</span><span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span><span class='op'>></span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span> { |
|||
<span class='kw'>type</span> <span class='ident'>Output</span> <span class='op'>=</span> <span class='kw'>Self</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>div</span>(<span class='self'>self</span>, <span class='ident'>rhs</span>: <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Output</span> { |
|||
<span class='ident'>Complex</span>::<span class='ident'>new</span>(<span class='self'>self</span>.<span class='ident'>re</span>() <span class='op'>/</span> <span class='ident'>rhs</span>, <span class='self'>self</span>.<span class='ident'>im</span>() <span class='op'>/</span> <span class='ident'>rhs</span>) |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Div</span><span class='op'><</span><span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span><span class='op'>></span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span> { |
|||
<span class='kw'>type</span> <span class='ident'>Output</span> <span class='op'>=</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>div</span>(<span class='self'>self</span>, <span class='ident'>rhs</span>: <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Output</span> { |
|||
<span class='kw'>let</span> <span class='ident'>denominator</span> <span class='op'>=</span> <span class='ident'>rhs</span>.<span class='ident'>re</span>() <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>re</span>() <span class='op'>+</span> <span class='ident'>rhs</span>.<span class='ident'>im</span>() <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>im</span>(); |
|||
<span class='ident'>Complex</span>::<span class='ident'>new</span>((<span class='self'>self</span> <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>re</span>()) <span class='op'>/</span> <span class='ident'>denominator</span>, (<span class='op'>-</span><span class='self'>self</span> <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>im</span>()) <span class='op'>/</span> <span class='ident'>denominator</span>) |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Mul</span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span> { |
|||
<span class='kw'>type</span> <span class='ident'>Output</span> <span class='op'>=</span> <span class='kw'>Self</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>mul</span>(<span class='self'>self</span>, <span class='ident'>rhs</span>: <span class='kw'>Self</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Output</span> { |
|||
<span class='ident'>Complex</span>::<span class='ident'>new</span>(<span class='self'>self</span>.<span class='ident'>re</span>() <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>re</span>() <span class='op'>-</span> <span class='self'>self</span>.<span class='ident'>im</span>() <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>im</span>(), |
|||
<span class='self'>self</span>.<span class='ident'>im</span>() <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>re</span>() <span class='op'>+</span> <span class='self'>self</span>.<span class='ident'>re</span>() <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>im</span>()) |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Mul</span><span class='op'><</span><span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span><span class='op'>></span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span> { |
|||
<span class='kw'>type</span> <span class='ident'>Output</span> <span class='op'>=</span> <span class='kw'>Self</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>mul</span>(<span class='self'>self</span>, <span class='ident'>rhs</span>: <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Output</span> { |
|||
<span class='ident'>Complex</span>::<span class='ident'>new</span>(<span class='self'>self</span>.<span class='ident'>re</span>() <span class='op'>*</span> <span class='ident'>rhs</span>, <span class='self'>self</span>.<span class='ident'>im</span>() <span class='op'>*</span> <span class='ident'>rhs</span>) |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Mul</span><span class='op'><</span><span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span><span class='op'>></span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span> { |
|||
<span class='kw'>type</span> <span class='ident'>Output</span> <span class='op'>=</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>mul</span>(<span class='self'>self</span>, <span class='ident'>rhs</span>: <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Output</span> { |
|||
<span class='ident'>Complex</span>::<span class='ident'>new</span>(<span class='self'>self</span> <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>re</span>(), <span class='self'>self</span> <span class='op'>*</span> <span class='ident'>rhs</span>.<span class='ident'>im</span>()) |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Neg</span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span> { |
|||
<span class='kw'>type</span> <span class='ident'>Output</span> <span class='op'>=</span> <span class='kw'>Self</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>neg</span>(<span class='self'>self</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Output</span> { |
|||
<span class='ident'>Complex</span>::<span class='ident'>new</span>(<span class='op'>-</span><span class='self'>self</span>.<span class='ident'>re</span>(), <span class='op'>-</span><span class='self'>self</span>.<span class='ident'>im</span>()) |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Sub</span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span> { |
|||
<span class='kw'>type</span> <span class='ident'>Output</span> <span class='op'>=</span> <span class='kw'>Self</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>sub</span>(<span class='self'>self</span>, <span class='ident'>rhs</span>: <span class='kw'>Self</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Output</span> { |
|||
<span class='ident'>Complex</span>::<span class='ident'>new</span>(<span class='self'>self</span>.<span class='ident'>re</span>() <span class='op'>-</span> <span class='ident'>rhs</span>.<span class='ident'>re</span>(), <span class='self'>self</span>.<span class='ident'>im</span>() <span class='op'>-</span> <span class='ident'>rhs</span>.<span class='ident'>im</span>()) |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Sub</span><span class='op'><</span><span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span><span class='op'>></span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span> { |
|||
<span class='kw'>type</span> <span class='ident'>Output</span> <span class='op'>=</span> <span class='kw'>Self</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>sub</span>(<span class='self'>self</span>, <span class='ident'>rhs</span>: <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Output</span> { |
|||
<span class='ident'>Complex</span>::<span class='ident'>new</span>(<span class='self'>self</span>.<span class='ident'>re</span>() <span class='op'>-</span> <span class='ident'>rhs</span>, <span class='self'>self</span>.<span class='ident'>im</span>()) |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>impl</span> <span class='ident'>Sub</span><span class='op'><</span><span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span><span class='op'>></span> <span class='kw'>for</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>real</span> { |
|||
<span class='kw'>type</span> <span class='ident'>Output</span> <span class='op'>=</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>sub</span>(<span class='self'>self</span>, <span class='ident'>rhs</span>: <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>complex</span>) <span class='op'>-></span> <span class='ident'>Self</span>::<span class='ident'>Output</span> { |
|||
<span class='ident'>Complex</span>::<span class='ident'>new</span>(<span class='self'>self</span> <span class='op'>-</span> <span class='ident'>rhs</span>.<span class='ident'>re</span>(), <span class='op'>-</span><span class='ident'>rhs</span>.<span class='ident'>im</span>()) |
|||
} |
|||
} |
|||
); |
|||
); |
|||
|
|||
<span class='macro'>implement</span><span class='macro'>!</span>(<span class='ident'>c32</span>, <span class='ident'>f32</span>); |
|||
<span class='macro'>implement</span><span class='macro'>!</span>(<span class='ident'>c64</span>, <span class='ident'>f64</span>); |
|||
|
|||
<span class='attribute'>#[<span class='ident'>cfg</span>(<span class='ident'>test</span>)]</span> |
|||
<span class='kw'>mod</span> <span class='ident'>tests</span> { |
|||
<span class='kw'>use</span> {<span class='ident'>Complex</span>, <span class='ident'>c64</span>}; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>test</span>]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>re_mut</span>() { |
|||
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>number</span> <span class='op'>=</span> <span class='ident'>c64</span>(<span class='number'>69.0</span>, <span class='number'>0.0</span>); |
|||
<span class='op'>*</span><span class='ident'>number</span>.<span class='ident'>re_mut</span>() <span class='op'>=</span> <span class='number'>42.0</span>; |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>number</span>, <span class='ident'>c64</span>(<span class='number'>42.0</span>, <span class='number'>0.0</span>)); |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>test</span>]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>im_mut</span>() { |
|||
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>number</span> <span class='op'>=</span> <span class='ident'>c64</span>(<span class='number'>0.0</span>, <span class='number'>69.0</span>); |
|||
<span class='op'>*</span><span class='ident'>number</span>.<span class='ident'>im_mut</span>() <span class='op'>=</span> <span class='number'>42.0</span>; |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>number</span>, <span class='ident'>c64</span>(<span class='number'>0.0</span>, <span class='number'>42.0</span>)); |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>test</span>]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>abs</span>() { |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='number'>4.0</span>, <span class='number'>3.0</span>).<span class='ident'>abs</span>(), <span class='number'>5.0</span>); |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>test</span>]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>arg</span>() { |
|||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>f64</span>::<span class='ident'>consts</span>::<span class='ident'>PI</span>; |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='number'>1.0</span>, <span class='number'>0.0</span>).<span class='ident'>arg</span>(), <span class='number'>0.0</span>); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='number'>1.0</span>, <span class='number'>1.0</span>).<span class='ident'>arg</span>(), <span class='ident'>PI</span> <span class='op'>/</span> <span class='number'>4.0</span>); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='number'>0.0</span>, <span class='number'>1.0</span>).<span class='ident'>arg</span>(), <span class='ident'>PI</span> <span class='op'>/</span> <span class='number'>2.0</span>); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='op'>-</span><span class='number'>1.0</span>, <span class='number'>0.0</span>).<span class='ident'>arg</span>(), <span class='ident'>PI</span>); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='number'>0.0</span>, <span class='op'>-</span><span class='number'>1.0</span>).<span class='ident'>arg</span>(), <span class='op'>-</span><span class='ident'>PI</span> <span class='op'>/</span> <span class='number'>2.0</span>); |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>test</span>]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>conj</span>() { |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='number'>42.0</span>, <span class='number'>69.0</span>).<span class='ident'>conj</span>(), <span class='ident'>c64</span>(<span class='number'>42.0</span>, <span class='op'>-</span><span class='number'>69.0</span>)); |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>test</span>]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>add</span>() { |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='op'>-</span><span class='number'>4.0</span>, <span class='number'>7.0</span>) <span class='op'>+</span> <span class='ident'>c64</span>(<span class='number'>5.0</span>, <span class='op'>-</span><span class='number'>10.0</span>), <span class='ident'>c64</span>(<span class='number'>1.0</span>, <span class='op'>-</span><span class='number'>3.0</span>)); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='op'>-</span><span class='number'>4.0</span>, <span class='number'>7.0</span>) <span class='op'>+</span> <span class='number'>5.0</span>, <span class='ident'>c64</span>(<span class='number'>1.0</span>, <span class='number'>7.0</span>)); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>5.0</span> <span class='op'>+</span> <span class='ident'>c64</span>(<span class='op'>-</span><span class='number'>4.0</span>, <span class='number'>7.0</span>), <span class='ident'>c64</span>(<span class='number'>1.0</span>, <span class='number'>7.0</span>)); |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>test</span>]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>div</span>() { |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='number'>3.0</span>, <span class='op'>-</span><span class='number'>1.0</span>) <span class='op'>/</span> <span class='ident'>c64</span>(<span class='number'>2.0</span>, <span class='number'>7.0</span>), <span class='ident'>c64</span>(<span class='op'>-</span><span class='number'>1.0</span> <span class='op'>/</span> <span class='number'>53.0</span>, <span class='op'>-</span><span class='number'>23.0</span> <span class='op'>/</span> <span class='number'>53.0</span>)); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='number'>3.0</span>, <span class='op'>-</span><span class='number'>1.0</span>) <span class='op'>/</span> <span class='number'>2.0</span>, <span class='ident'>c64</span>(<span class='number'>1.5</span>, <span class='op'>-</span><span class='number'>0.5</span>)); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>2.0</span> <span class='op'>/</span> <span class='ident'>c64</span>(<span class='number'>3.0</span>, <span class='op'>-</span><span class='number'>1.0</span>), <span class='ident'>c64</span>(<span class='number'>0.6</span>, <span class='number'>0.2</span>)); |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>test</span>]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>mul</span>() { |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='number'>4.0</span>, <span class='number'>1.0</span>) <span class='op'>*</span> <span class='ident'>c64</span>(<span class='number'>2.0</span>, <span class='number'>3.0</span>), <span class='ident'>c64</span>(<span class='number'>5.0</span>, <span class='number'>14.0</span>)); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='number'>4.0</span>, <span class='number'>1.0</span>) <span class='op'>*</span> <span class='number'>2.0</span>, <span class='ident'>c64</span>(<span class='number'>8.0</span>, <span class='number'>2.0</span>)); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>2.0</span> <span class='op'>*</span> <span class='ident'>c64</span>(<span class='number'>4.0</span>, <span class='number'>1.0</span>), <span class='ident'>c64</span>(<span class='number'>8.0</span>, <span class='number'>2.0</span>)); |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>test</span>]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>neg</span>() { |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='op'>-</span><span class='ident'>c64</span>(<span class='number'>42.0</span>, <span class='number'>69.0</span>), <span class='ident'>c64</span>(<span class='number'>42.0</span>, <span class='number'>69.0</span>) <span class='op'>*</span> (<span class='op'>-</span><span class='number'>1.0</span>)); |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>test</span>]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>sub</span>() { |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='number'>4.0</span>, <span class='number'>12.0</span>) <span class='op'>-</span> <span class='ident'>c64</span>(<span class='number'>3.0</span>, <span class='op'>-</span><span class='number'>15.0</span>), <span class='ident'>c64</span>(<span class='number'>1.0</span>, <span class='number'>27.0</span>)); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c64</span>(<span class='number'>4.0</span>, <span class='number'>12.0</span>) <span class='op'>-</span> <span class='number'>3.0</span>, <span class='ident'>c64</span>(<span class='number'>1.0</span>, <span class='number'>12.0</span>)); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='number'>3.0</span> <span class='op'>-</span> <span class='ident'>c64</span>(<span class='number'>4.0</span>, <span class='number'>12.0</span>), <span class='ident'>c64</span>(<span class='op'>-</span><span class='number'>1.0</span>, <span class='op'>-</span><span class='number'>12.0</span>)); |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>test</span>]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>size_of</span>() { |
|||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>mem</span>::<span class='ident'>size_of</span>; |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>size_of</span>::<span class='op'><</span><span class='ident'>c64</span><span class='op'>></span>(), <span class='number'>2</span> <span class='op'>*</span> <span class='ident'>size_of</span>::<span class='op'><</span><span class='ident'>f64</span><span class='op'>></span>()); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>size_of</span>::<span class='op'><</span>[<span class='ident'>c64</span>; <span class='number'>42</span>]<span class='op'>></span>(), <span class='ident'>size_of</span>::<span class='op'><</span>[<span class='ident'>f64</span>; <span class='number'>2</span> <span class='op'>*</span> <span class='number'>42</span>]<span class='op'>></span>()); |
|||
} |
|||
} |
|||
</pre> |
|||
</section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../../"; |
|||
window.currentCrate = "complex"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../../jquery.js"></script> |
|||
<script src="../../main.js"></script> |
|||
|
|||
<script async src="../../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,259 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="Source to the Rust file `src/complex.rs`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang"> |
|||
|
|||
<title>complex.rs.html -- source</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
|
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content source"><pre class="line-numbers"><span id="1"> 1</span> |
|||
<span id="2"> 2</span> |
|||
<span id="3"> 3</span> |
|||
<span id="4"> 4</span> |
|||
<span id="5"> 5</span> |
|||
<span id="6"> 6</span> |
|||
<span id="7"> 7</span> |
|||
<span id="8"> 8</span> |
|||
<span id="9"> 9</span> |
|||
<span id="10">10</span> |
|||
<span id="11">11</span> |
|||
<span id="12">12</span> |
|||
<span id="13">13</span> |
|||
<span id="14">14</span> |
|||
<span id="15">15</span> |
|||
<span id="16">16</span> |
|||
<span id="17">17</span> |
|||
<span id="18">18</span> |
|||
<span id="19">19</span> |
|||
<span id="20">20</span> |
|||
<span id="21">21</span> |
|||
<span id="22">22</span> |
|||
<span id="23">23</span> |
|||
<span id="24">24</span> |
|||
<span id="25">25</span> |
|||
<span id="26">26</span> |
|||
<span id="27">27</span> |
|||
<span id="28">28</span> |
|||
<span id="29">29</span> |
|||
<span id="30">30</span> |
|||
<span id="31">31</span> |
|||
<span id="32">32</span> |
|||
<span id="33">33</span> |
|||
<span id="34">34</span> |
|||
<span id="35">35</span> |
|||
<span id="36">36</span> |
|||
<span id="37">37</span> |
|||
<span id="38">38</span> |
|||
<span id="39">39</span> |
|||
<span id="40">40</span> |
|||
<span id="41">41</span> |
|||
<span id="42">42</span> |
|||
<span id="43">43</span> |
|||
<span id="44">44</span> |
|||
<span id="45">45</span> |
|||
<span id="46">46</span> |
|||
<span id="47">47</span> |
|||
<span id="48">48</span> |
|||
<span id="49">49</span> |
|||
<span id="50">50</span> |
|||
<span id="51">51</span> |
|||
<span id="52">52</span> |
|||
<span id="53">53</span> |
|||
<span id="54">54</span> |
|||
<span id="55">55</span> |
|||
<span id="56">56</span> |
|||
<span id="57">57</span> |
|||
<span id="58">58</span> |
|||
<span id="59">59</span> |
|||
<span id="60">60</span> |
|||
<span id="61">61</span> |
|||
<span id="62">62</span> |
|||
<span id="63">63</span> |
|||
<span id="64">64</span> |
|||
<span id="65">65</span> |
|||
<span id="66">66</span> |
|||
<span id="67">67</span> |
|||
<span id="68">68</span> |
|||
<span id="69">69</span> |
|||
<span id="70">70</span> |
|||
<span id="71">71</span> |
|||
<span id="72">72</span> |
|||
<span id="73">73</span> |
|||
<span id="74">74</span> |
|||
<span id="75">75</span> |
|||
<span id="76">76</span> |
|||
<span id="77">77</span> |
|||
<span id="78">78</span> |
|||
<span id="79">79</span> |
|||
<span id="80">80</span> |
|||
<span id="81">81</span> |
|||
</pre><pre class='rust '> |
|||
<span class='doccomment'>//! Transformation of complex data.</span> |
|||
|
|||
<span class='comment'>// The implementation is based on:</span> |
|||
<span class='comment'>// http://www.librow.com/articles/article-10</span> |
|||
|
|||
<span class='kw'>use</span> <span class='ident'>number</span>::<span class='ident'>c64</span>; |
|||
|
|||
<span class='doccomment'>/// Perform the forward transform.</span> |
|||
<span class='doccomment'>///</span> |
|||
<span class='doccomment'>/// The number of points should be a power of two.</span> |
|||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>forward</span>(<span class='ident'>data</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='ident'>c64</span>]) { |
|||
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='macro'>power_of_two</span><span class='macro'>!</span>(<span class='ident'>data</span>); |
|||
<span class='ident'>rearrange</span>(<span class='ident'>data</span>, <span class='ident'>n</span>); |
|||
<span class='ident'>transform</span>(<span class='ident'>data</span>, <span class='ident'>n</span>, <span class='boolval'>false</span>); |
|||
} |
|||
|
|||
<span class='doccomment'>/// Perform the backward transform.</span> |
|||
<span class='doccomment'>///</span> |
|||
<span class='doccomment'>/// The number of points should be a power of two.</span> |
|||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>backward</span>(<span class='ident'>data</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='ident'>c64</span>]) { |
|||
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='macro'>power_of_two</span><span class='macro'>!</span>(<span class='ident'>data</span>); |
|||
<span class='ident'>rearrange</span>(<span class='ident'>data</span>, <span class='ident'>n</span>); |
|||
<span class='ident'>transform</span>(<span class='ident'>data</span>, <span class='ident'>n</span>, <span class='boolval'>true</span>); |
|||
} |
|||
|
|||
<span class='doccomment'>/// Perform the inverse transform.</span> |
|||
<span class='doccomment'>///</span> |
|||
<span class='doccomment'>/// The number of points should be a power of two.</span> |
|||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>inverse</span>(<span class='ident'>data</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='ident'>c64</span>]) { |
|||
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='macro'>power_of_two</span><span class='macro'>!</span>(<span class='ident'>data</span>); |
|||
<span class='ident'>rearrange</span>(<span class='ident'>data</span>, <span class='ident'>n</span>); |
|||
<span class='ident'>transform</span>(<span class='ident'>data</span>, <span class='ident'>n</span>, <span class='boolval'>true</span>); |
|||
<span class='ident'>scale</span>(<span class='ident'>data</span>, <span class='ident'>n</span>); |
|||
} |
|||
|
|||
<span class='kw'>fn</span> <span class='ident'>rearrange</span>(<span class='ident'>data</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='ident'>c64</span>], <span class='ident'>n</span>: <span class='ident'>usize</span>) { |
|||
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>j</span> <span class='op'>=</span> <span class='number'>0</span>; |
|||
<span class='kw'>for</span> <span class='ident'>i</span> <span class='kw'>in</span> <span class='number'>0</span>..<span class='ident'>n</span> { |
|||
<span class='kw'>if</span> <span class='ident'>j</span> <span class='op'>></span> <span class='ident'>i</span> { |
|||
<span class='ident'>data</span>.<span class='ident'>swap</span>(<span class='ident'>i</span>, <span class='ident'>j</span>); |
|||
} |
|||
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>mask</span> <span class='op'>=</span> <span class='ident'>n</span> <span class='op'>>></span> <span class='number'>1</span>; |
|||
<span class='kw'>while</span> <span class='ident'>j</span> <span class='kw-2'>&</span> <span class='ident'>mask</span> <span class='op'>!=</span> <span class='number'>0</span> { |
|||
<span class='ident'>j</span> <span class='op'>&=</span> <span class='op'>!</span><span class='ident'>mask</span>; |
|||
<span class='ident'>mask</span> <span class='op'>>>=</span> <span class='number'>1</span>; |
|||
} |
|||
<span class='ident'>j</span> <span class='op'>|=</span> <span class='ident'>mask</span>; |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>fn</span> <span class='ident'>transform</span>(<span class='ident'>data</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='ident'>c64</span>], <span class='ident'>n</span>: <span class='ident'>usize</span>, <span class='ident'>inverse</span>: <span class='ident'>bool</span>) { |
|||
<span class='kw'>let</span> <span class='ident'>sign</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='ident'>inverse</span> { <span class='number'>1.0</span> } <span class='kw'>else</span> { <span class='op'>-</span><span class='number'>1.0</span> }; |
|||
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>step</span> <span class='op'>=</span> <span class='number'>1</span>; |
|||
<span class='kw'>while</span> <span class='ident'>step</span> <span class='op'><</span> <span class='ident'>n</span> { |
|||
<span class='kw'>let</span> <span class='ident'>jump</span> <span class='op'>=</span> <span class='ident'>step</span> <span class='op'><<</span> <span class='number'>1</span>; |
|||
<span class='kw'>let</span> (<span class='ident'>multiplier</span>, <span class='kw-2'>mut</span> <span class='ident'>factor</span>) <span class='op'>=</span> { |
|||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>f64</span>::<span class='ident'>consts</span>::<span class='ident'>PI</span>; |
|||
<span class='kw'>let</span> <span class='ident'>theta</span> <span class='op'>=</span> <span class='ident'>sign</span> <span class='op'>*</span> <span class='ident'>PI</span> <span class='op'>/</span> <span class='ident'>step</span> <span class='kw'>as</span> <span class='ident'>f64</span>; |
|||
<span class='kw'>let</span> <span class='ident'>sine</span> <span class='op'>=</span> (<span class='number'>0.5</span> <span class='op'>*</span> <span class='ident'>theta</span>).<span class='ident'>sin</span>(); |
|||
(<span class='ident'>c64</span>(<span class='op'>-</span><span class='number'>2.0</span> <span class='op'>*</span> <span class='ident'>sine</span> <span class='op'>*</span> <span class='ident'>sine</span>, <span class='ident'>theta</span>.<span class='ident'>sin</span>()), <span class='ident'>c64</span>(<span class='number'>1.0</span>, <span class='number'>0.0</span>)) |
|||
}; |
|||
<span class='kw'>for</span> <span class='kw-2'>mut</span> <span class='ident'>i</span> <span class='kw'>in</span> <span class='number'>0</span>..<span class='ident'>step</span> { |
|||
<span class='kw'>while</span> <span class='ident'>i</span> <span class='op'><</span> <span class='ident'>n</span> { |
|||
<span class='kw'>let</span> <span class='ident'>j</span> <span class='op'>=</span> <span class='ident'>i</span> <span class='op'>+</span> <span class='ident'>step</span>; |
|||
<span class='kw'>let</span> <span class='ident'>product</span> <span class='op'>=</span> <span class='ident'>factor</span> <span class='op'>*</span> <span class='ident'>data</span>[<span class='ident'>j</span>]; |
|||
<span class='ident'>data</span>[<span class='ident'>j</span>] <span class='op'>=</span> <span class='ident'>data</span>[<span class='ident'>i</span>] <span class='op'>-</span> <span class='ident'>product</span>; |
|||
<span class='ident'>data</span>[<span class='ident'>i</span>] <span class='op'>=</span> <span class='ident'>data</span>[<span class='ident'>i</span>] <span class='op'>+</span> <span class='ident'>product</span>; |
|||
<span class='ident'>i</span> <span class='op'>+=</span> <span class='ident'>jump</span>; |
|||
} |
|||
<span class='ident'>factor</span> <span class='op'>=</span> <span class='ident'>multiplier</span> <span class='op'>*</span> <span class='ident'>factor</span> <span class='op'>+</span> <span class='ident'>factor</span>; |
|||
} |
|||
<span class='ident'>step</span> <span class='op'><<=</span> <span class='number'>1</span>; |
|||
} |
|||
} |
|||
|
|||
<span class='kw'>fn</span> <span class='ident'>scale</span>(<span class='ident'>data</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='ident'>c64</span>], <span class='ident'>n</span>: <span class='ident'>usize</span>) { |
|||
<span class='kw'>let</span> <span class='ident'>factor</span> <span class='op'>=</span> <span class='number'>1.0</span> <span class='op'>/</span> <span class='ident'>n</span> <span class='kw'>as</span> <span class='ident'>f64</span>; |
|||
<span class='kw'>for</span> <span class='ident'>i</span> <span class='kw'>in</span> <span class='number'>0</span>..<span class='ident'>n</span> { |
|||
<span class='ident'>data</span>[<span class='ident'>i</span>] <span class='op'>=</span> <span class='ident'>data</span>[<span class='ident'>i</span>] <span class='op'>*</span> <span class='ident'>factor</span>; |
|||
} |
|||
} |
|||
</pre> |
|||
</section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../../"; |
|||
window.currentCrate = "dft"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../../jquery.js"></script> |
|||
<script src="../../main.js"></script> |
|||
|
|||
<script async src="../../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,133 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="Source to the Rust file `src/lib.rs`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang"> |
|||
|
|||
<title>lib.rs.html -- source</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
|
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content source"><pre class="line-numbers"><span id="1"> 1</span> |
|||
<span id="2"> 2</span> |
|||
<span id="3"> 3</span> |
|||
<span id="4"> 4</span> |
|||
<span id="5"> 5</span> |
|||
<span id="6"> 6</span> |
|||
<span id="7"> 7</span> |
|||
<span id="8"> 8</span> |
|||
<span id="9"> 9</span> |
|||
<span id="10">10</span> |
|||
<span id="11">11</span> |
|||
<span id="12">12</span> |
|||
<span id="13">13</span> |
|||
<span id="14">14</span> |
|||
<span id="15">15</span> |
|||
<span id="16">16</span> |
|||
<span id="17">17</span> |
|||
<span id="18">18</span> |
|||
</pre><pre class='rust '> |
|||
<span class='doccomment'>//! [Discrete Fourier transform][1].</span> |
|||
<span class='doccomment'>//!</span> |
|||
<span class='doccomment'>//! [1]: https://en.wikipedia.org/wiki/Discrete_Fourier_transform</span> |
|||
|
|||
<span class='kw'>extern</span> <span class='kw'>crate</span> <span class='ident'>complex</span> <span class='kw'>as</span> <span class='ident'>number</span>; |
|||
|
|||
<span class='macro'>macro_rules</span><span class='macro'>!</span> <span class='ident'>power_of_two</span>( |
|||
(<span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>data</span>:<span class='ident'>expr</span>) <span class='op'>=></span> ({ |
|||
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>data</span>.<span class='ident'>len</span>(); |
|||
<span class='kw'>if</span> <span class='op'>!</span><span class='ident'>n</span>.<span class='ident'>is_power_of_two</span>() { |
|||
<span class='macro'>panic</span><span class='macro'>!</span>(<span class='string'>"expected the number of points to be a power of two"</span>); |
|||
} |
|||
<span class='ident'>n</span> |
|||
}); |
|||
); |
|||
|
|||
<span class='kw'>pub</span> <span class='kw'>mod</span> <span class='ident'>complex</span>; |
|||
<span class='kw'>pub</span> <span class='kw'>mod</span> <span class='ident'>real</span>; |
|||
</pre> |
|||
</section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../../"; |
|||
window.currentCrate = "dft"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../../jquery.js"></script> |
|||
<script src="../../main.js"></script> |
|||
|
|||
<script async src="../../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,323 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<meta name="generator" content="rustdoc"> |
|||
<meta name="description" content="Source to the Rust file `src/real.rs`."> |
|||
<meta name="keywords" content="rust, rustlang, rust-lang"> |
|||
|
|||
<title>real.rs.html -- source</title> |
|||
|
|||
<link rel="stylesheet" type="text/css" href="../../main.css"> |
|||
|
|||
|
|||
|
|||
</head> |
|||
<body class="rustdoc"> |
|||
<!--[if lte IE 8]> |
|||
<div class="warning"> |
|||
This old browser is unsupported and will most likely display funky |
|||
things. |
|||
</div> |
|||
<![endif]--> |
|||
|
|||
|
|||
|
|||
<section class="sidebar"> |
|||
|
|||
|
|||
</section> |
|||
|
|||
<nav class="sub"> |
|||
<form class="search-form js-only"> |
|||
<div class="search-container"> |
|||
<input class="search-input" name="search" |
|||
autocomplete="off" |
|||
placeholder="Click or press 'S' to search, '?' for more options..." |
|||
type="search"> |
|||
</div> |
|||
</form> |
|||
</nav> |
|||
|
|||
<section id='main' class="content source"><pre class="line-numbers"><span id="1"> 1</span> |
|||
<span id="2"> 2</span> |
|||
<span id="3"> 3</span> |
|||
<span id="4"> 4</span> |
|||
<span id="5"> 5</span> |
|||
<span id="6"> 6</span> |
|||
<span id="7"> 7</span> |
|||
<span id="8"> 8</span> |
|||
<span id="9"> 9</span> |
|||
<span id="10"> 10</span> |
|||
<span id="11"> 11</span> |
|||
<span id="12"> 12</span> |
|||
<span id="13"> 13</span> |
|||
<span id="14"> 14</span> |
|||
<span id="15"> 15</span> |
|||
<span id="16"> 16</span> |
|||
<span id="17"> 17</span> |
|||
<span id="18"> 18</span> |
|||
<span id="19"> 19</span> |
|||
<span id="20"> 20</span> |
|||
<span id="21"> 21</span> |
|||
<span id="22"> 22</span> |
|||
<span id="23"> 23</span> |
|||
<span id="24"> 24</span> |
|||
<span id="25"> 25</span> |
|||
<span id="26"> 26</span> |
|||
<span id="27"> 27</span> |
|||
<span id="28"> 28</span> |
|||
<span id="29"> 29</span> |
|||
<span id="30"> 30</span> |
|||
<span id="31"> 31</span> |
|||
<span id="32"> 32</span> |
|||
<span id="33"> 33</span> |
|||
<span id="34"> 34</span> |
|||
<span id="35"> 35</span> |
|||
<span id="36"> 36</span> |
|||
<span id="37"> 37</span> |
|||
<span id="38"> 38</span> |
|||
<span id="39"> 39</span> |
|||
<span id="40"> 40</span> |
|||
<span id="41"> 41</span> |
|||
<span id="42"> 42</span> |
|||
<span id="43"> 43</span> |
|||
<span id="44"> 44</span> |
|||
<span id="45"> 45</span> |
|||
<span id="46"> 46</span> |
|||
<span id="47"> 47</span> |
|||
<span id="48"> 48</span> |
|||
<span id="49"> 49</span> |
|||
<span id="50"> 50</span> |
|||
<span id="51"> 51</span> |
|||
<span id="52"> 52</span> |
|||
<span id="53"> 53</span> |
|||
<span id="54"> 54</span> |
|||
<span id="55"> 55</span> |
|||
<span id="56"> 56</span> |
|||
<span id="57"> 57</span> |
|||
<span id="58"> 58</span> |
|||
<span id="59"> 59</span> |
|||
<span id="60"> 60</span> |
|||
<span id="61"> 61</span> |
|||
<span id="62"> 62</span> |
|||
<span id="63"> 63</span> |
|||
<span id="64"> 64</span> |
|||
<span id="65"> 65</span> |
|||
<span id="66"> 66</span> |
|||
<span id="67"> 67</span> |
|||
<span id="68"> 68</span> |
|||
<span id="69"> 69</span> |
|||
<span id="70"> 70</span> |
|||
<span id="71"> 71</span> |
|||
<span id="72"> 72</span> |
|||
<span id="73"> 73</span> |
|||
<span id="74"> 74</span> |
|||
<span id="75"> 75</span> |
|||
<span id="76"> 76</span> |
|||
<span id="77"> 77</span> |
|||
<span id="78"> 78</span> |
|||
<span id="79"> 79</span> |
|||
<span id="80"> 80</span> |
|||
<span id="81"> 81</span> |
|||
<span id="82"> 82</span> |
|||
<span id="83"> 83</span> |
|||
<span id="84"> 84</span> |
|||
<span id="85"> 85</span> |
|||
<span id="86"> 86</span> |
|||
<span id="87"> 87</span> |
|||
<span id="88"> 88</span> |
|||
<span id="89"> 89</span> |
|||
<span id="90"> 90</span> |
|||
<span id="91"> 91</span> |
|||
<span id="92"> 92</span> |
|||
<span id="93"> 93</span> |
|||
<span id="94"> 94</span> |
|||
<span id="95"> 95</span> |
|||
<span id="96"> 96</span> |
|||
<span id="97"> 97</span> |
|||
<span id="98"> 98</span> |
|||
<span id="99"> 99</span> |
|||
<span id="100">100</span> |
|||
<span id="101">101</span> |
|||
<span id="102">102</span> |
|||
<span id="103">103</span> |
|||
<span id="104">104</span> |
|||
<span id="105">105</span> |
|||
<span id="106">106</span> |
|||
<span id="107">107</span> |
|||
<span id="108">108</span> |
|||
<span id="109">109</span> |
|||
<span id="110">110</span> |
|||
<span id="111">111</span> |
|||
<span id="112">112</span> |
|||
<span id="113">113</span> |
|||
</pre><pre class='rust '> |
|||
<span class='doccomment'>//! Transformation of real data.</span> |
|||
|
|||
<span class='kw'>use</span> <span class='ident'>number</span>::{<span class='ident'>Complex</span>, <span class='ident'>c64</span>}; |
|||
|
|||
<span class='macro'>macro_rules</span><span class='macro'>!</span> <span class='ident'>reinterpret</span>( |
|||
(<span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>data</span>:<span class='ident'>ident</span>) <span class='op'>=></span> (<span class='kw'>unsafe</span> { |
|||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>slice</span>::<span class='ident'>from_raw_parts_mut</span>; |
|||
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='macro'>power_of_two</span><span class='macro'>!</span>(<span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>data</span>); |
|||
(<span class='ident'>from_raw_parts_mut</span>(<span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>data</span>.<span class='ident'>as_mut_ptr</span>() <span class='kw'>as</span> <span class='op'>*</span><span class='kw-2'>mut</span> _, <span class='ident'>n</span> <span class='op'>/</span> <span class='number'>2</span>), <span class='ident'>n</span> <span class='op'>/</span> <span class='number'>2</span>) |
|||
}); |
|||
); |
|||
|
|||
<span class='doccomment'>/// Perform the forward transform.</span> |
|||
<span class='doccomment'>///</span> |
|||
<span class='doccomment'>/// The number of points should be a power of two. The data are replaced by the</span> |
|||
<span class='doccomment'>/// positive frequency half of their complex Fourier transform. The real-valued</span> |
|||
<span class='doccomment'>/// first and last components of the complex transform are returned as elements</span> |
|||
<span class='doccomment'>/// `data[0]` and `data[1]`, respectively.</span> |
|||
<span class='doccomment'>///</span> |
|||
<span class='doccomment'>/// ## References</span> |
|||
<span class='doccomment'>///</span> |
|||
<span class='doccomment'>/// 1. William H. Press, Saul A. Teukolsky, William T. Vetterling, Brian P.</span> |
|||
<span class='doccomment'>/// Flannery, “Numerical Recipes 3rd Edition: The Art of Scientific</span> |
|||
<span class='doccomment'>/// Computing,” Cambridge University Press, 2007.</span> |
|||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>forward</span>(<span class='ident'>data</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='ident'>f64</span>]) { |
|||
<span class='kw'>let</span> (<span class='ident'>data</span>, <span class='ident'>n</span>) <span class='op'>=</span> <span class='macro'>reinterpret</span><span class='macro'>!</span>(<span class='ident'>data</span>); |
|||
::<span class='ident'>complex</span>::<span class='ident'>forward</span>(<span class='ident'>data</span>); |
|||
<span class='ident'>compose</span>(<span class='ident'>data</span>, <span class='ident'>n</span>, <span class='boolval'>false</span>); |
|||
} |
|||
|
|||
<span class='doccomment'>/// Perform the backward transform.</span> |
|||
<span class='doccomment'>///</span> |
|||
<span class='doccomment'>/// The number of points should be a power of two. The data should be packed as</span> |
|||
<span class='doccomment'>/// described in `real::forward`.</span> |
|||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>backward</span>(<span class='ident'>data</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='ident'>f64</span>]) { |
|||
<span class='kw'>let</span> (<span class='ident'>data</span>, <span class='ident'>n</span>) <span class='op'>=</span> <span class='macro'>reinterpret</span><span class='macro'>!</span>(<span class='ident'>data</span>); |
|||
<span class='ident'>compose</span>(<span class='ident'>data</span>, <span class='ident'>n</span>, <span class='boolval'>true</span>); |
|||
::<span class='ident'>complex</span>::<span class='ident'>backward</span>(<span class='ident'>data</span>); |
|||
} |
|||
|
|||
<span class='doccomment'>/// Perform the inverse transform.</span> |
|||
<span class='doccomment'>///</span> |
|||
<span class='doccomment'>/// The number of points should be a power of two. The data should be packed as</span> |
|||
<span class='doccomment'>/// described in `real::forward`.</span> |
|||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>inverse</span>(<span class='ident'>data</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='ident'>f64</span>]) { |
|||
<span class='kw'>let</span> (<span class='ident'>data</span>, <span class='ident'>n</span>) <span class='op'>=</span> <span class='macro'>reinterpret</span><span class='macro'>!</span>(<span class='ident'>data</span>); |
|||
<span class='ident'>compose</span>(<span class='ident'>data</span>, <span class='ident'>n</span>, <span class='boolval'>true</span>); |
|||
::<span class='ident'>complex</span>::<span class='ident'>inverse</span>(<span class='ident'>data</span>); |
|||
} |
|||
|
|||
<span class='doccomment'>/// Unpack a compressed representation produced by `real::forward`.</span> |
|||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>unpack</span>(<span class='ident'>data</span>: <span class='kw-2'>&</span>[<span class='ident'>f64</span>]) <span class='op'>-></span> <span class='ident'>Vec</span><span class='op'><</span><span class='ident'>c64</span><span class='op'>></span> { |
|||
<span class='kw'>let</span> <span class='ident'>n</span> <span class='op'>=</span> <span class='macro'>power_of_two</span><span class='macro'>!</span>(<span class='ident'>data</span>); |
|||
|
|||
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>cdata</span> <span class='op'>=</span> <span class='ident'>Vec</span>::<span class='ident'>with_capacity</span>(<span class='ident'>n</span>); |
|||
<span class='kw'>unsafe</span> { <span class='ident'>cdata</span>.<span class='ident'>set_len</span>(<span class='ident'>n</span>) }; |
|||
|
|||
<span class='ident'>cdata</span>[<span class='number'>0</span>] <span class='op'>=</span> <span class='ident'>c64</span>(<span class='ident'>data</span>[<span class='number'>0</span>], <span class='number'>0.0</span>); |
|||
<span class='kw'>for</span> <span class='ident'>i</span> <span class='kw'>in</span> <span class='number'>1</span>..(<span class='ident'>n</span> <span class='op'>/</span> <span class='number'>2</span>) { |
|||
<span class='ident'>cdata</span>[<span class='ident'>i</span>] <span class='op'>=</span> <span class='ident'>c64</span>(<span class='ident'>data</span>[<span class='number'>2</span> <span class='op'>*</span> <span class='ident'>i</span>], <span class='ident'>data</span>[<span class='number'>2</span> <span class='op'>*</span> <span class='ident'>i</span> <span class='op'>+</span> <span class='number'>1</span>]); |
|||
} |
|||
<span class='ident'>cdata</span>[<span class='ident'>n</span> <span class='op'>/</span> <span class='number'>2</span>] <span class='op'>=</span> <span class='ident'>c64</span>(<span class='ident'>data</span>[<span class='number'>1</span>], <span class='number'>0.0</span>); |
|||
<span class='kw'>for</span> <span class='ident'>i</span> <span class='kw'>in</span> (<span class='ident'>n</span> <span class='op'>/</span> <span class='number'>2</span> <span class='op'>+</span> <span class='number'>1</span>)..<span class='ident'>n</span> { |
|||
<span class='ident'>cdata</span>[<span class='ident'>i</span>] <span class='op'>=</span> <span class='ident'>cdata</span>[<span class='ident'>n</span> <span class='op'>-</span> <span class='ident'>i</span>].<span class='ident'>conj</span>(); |
|||
} |
|||
|
|||
<span class='ident'>cdata</span> |
|||
} |
|||
|
|||
<span class='kw'>fn</span> <span class='ident'>compose</span>(<span class='ident'>data</span>: <span class='kw-2'>&</span><span class='kw-2'>mut</span> [<span class='ident'>c64</span>], <span class='ident'>n</span>: <span class='ident'>usize</span>, <span class='ident'>inverse</span>: <span class='ident'>bool</span>) { |
|||
<span class='ident'>data</span>[<span class='number'>0</span>] <span class='op'>=</span> <span class='ident'>c64</span>(<span class='ident'>data</span>[<span class='number'>0</span>].<span class='ident'>re</span>() <span class='op'>+</span> <span class='ident'>data</span>[<span class='number'>0</span>].<span class='ident'>im</span>(), <span class='ident'>data</span>[<span class='number'>0</span>].<span class='ident'>re</span>() <span class='op'>-</span> <span class='ident'>data</span>[<span class='number'>0</span>].<span class='ident'>im</span>()); |
|||
<span class='kw'>if</span> <span class='ident'>inverse</span> { |
|||
<span class='ident'>data</span>[<span class='number'>0</span>] <span class='op'>=</span> <span class='ident'>data</span>[<span class='number'>0</span>] <span class='op'>*</span> <span class='number'>0.5</span>; |
|||
} |
|||
|
|||
<span class='kw'>let</span> <span class='ident'>sign</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='ident'>inverse</span> { <span class='number'>1.0</span> } <span class='kw'>else</span> { <span class='op'>-</span><span class='number'>1.0</span> }; |
|||
<span class='kw'>let</span> (<span class='ident'>multiplier</span>, <span class='kw-2'>mut</span> <span class='ident'>factor</span>) <span class='op'>=</span> { |
|||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>f64</span>::<span class='ident'>consts</span>::<span class='ident'>PI</span>; |
|||
<span class='kw'>let</span> <span class='ident'>theta</span> <span class='op'>=</span> <span class='ident'>sign</span> <span class='op'>*</span> <span class='ident'>PI</span> <span class='op'>/</span> <span class='ident'>n</span> <span class='kw'>as</span> <span class='ident'>f64</span>; |
|||
<span class='kw'>let</span> <span class='ident'>sine</span> <span class='op'>=</span> (<span class='number'>0.5</span> <span class='op'>*</span> <span class='ident'>theta</span>).<span class='ident'>sin</span>(); |
|||
(<span class='ident'>c64</span>(<span class='op'>-</span><span class='number'>2.0</span> <span class='op'>*</span> <span class='ident'>sine</span> <span class='op'>*</span> <span class='ident'>sine</span>, <span class='ident'>theta</span>.<span class='ident'>sin</span>()), <span class='ident'>c64</span>(<span class='number'>1.0</span>, <span class='number'>0.0</span>)) |
|||
}; |
|||
<span class='kw'>for</span> <span class='ident'>i</span> <span class='kw'>in</span> <span class='number'>1</span>..(<span class='ident'>n</span> <span class='op'>/</span> <span class='number'>2</span>) { |
|||
<span class='kw'>let</span> <span class='ident'>j</span> <span class='op'>=</span> <span class='ident'>n</span> <span class='op'>-</span> <span class='ident'>i</span>; |
|||
<span class='ident'>factor</span> <span class='op'>=</span> <span class='ident'>multiplier</span> <span class='op'>*</span> <span class='ident'>factor</span> <span class='op'>+</span> <span class='ident'>factor</span>; |
|||
<span class='kw'>let</span> <span class='ident'>part1</span> <span class='op'>=</span> (<span class='ident'>data</span>[<span class='ident'>i</span>] <span class='op'>+</span> <span class='ident'>data</span>[<span class='ident'>j</span>].<span class='ident'>conj</span>()) <span class='op'>*</span> <span class='number'>0.5</span>; |
|||
<span class='kw'>let</span> <span class='ident'>part2</span> <span class='op'>=</span> (<span class='ident'>data</span>[<span class='ident'>i</span>] <span class='op'>-</span> <span class='ident'>data</span>[<span class='ident'>j</span>].<span class='ident'>conj</span>()) <span class='op'>*</span> <span class='number'>0.5</span>; |
|||
<span class='kw'>let</span> <span class='ident'>product</span> <span class='op'>=</span> <span class='ident'>c64</span>(<span class='number'>0.0</span>, <span class='ident'>sign</span>) <span class='op'>*</span> <span class='ident'>factor</span> <span class='op'>*</span> <span class='ident'>part2</span>; |
|||
<span class='ident'>data</span>[<span class='ident'>i</span>] <span class='op'>=</span> <span class='ident'>part1</span> <span class='op'>+</span> <span class='ident'>product</span>; |
|||
<span class='ident'>data</span>[<span class='ident'>j</span>] <span class='op'>=</span> (<span class='ident'>part1</span> <span class='op'>-</span> <span class='ident'>product</span>).<span class='ident'>conj</span>(); |
|||
} |
|||
|
|||
<span class='ident'>data</span>[<span class='ident'>n</span> <span class='op'>/</span> <span class='number'>2</span>] <span class='op'>=</span> <span class='ident'>data</span>[<span class='ident'>n</span> <span class='op'>/</span> <span class='number'>2</span>].<span class='ident'>conj</span>(); |
|||
} |
|||
|
|||
<span class='attribute'>#[<span class='ident'>cfg</span>(<span class='ident'>test</span>)]</span> |
|||
<span class='kw'>mod</span> <span class='ident'>tests</span> { |
|||
<span class='kw'>use</span> <span class='ident'>number</span>::<span class='ident'>c64</span>; |
|||
|
|||
<span class='attribute'>#[<span class='ident'>test</span>]</span> |
|||
<span class='kw'>fn</span> <span class='ident'>unpack</span>() { |
|||
<span class='kw'>let</span> <span class='ident'>data</span> <span class='op'>=</span> (<span class='number'>0</span>..<span class='number'>4</span>).<span class='ident'>map</span>(<span class='op'>|</span><span class='ident'>i</span><span class='op'>|</span> (<span class='ident'>i</span> <span class='op'>+</span> <span class='number'>1</span>) <span class='kw'>as</span> <span class='ident'>f64</span>).<span class='ident'>collect</span>::<span class='op'><</span><span class='ident'>Vec</span><span class='op'><</span>_<span class='op'>>></span>(); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>super</span>::<span class='ident'>unpack</span>(<span class='kw-2'>&</span><span class='ident'>data</span>), <span class='macro'>vec</span><span class='macro'>!</span>[ |
|||
<span class='ident'>c64</span>(<span class='number'>1.0</span>, <span class='number'>0.0</span>), <span class='ident'>c64</span>(<span class='number'>3.0</span>, <span class='number'>4.0</span>), <span class='ident'>c64</span>(<span class='number'>2.0</span>, <span class='number'>0.0</span>), <span class='ident'>c64</span>(<span class='number'>3.0</span>, <span class='op'>-</span><span class='number'>4.0</span>), |
|||
]); |
|||
|
|||
<span class='kw'>let</span> <span class='ident'>data</span> <span class='op'>=</span> (<span class='number'>0</span>..<span class='number'>8</span>).<span class='ident'>map</span>(<span class='op'>|</span><span class='ident'>i</span><span class='op'>|</span> (<span class='ident'>i</span> <span class='op'>+</span> <span class='number'>1</span>) <span class='kw'>as</span> <span class='ident'>f64</span>).<span class='ident'>collect</span>::<span class='op'><</span><span class='ident'>Vec</span><span class='op'><</span>_<span class='op'>>></span>(); |
|||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>super</span>::<span class='ident'>unpack</span>(<span class='kw-2'>&</span><span class='ident'>data</span>), <span class='macro'>vec</span><span class='macro'>!</span>[ |
|||
<span class='ident'>c64</span>(<span class='number'>1.0</span>, <span class='number'>0.0</span>), <span class='ident'>c64</span>(<span class='number'>3.0</span>, <span class='number'>4.0</span>), <span class='ident'>c64</span>(<span class='number'>5.0</span>, <span class='number'>6.0</span>), <span class='ident'>c64</span>(<span class='number'>7.0</span>, <span class='number'>8.0</span>), |
|||
<span class='ident'>c64</span>(<span class='number'>2.0</span>, <span class='number'>0.0</span>), <span class='ident'>c64</span>(<span class='number'>7.0</span>, <span class='op'>-</span><span class='number'>8.0</span>), <span class='ident'>c64</span>(<span class='number'>5.0</span>, <span class='op'>-</span><span class='number'>6.0</span>), <span class='ident'>c64</span>(<span class='number'>3.0</span>, <span class='op'>-</span><span class='number'>4.0</span>), |
|||
]); |
|||
} |
|||
} |
|||
</pre> |
|||
</section> |
|||
<section id='search' class="content hidden"></section> |
|||
|
|||
<section class="footer"></section> |
|||
|
|||
<div id="help" class="hidden"> |
|||
<div class="shortcuts"> |
|||
<h1>Keyboard shortcuts</h1> |
|||
<dl> |
|||
<dt>?</dt> |
|||
<dd>Show this help dialog</dd> |
|||
<dt>S</dt> |
|||
<dd>Focus the search field</dd> |
|||
<dt>⇤</dt> |
|||
<dd>Move up in search results</dd> |
|||
<dt>⇥</dt> |
|||
<dd>Move down in search results</dd> |
|||
<dt>⏎</dt> |
|||
<dd>Go to active search result</dd> |
|||
</dl> |
|||
</div> |
|||
<div class="infos"> |
|||
<h1>Search tricks</h1> |
|||
<p> |
|||
Prefix searches with a type followed by a colon (e.g. |
|||
<code>fn:</code>) to restrict the search to a given type. |
|||
</p> |
|||
<p> |
|||
Accepted types are: <code>fn</code>, <code>mod</code>, |
|||
<code>struct</code>, <code>enum</code>, |
|||
<code>trait</code>, <code>typedef</code> (or |
|||
<code>tdef</code>). |
|||
</p> |
|||
<p> |
|||
Search functions by type signature (e.g. |
|||
<code>vec -> usize</code>) |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<script> |
|||
window.rootPath = "../../"; |
|||
window.currentCrate = "dft"; |
|||
window.playgroundUrl = ""; |
|||
</script> |
|||
<script src="../../jquery.js"></script> |
|||
<script src="../../main.js"></script> |
|||
|
|||
<script async src="../../search-index.js"></script> |
|||
</body> |
|||
</html> |
@ -1,18 +0,0 @@ |
|||
//! [Discrete Fourier transform][1].
|
|||
//!
|
|||
//! [1]: https://en.wikipedia.org/wiki/Discrete_Fourier_transform
|
|||
|
|||
extern crate complex as number;
|
|||
|
|||
macro_rules! power_of_two(
|
|||
($data:expr) => ({
|
|||
let n = $data.len();
|
|||
if !n.is_power_of_two() {
|
|||
panic!("expected the number of points to be a power of two");
|
|||
}
|
|||
n
|
|||
});
|
|||
);
|
|||
|
|||
pub mod complex;
|
|||
pub mod real;
|
@ -1,113 +0,0 @@ |
|||
//! Transformation of real data.
|
|||
|
|||
use number::{Complex, c64};
|
|||
|
|||
macro_rules! reinterpret(
|
|||
($data:ident) => (unsafe {
|
|||
use std::slice::from_raw_parts_mut;
|
|||
let n = power_of_two!($data);
|
|||
(from_raw_parts_mut($data.as_mut_ptr() as *mut _, n / 2), n / 2)
|
|||
});
|
|||
);
|
|||
|
|||
/// Perform the forward transform.
|
|||
///
|
|||
/// The number of points should be a power of two. The data are replaced by the
|
|||
/// positive frequency half of their complex Fourier transform. The real-valued
|
|||
/// first and last components of the complex transform are returned as elements
|
|||
/// `data[0]` and `data[1]`, respectively.
|
|||
///
|
|||
/// ## References
|
|||
///
|
|||
/// 1. William H. Press, Saul A. Teukolsky, William T. Vetterling, Brian P.
|
|||
/// Flannery, “Numerical Recipes 3rd Edition: The Art of Scientific
|
|||
/// Computing,” Cambridge University Press, 2007.
|
|||
pub fn forward(data: &mut [f64]) {
|
|||
let (data, n) = reinterpret!(data);
|
|||
::complex::forward(data);
|
|||
compose(data, n, false);
|
|||
}
|
|||
|
|||
/// Perform the backward transform.
|
|||
///
|
|||
/// The number of points should be a power of two. The data should be packed as
|
|||
/// described in `real::forward`.
|
|||
pub fn backward(data: &mut [f64]) {
|
|||
let (data, n) = reinterpret!(data);
|
|||
compose(data, n, true);
|
|||
::complex::backward(data);
|
|||
}
|
|||
|
|||
/// Perform the inverse transform.
|
|||
///
|
|||
/// The number of points should be a power of two. The data should be packed as
|
|||
/// described in `real::forward`.
|
|||
pub fn inverse(data: &mut [f64]) {
|
|||
let (data, n) = reinterpret!(data);
|
|||
compose(data, n, true);
|
|||
::complex::inverse(data);
|
|||
}
|
|||
|
|||
/// Unpack a compressed representation produced by `real::forward`.
|
|||
pub fn unpack(data: &[f64]) -> Vec<c64> {
|
|||
let n = power_of_two!(data);
|
|||
|
|||
let mut cdata = Vec::with_capacity(n);
|
|||
unsafe { cdata.set_len(n) };
|
|||
|
|||
cdata[0] = c64(data[0], 0.0);
|
|||
for i in 1..(n / 2) {
|
|||
cdata[i] = c64(data[2 * i], data[2 * i + 1]);
|
|||
}
|
|||
cdata[n / 2] = c64(data[1], 0.0);
|
|||
for i in (n / 2 + 1)..n {
|
|||
cdata[i] = cdata[n - i].conj();
|
|||
}
|
|||
|
|||
cdata
|
|||
}
|
|||
|
|||
pub fn compose(data: &mut [c64], n: usize, inverse: bool) {
|
|||
data[0] = c64(data[0].re() + data[0].im(), data[0].re() - data[0].im());
|
|||
if inverse {
|
|||
data[0] = data[0] * 0.5;
|
|||
}
|
|||
|
|||
let sign = if inverse { 1.0 } else { -1.0 };
|
|||
let (multiplier, mut factor) = {
|
|||
use std::f64::consts::PI;
|
|||
let theta = sign * PI / n as f64;
|
|||
let sine = (0.5 * theta).sin();
|
|||
(c64(-2.0 * sine * sine, theta.sin()), c64(1.0, 0.0))
|
|||
};
|
|||
for i in 1..(n / 2) {
|
|||
let j = n - i;
|
|||
factor = multiplier * factor + factor;
|
|||
let part1 = (data[i] + data[j].conj()) * 0.5;
|
|||
let part2 = (data[i] - data[j].conj()) * 0.5;
|
|||
let product = c64(0.0, sign) * factor * part2;
|
|||
data[i] = part1 + product;
|
|||
data[j] = (part1 - product).conj();
|
|||
}
|
|||
|
|||
data[n / 2] = data[n / 2].conj();
|
|||
}
|
|||
|
|||
#[cfg(test)]
|
|||
mod tests {
|
|||
use number::c64;
|
|||
|
|||
#[test]
|
|||
fn unpack() {
|
|||
let data = (0..4).map(|i| (i + 1) as f64).collect::<Vec<_>>();
|
|||
assert_eq!(super::unpack(&data), vec![
|
|||
c64(1.0, 0.0), c64(3.0, 4.0), c64(2.0, 0.0), c64(3.0, -4.0),
|
|||
]);
|
|||
|
|||
let data = (0..8).map(|i| (i + 1) as f64).collect::<Vec<_>>();
|
|||
assert_eq!(super::unpack(&data), vec![
|
|||
c64(1.0, 0.0), c64(3.0, 4.0), c64(5.0, 6.0), c64(7.0, 8.0),
|
|||
c64(2.0, 0.0), c64(7.0, -8.0), c64(5.0, -6.0), c64(3.0, -4.0),
|
|||
]);
|
|||
}
|
|||
}
|
@ -1,721 +0,0 @@ |
|||
pub const TIME_DATA_256: [f64; 256] = [
|
|||
0.242578298897752, 0.013469574513598, 0.383138850044058, 0.414652690484492,
|
|||
0.067768972864267, 0.993126929734427, 0.484308046514312, 0.765337766038877,
|
|||
0.031833815403205, 0.030935481670748, 0.932640440265015, 0.887879534106646,
|
|||
0.591329730391190, 0.478778684734729, 0.833354336597656, 0.186335196805343,
|
|||
0.735652707394051, 0.115053171811184, 0.698658630577223, 0.355604111382553,
|
|||
0.638300006575091, 0.908210507551306, 0.294000414802693, 0.264971588861650,
|
|||
0.377493997745912, 0.541620115536088, 0.009281815034003, 0.999465276486923,
|
|||
0.012901915708977, 0.842497320772380, 0.852470221394892, 0.467010983949067,
|
|||
0.053607231962312, 0.976747590571990, 0.196754743436703, 0.856972940665191,
|
|||
0.144213759873162, 0.800662188232253, 0.729397619482781, 0.985790647094041,
|
|||
0.183405709538332, 0.499760210746788, 0.469862021258968, 0.970991299474142,
|
|||
0.450770261907377, 0.095791877292000, 0.974081646638960, 0.390235061007661,
|
|||
0.680670355763598, 0.026669318800172, 0.231241074498389, 0.468739094430925,
|
|||
0.097960100554843, 0.415410025238716, 0.796294187100741, 0.316402602156812,
|
|||
0.778534449533808, 0.828493314715332, 0.487140420585470, 0.369048780002188,
|
|||
0.602845496778770, 0.024264360789333, 0.811111786314804, 0.355792592910953,
|
|||
0.806109054389460, 0.274877123662679, 0.859817398646761, 0.951019056118568,
|
|||
0.777276184771804, 0.680837459713611, 0.835185406652831, 0.961129614133914,
|
|||
0.705424748689600, 0.073751226101886, 0.536857094400030, 0.957185581306548,
|
|||
0.418065019146570, 0.418776796394389, 0.381617000504218, 0.836927474400460,
|
|||
0.240062248539209, 0.726211198478104, 0.431612821496843, 0.116690897437134,
|
|||
0.223913225915243, 0.309587957481662, 0.244801394289733, 0.377033827536290,
|
|||
0.807539402417624, 0.314736433008097, 0.775229567091553, 0.283334107735816,
|
|||
0.996348715851246, 0.632867311887847, 0.600910899043507, 0.509480224228222,
|
|||
0.834128603727617, 0.199442850053051, 0.035980841627336, 0.730005230628888,
|
|||
0.197911179716657, 0.293197497862017, 0.770346566927781, 0.214750355209573,
|
|||
0.309220007299082, 0.060662675677176, 0.557590106296162, 0.416916519597600,
|
|||
0.115944876855214, 0.685545305575032, 0.959950799569465, 0.893088363992557,
|
|||
0.136133622907164, 0.997800200710911, 0.027973348287853, 0.148064673947200,
|
|||
0.522975030598685, 0.641339272093651, 0.989146078000379, 0.578132952367017,
|
|||
0.680530432462939, 0.674978404620187, 0.362046451476424, 0.914709964261721,
|
|||
0.530369346742690, 0.917610704394807, 0.283108763528573, 0.208988624722226,
|
|||
0.471815706450406, 0.806578311979109, 0.161689432878834, 0.514298394561884,
|
|||
0.813117401587366, 0.064168478857804, 0.479624163117085, 0.043309508843026,
|
|||
0.902915124736221, 0.294501441668021, 0.685730114432857, 0.066033273034745,
|
|||
0.821219894951777, 0.242774454524170, 0.310257187723302, 0.492554065535103,
|
|||
0.356179448476145, 0.307990538565438, 0.396981669309075, 0.070916077620776,
|
|||
0.886516572389061, 0.684032142946512, 0.528226502020018, 0.902819450433748,
|
|||
0.686503439995695, 0.063316007639894, 0.152140403702920, 0.023765034984688,
|
|||
0.418942987648278, 0.174793404608403, 0.752751253430150, 0.490316400532758,
|
|||
0.747743754064545, 0.329274562806485, 0.117577088585858, 0.118127862512194,
|
|||
0.374985242437099, 0.376969640318756, 0.728744837329138, 0.014480990830102,
|
|||
0.382012881516485, 0.490499647562625, 0.827576585033711, 0.079664661586128,
|
|||
0.923967278061419, 0.118042378275675, 0.938251679268783, 0.195973470432671,
|
|||
0.726117561909425, 0.857863011703763, 0.103637705139647, 0.838910282048821,
|
|||
0.565110394528653, 0.810400843066350, 0.406969416144755, 0.934977144903958,
|
|||
0.160874400828441, 0.816054723605539, 0.431739638294903, 0.248100822441327,
|
|||
0.830522771380154, 0.596218586245653, 0.645779030698249, 0.608168945465316,
|
|||
0.495466435558846, 0.304382437516182, 0.755627334469756, 0.828610433185757,
|
|||
0.455550553023606, 0.438144667743773, 0.897430769585739, 0.118944427519545,
|
|||
0.098993320995473, 0.780745970914488, 0.997533159795000, 0.539816674562086,
|
|||
0.698849364974932, 0.561277133674024, 0.384785659324744, 0.092576270966128,
|
|||
0.929386127707263, 0.192648375962231, 0.841254797224540, 0.969376952838794,
|
|||
0.318446361608080, 0.127999546997249, 0.288386382762523, 0.909935089717589,
|
|||
0.279052883516556, 0.041813262757758, 0.755507169643188, 0.809000193052460,
|
|||
0.866244632688465, 0.973541595029431, 0.313587659650290, 0.467795742427835,
|
|||
0.243042984624879, 0.823442590340712, 0.599615856353015, 0.743697725117066,
|
|||
0.327666042525166, 0.083176720460493, 0.951140779513466, 0.823081282816399,
|
|||
0.527120295226164, 0.310801866143384, 0.646964271854127, 0.528517052311691,
|
|||
0.786098202590876, 0.952490944858869, 0.515310243012062, 0.819254303732540,
|
|||
0.207082832794209, 0.441170772277364, 0.757169665655666, 0.750570674776365,
|
|||
0.841330966372663, 0.249551825341560, 0.217528515596655, 0.001761632972286,
|
|||
0.607765365209321, 0.712493073061338, 0.871078941911030, 0.223776698682353,
|
|||
0.014974754310667, 0.680695699379172, 0.452619465744411, 0.175360766321123,
|
|||
];
|
|||
|
|||
pub const FREQUENCY_DATA_128_COMPLEX: [f64; 2 * 128] = [
|
|||
6.750656266720340e+01, 6.279874768750683e+01, 7.714838837855442e-02, 5.819389938527752e+00,
|
|||
-5.303978155417409e+00, -2.887549849606836e-01, 4.308501796277235e+00, -2.780062259410463e-01,
|
|||
-1.084455288816293e-01, -9.653434181182980e-01, 7.727658650311002e-01, -8.707366039824819e+00,
|
|||
-5.278077778941212e+00, -4.066322943629877e+00, -3.458371226842232e+00, 8.013344593032468e+00,
|
|||
-3.599237215989637e+00, -1.105183198676696e+00, 4.133604334208186e+00, -3.445364011535524e+00,
|
|||
-4.944656692463901e+00, 5.315462183419959e+00, 3.880468387697888e+00, 1.634838899334416e+00,
|
|||
2.983076467939860e+00, -3.013246639835038e+00, 8.405096230874929e-01, 4.498605610210712e+00,
|
|||
-2.972572998085648e+00, 5.831133886072569e+00, 4.288737227223233e+00, -3.968319162458111e+00,
|
|||
-8.048535626585105e-01, 4.667294297528397e+00, 1.411453345272351e+00, -1.449094611132408e+00,
|
|||
-7.921745368568175e+00, -7.472969089954909e+00, 3.116401263119543e+00, 8.060860339983653e-01,
|
|||
-1.098781173708808e+00, -4.976387399730230e+00, 2.090636515202629e+00, -2.544058986903604e+00,
|
|||
2.305750958010683e+00, 3.711657195983209e-02, 8.516540731741751e-02, 1.846582481253431e+00,
|
|||
2.344622479665092e+00, 9.782457560315421e-01, -5.653027779602048e+00, -4.457764259327358e+00,
|
|||
4.396893371992927e+00, -1.781029123711273e+00, 1.303130356713504e+00, 1.104086803126383e-01,
|
|||
8.202058412989162e+00, -1.912136722291750e+00, -2.386952673947501e+00, -3.800460327948856e-01,
|
|||
-4.755886984684770e+00, -2.371006165743835e+00, 9.838525643858385e-01, -1.970780039723673e+00,
|
|||
8.843052074705682e-01, 1.209832476084040e+00, 4.482138368789980e+00, -8.618372361868662e+00,
|
|||
2.553617632271545e+00, -2.515247887047421e+00, -1.310659972997361e+00, -4.744849190522960e+00,
|
|||
-5.848019862181545e+00, -1.853688693742562e+00, 2.211012545853336e+00, -3.584550392170881e+00,
|
|||
1.466063738740644e+00, 3.285544689641922e-01, -3.772195284223943e+00, 2.554683615488591e+00,
|
|||
3.144799926493497e+00, 5.320412494125712e-01, -1.617862103749616e+00, 4.505029568623644e+00,
|
|||
4.841738890983537e+00, 4.304535776881372e+00, -1.874383165372953e+00, -1.816379942063393e+00,
|
|||
-1.559401743047192e+00, -2.563598701770973e+00, -2.768891360840021e+00, 1.367687274872984e+00,
|
|||
-3.451402723746730e+00, -2.019459598023322e-01, -1.849780677085415e+00, -6.075332676660432e+00,
|
|||
3.813912169625591e+00, 1.672124644400447e+00, 2.897552781182169e+00, 4.424347873913383e+00,
|
|||
5.144179917427660e-02, 8.187374675121173e+00, -6.307832248431945e-01, -1.040038800556793e+00,
|
|||
9.638242571688409e-01, -1.315676780411990e+00, 4.548911919541162e+00, -3.110338786263292e+00,
|
|||
7.143970293892079e-01, -1.027012942409028e+00, -6.771408853367402e-01, 7.689403378304775e+00,
|
|||
3.266763808523832e+00, -4.939142356746464e+00, -1.680667450021413e+00, -5.672119730229586e+00,
|
|||
2.356251252889546e+00, 3.100152502890580e+00, -1.718586561803939e+00, -2.848378813769422e+00,
|
|||
2.166953458666474e+00, 3.698992188846235e+00, -2.521465228517406e+00, -1.483012583302976e+00,
|
|||
-1.385547239860872e+00, 4.278296734710759e+00, -3.231893261005089e+00, -3.499165263231714e+00,
|
|||
-3.991693675979821e+00, -2.395612192990072e+00, -7.551126038911470e+00, -1.253320876553413e+00,
|
|||
2.949752700932412e+00, 2.757985604650246e+00, 2.965000493451835e+00, 5.042549679265349e+00,
|
|||
-2.276214983007470e+00, -8.605327422795508e-01, -3.429327683732336e+00, 3.634086096757940e-01,
|
|||
-9.235956441894744e-01, -1.735427210626094e+00, -3.923350081315737e+00, -8.961379286949720e-01,
|
|||
-4.027346047616183e+00, 5.509694798065775e+00, -6.249259838595390e+00, 6.001167756824247e+00,
|
|||
-7.578924142578991e-02, 1.719766675858380e+00, -3.682461675261361e-01, -1.498059975229270e+00,
|
|||
-2.253868990511852e+00, -2.913770876062722e+00, 2.473335187775014e+00, -3.737196599784345e-01,
|
|||
9.237764999281854e-01, 2.150735454872202e+00, -2.202133267022083e+00, 1.329217526808811e+00,
|
|||
5.396652531710098e-01, 7.023277604131626e-01, -9.987304998877746e-01, -1.368332585830754e+00,
|
|||
-2.853890281653036e+00, -3.715099310600182e+00, 9.673864924730763e-01, -5.576552424605284e+00,
|
|||
3.905872946117088e+00, -2.826501461749119e+00, 6.414605960628869e+00, -5.679739832207091e+00,
|
|||
1.909130437842080e+00, 9.955398727323348e-01, 3.638877999600390e+00, 1.258926814764474e+00,
|
|||
-8.414044119346986e-03, -3.991754204800230e+00, 5.146915245537949e+00, 2.820615592243083e-01,
|
|||
-4.264963191688312e-01, 3.030254700260019e+00, 4.878539287722978e+00, -1.459376706664878e+00,
|
|||
-3.399157829092533e+00, 2.161358937350359e+00, 4.840508528923103e+00, -3.204368559739170e+00,
|
|||
2.979104548159062e+00, -1.160028660033101e+00, -2.413351595413149e-01, 3.101405290332420e+00,
|
|||
-2.699185197567189e+00, -5.897826029871508e+00, -6.632075418392930e+00, -1.685124294109047e+00,
|
|||
-2.674474141084143e+00, -2.563372692380101e+00, -4.348080993540033e-01, 2.147158479497566e+00,
|
|||
-3.420180348851098e-01, 2.522012423589093e+00, 7.249878567998773e-01, -2.068196780758695e+00,
|
|||
-1.005151880556292e+00, 2.902422614798151e+00, -3.071761940805398e-01, -5.087687483603752e+00,
|
|||
-1.792775263985136e+00, 2.641548369598412e-01, -7.517681005578722e-01, 2.124100304630884e+00,
|
|||
3.012458946272915e+00, -6.457540983540484e+00, -4.860448155416430e-02, -2.372949299902082e+00,
|
|||
-2.236600417683022e+00, 7.389268307820533e-01, 1.495969367959897e+00, 1.905315704750479e+00,
|
|||
2.398999344465012e+00, -7.411245301876057e-02, 2.554697843376545e+00, -2.629716248632333e+00,
|
|||
-2.002497059929998e+00, -3.607915605047513e+00, 1.320095075374978e+00, -2.156073489574819e+00,
|
|||
-1.629751417352065e+00, 4.497170521285455e+00, -2.956509867164297e+00, -3.563268353779526e+00,
|
|||
-1.949442402686502e+00, -1.250892366300881e+00, -1.286794839414063e+00, -3.596629452384589e+00,
|
|||
-5.636666719031170e+00, -3.624154259337708e+00, -6.973431206318839e+00, 1.575164194822264e+00,
|
|||
-2.627563294940978e-01, 3.254410744830774e+00, -6.749332581521038e+00, 4.840407656923577e+00,
|
|||
8.039106767692121e-01, 1.470542740596267e-01, -4.663614419551561e-01, -5.481824322589377e+00,
|
|||
5.049316157478017e+00, 4.568830841146547e-01, -3.884636396852787e+00, -6.613971933163752e+00,
|
|||
-1.213411748796469e+00, -2.824305441697994e+00, -2.916435892389174e+00, 2.258137395096740e+00,
|
|||
];
|
|||
|
|||
pub const FREQUENCY_DATA_256_REAL_PACKED: [f64; 256] = [
|
|||
1.303053103547102e+02, 4.707814979696565e+00, 2.581170396731581e+00, 1.851687150427200e-01,
|
|||
-4.712992966498972e+00, 3.386970116076342e+00, -3.526081640989058e+00, -6.639837287112846e-01,
|
|||
2.470203860537832e+00, 1.880268489878626e+00, -6.963879517225686e+00, -1.359220918694192e+00,
|
|||
-3.729301277306694e+00, 1.188929523990152e+00, 9.470909676459633e-01, -1.133537735465808e+00,
|
|||
-5.515738367157939e-01, -7.532580478755273e-01, -3.549075039135675e+00, -7.723961671240312e+00,
|
|||
-4.554423293554939e+00, 3.928695392899054e+00, -3.376141283756013e-01, 3.873091478779078e-01,
|
|||
-2.239363597649239e+00, -2.622333161216239e+00, -1.209463421383755e+00, 2.081549368638947e+00,
|
|||
2.787306134089562e+00, -4.406059514292808e-01, -5.867907573418175e-01, -1.188914452808487e+00,
|
|||
-1.143465327856217e+00, 3.381662456994257e+00, 3.502762058115902e-01, 1.939344791605026e+00,
|
|||
-3.966269981614960e+00, 2.578889617469153e+00, 3.152848007718109e+00, -1.882857879463846e+00,
|
|||
-3.804426226346088e+00, -2.360628066063453e+00, -1.645310465960080e+00, 1.955745233096742e-01,
|
|||
8.727435711779677e-02, 5.200789512413666e+00, 1.120142690086255e+00, -1.554454960578806e+00,
|
|||
-3.568747367377898e-01, -1.708135182867248e+00, -5.343117610163509e+00, 5.248479799162289e+00,
|
|||
5.372292947253843e-01, -4.845214246729507e+00, 6.450571433636446e-02, 1.463660986831282e+00,
|
|||
1.455587976273307e+00, -5.712855301747826e+00, -1.042998871212444e-01, -1.101626615691205e+00,
|
|||
-4.844351629884984e+00, 2.524159012105675e+00, -6.773746016629307e+00, -1.640287552626491e+00,
|
|||
-3.831851193928845e+00, 3.944330086139181e+00, -1.492165597423655e+00, -5.490578426839170e+00,
|
|||
1.689911156425059e+00, 8.268603075350915e-01, 1.497677302367308e+00, 4.248256795204093e+00,
|
|||
-3.579498902285684e+00, -1.349669158977704e+00, 3.044651859669117e+00, 1.746167472193509e+00,
|
|||
7.601446066545731e-01, -3.263458881514898e+00, 5.150135192916219e+00, 2.544519592918016e+00,
|
|||
-7.037646240419694e-01, 2.824304911746514e+00, 4.772947230001412e+00, 5.943735485336084e-01,
|
|||
3.480135296267814e+00, -1.372346334547340e+00, 4.028770258877906e+00, 7.235631972573927e+00,
|
|||
2.312768769350037e+00, 3.796429682741911e+00, -1.782620750385733e-01, 6.191786592630610e+00,
|
|||
-3.719950405898309e+00, 3.654794911963337e+00, -2.543476747185558e+00, 1.221476001211499e+00,
|
|||
1.118615654278817e+00, -1.238455571070933e+00, -9.959356075165566e-01, -2.054128218014691e+00,
|
|||
2.639682132748302e+00, -1.701633154204415e+00, 2.173264828603092e+00, 8.248948121629960e-01,
|
|||
-2.798464518993120e+00, 2.355688055046297e+00, -8.937461326272580e-01, 7.588584122960707e-01,
|
|||
2.021391810490336e-02, -1.805385996360098e+00, -4.681753970646021e+00, -6.445270984734714e+00,
|
|||
-3.901614280067266e+00, -6.215718415805858e+00, -4.468302161079752e+00, 6.560811803588424e-01,
|
|||
-8.057225542680853e-01, 1.502186010252237e+00, -3.574988339289839e+00, -4.774591638105148e-01,
|
|||
-2.126408608816460e+00, 6.496133889843871e-01, 3.088495481715207e+00, -4.835922591012089e+00,
|
|||
3.119768676762977e+00, -2.647386306731720e+00, -7.608791527035967e+00, 1.199605557244359e+00,
|
|||
-3.991693675979821e+00, 2.395612192990072e+00, -3.174227772880592e+00, 3.445449943922660e+00,
|
|||
-1.555563215691437e+00, -4.167697436792233e+00, -2.644960216780778e+00, 1.689639671556236e+00,
|
|||
2.017147084475464e+00, -3.909911542141398e+00, -1.572925906246434e+00, 2.734328259634700e+00,
|
|||
2.238378162968156e+00, -3.333393703264437e+00, -1.135715370257395e+00, 5.432062981893454e+00,
|
|||
3.141032040974915e+00, 4.233118739006381e+00, -2.244646753286111e+00, -8.133506606215242e+00,
|
|||
6.183938698585162e-01, 9.413936219073087e-01, 5.074411884642282e+00, 2.371137223330094e+00,
|
|||
1.508419785650108e+00, 7.575939593955647e-01, -3.307128656712730e-01, 1.491213952741355e+00,
|
|||
-1.664463833645839e+00, -7.738272374453388e+00, 1.691355121676643e+00, -5.149258565119262e+00,
|
|||
3.234961768517784e+00, -2.208252455058216e+00, -3.050344297876333e-01, 5.928476092041176e+00,
|
|||
-2.585342599501458e+00, 1.416415611654855e-01, -1.623242793328372e+00, -7.524531068476570e-01,
|
|||
3.370243371985904e-02, 3.533526922763765e+00, 5.114525363780102e-01, 3.372272082430228e+00,
|
|||
3.270734032557804e+00, -4.681342238696375e+00, -2.751931334150639e+00, -2.651729205325560e+00,
|
|||
3.840150506416120e+00, -1.699490542466287e+00, -3.775415231602213e+00, 2.718975366537331e-01,
|
|||
2.794228129172392e-01, -5.617586502190706e-01, 4.044899973907196e+00, 3.871341157699513e+00,
|
|||
-5.667678788988394e+00, 2.665378472115218e+00, 2.032171253558433e+00, 5.788737425987882e+00,
|
|||
3.842811024005548e+00, 2.182079534549411e+00, 5.732968806672321e+00, 6.229199225361914e+00,
|
|||
2.016971203832224e+00, -3.163328419816367e+00, 1.125523162622214e+00, -1.354631807011866e+00,
|
|||
-2.586009495883931e+00, 2.331792485469409e+00, -2.717460886180260e+00, 1.425577896601247e+00,
|
|||
6.404452401830746e+00, -1.278706155866981e+00, 1.963612499177015e+00, -7.149444742400527e-01,
|
|||
2.854512196711251e+00, -1.617625082200844e-01, -6.170863635190775e-01, 4.618556574885895e+00,
|
|||
9.087219524177452e-01, -2.422226101938949e+00, -1.786745383326708e+00, -1.276937137201354e+00,
|
|||
5.230935547165801e+00, -1.293868043086649e+00, 3.687342499608546e+00, 3.666842103111982e-01,
|
|||
4.690446349542574e-01, 3.354686164448831e+00, 1.459522623361331e+00, -7.836282087117324e-01,
|
|||
-1.556476042488201e+00, 9.977746254405300e+00, 3.615874982837306e+00, 7.587231541051005e-01,
|
|||
-1.663885294732292e+00, -4.893547445581648e+00, 6.195623059940029e+00, 6.233312200748059e-01,
|
|||
-7.389630549527273e+00, -1.774569316216396e+00, -9.065368226930491e-01, -5.980324595351290e+00,
|
|||
3.272997662902597e+00, -8.599788876820809e-01, 2.931287676659427e+00, -4.844159203841096e+00,
|
|||
-6.026900117940131e+00, -5.010921049858613e+00, 7.092481670250209e-01, -2.703433464882526e+00,
|
|||
-3.310419708767941e+00, 3.606335895631942e+00, -1.115479477600923e+01, -4.306474671574700e+00,
|
|||
-7.448658248653062e-01, 5.402306741679653e+00, 7.270283940301629e+00, 1.866320798541252e+00,
|
|||
2.470666768058557e+00, 3.302494992111579e+00, 3.949947040413505e+00, -6.999949435933990e+00,
|
|||
-1.804396937714904e+00, 8.514196593390323e-01, -5.420457900742201e+00, -3.376083828388293e+00,
|
|||
];
|
|||
|
|||
pub const FREQUENCY_DATA_256_REAL_UNPACKED: [f64; 2 * 256] = [
|
|||
1.303053103547102e+02, 0.000000000000000e+00, 2.581170396731584e+00, 1.851687150427199e-01,
|
|||
-4.712992966498973e+00, 3.386970116076343e+00, -3.526081640989057e+00, -6.639837287112855e-01,
|
|||
2.470203860537831e+00, 1.880268489878626e+00, -6.963879517225685e+00, -1.359220918694192e+00,
|
|||
-3.729301277306694e+00, 1.188929523990150e+00, 9.470909676459618e-01, -1.133537735465806e+00,
|
|||
-5.515738367157939e-01, -7.532580478755269e-01, -3.549075039135673e+00, -7.723961671240310e+00,
|
|||
-4.554423293554938e+00, 3.928695392899054e+00, -3.376141283756011e-01, 3.873091478779083e-01,
|
|||
-2.239363597649238e+00, -2.622333161216238e+00, -1.209463421383755e+00, 2.081549368638949e+00,
|
|||
2.787306134089560e+00, -4.406059514292826e-01, -5.867907573418165e-01, -1.188914452808486e+00,
|
|||
-1.143465327856217e+00, 3.381662456994260e+00, 3.502762058115909e-01, 1.939344791605027e+00,
|
|||
-3.966269981614962e+00, 2.578889617469152e+00, 3.152848007718109e+00, -1.882857879463846e+00,
|
|||
-3.804426226346088e+00, -2.360628066063453e+00, -1.645310465960079e+00, 1.955745233096744e-01,
|
|||
8.727435711779785e-02, 5.200789512413666e+00, 1.120142690086254e+00, -1.554454960578805e+00,
|
|||
-3.568747367377906e-01, -1.708135182867247e+00, -5.343117610163509e+00, 5.248479799162289e+00,
|
|||
5.372292947253837e-01, -4.845214246729507e+00, 6.450571433636654e-02, 1.463660986831282e+00,
|
|||
1.455587976273307e+00, -5.712855301747824e+00, -1.042998871212450e-01, -1.101626615691207e+00,
|
|||
-4.844351629884981e+00, 2.524159012105676e+00, -6.773746016629306e+00, -1.640287552626490e+00,
|
|||
-3.831851193928844e+00, 3.944330086139181e+00, -1.492165597423655e+00, -5.490578426839169e+00,
|
|||
1.689911156425059e+00, 8.268603075350915e-01, 1.497677302367308e+00, 4.248256795204092e+00,
|
|||
-3.579498902285684e+00, -1.349669158977704e+00, 3.044651859669117e+00, 1.746167472193509e+00,
|
|||
7.601446066545735e-01, -3.263458881514898e+00, 5.150135192916220e+00, 2.544519592918017e+00,
|
|||
-7.037646240419698e-01, 2.824304911746514e+00, 4.772947230001412e+00, 5.943735485336072e-01,
|
|||
3.480135296267813e+00, -1.372346334547339e+00, 4.028770258877906e+00, 7.235631972573928e+00,
|
|||
2.312768769350037e+00, 3.796429682741911e+00, -1.782620750385735e-01, 6.191786592630609e+00,
|
|||
-3.719950405898309e+00, 3.654794911963335e+00, -2.543476747185558e+00, 1.221476001211498e+00,
|
|||
1.118615654278817e+00, -1.238455571070932e+00, -9.959356075165555e-01, -2.054128218014691e+00,
|
|||
2.639682132748301e+00, -1.701633154204415e+00, 2.173264828603092e+00, 8.248948121629960e-01,
|
|||
-2.798464518993120e+00, 2.355688055046297e+00, -8.937461326272578e-01, 7.588584122960702e-01,
|
|||
2.021391810490292e-02, -1.805385996360099e+00, -4.681753970646017e+00, -6.445270984734710e+00,
|
|||
-3.901614280067265e+00, -6.215718415805858e+00, -4.468302161079752e+00, 6.560811803588420e-01,
|
|||
-8.057225542680848e-01, 1.502186010252237e+00, -3.574988339289840e+00, -4.774591638105163e-01,
|
|||
-2.126408608816460e+00, 6.496133889843878e-01, 3.088495481715207e+00, -4.835922591012088e+00,
|
|||
3.119768676762977e+00, -2.647386306731720e+00, -7.608791527035966e+00, 1.199605557244359e+00,
|
|||
-3.991693675979821e+00, 2.395612192990072e+00, -3.174227772880593e+00, 3.445449943922659e+00,
|
|||
-1.555563215691436e+00, -4.167697436792233e+00, -2.644960216780778e+00, 1.689639671556237e+00,
|
|||
2.017147084475464e+00, -3.909911542141400e+00, -1.572925906246435e+00, 2.734328259634699e+00,
|
|||
2.238378162968156e+00, -3.333393703264438e+00, -1.135715370257396e+00, 5.432062981893455e+00,
|
|||
3.141032040974913e+00, 4.233118739006381e+00, -2.244646753286113e+00, -8.133506606215240e+00,
|
|||
6.183938698585155e-01, 9.413936219073080e-01, 5.074411884642281e+00, 2.371137223330093e+00,
|
|||
1.508419785650108e+00, 7.575939593955644e-01, -3.307128656712724e-01, 1.491213952741355e+00,
|
|||
-1.664463833645840e+00, -7.738272374453387e+00, 1.691355121676642e+00, -5.149258565119261e+00,
|
|||
3.234961768517784e+00, -2.208252455058217e+00, -3.050344297876335e-01, 5.928476092041176e+00,
|
|||
-2.585342599501457e+00, 1.416415611654855e-01, -1.623242793328371e+00, -7.524531068476575e-01,
|
|||
3.370243371985926e-02, 3.533526922763765e+00, 5.114525363780107e-01, 3.372272082430229e+00,
|
|||
3.270734032557803e+00, -4.681342238696377e+00, -2.751931334150639e+00, -2.651729205325561e+00,
|
|||
3.840150506416120e+00, -1.699490542466287e+00, -3.775415231602213e+00, 2.718975366537348e-01,
|
|||
2.794228129172385e-01, -5.617586502190708e-01, 4.044899973907196e+00, 3.871341157699510e+00,
|
|||
-5.667678788988395e+00, 2.665378472115218e+00, 2.032171253558434e+00, 5.788737425987882e+00,
|
|||
3.842811024005547e+00, 2.182079534549411e+00, 5.732968806672320e+00, 6.229199225361914e+00,
|
|||
2.016971203832223e+00, -3.163328419816367e+00, 1.125523162622212e+00, -1.354631807011866e+00,
|
|||
-2.586009495883930e+00, 2.331792485469409e+00, -2.717460886180259e+00, 1.425577896601245e+00,
|
|||
6.404452401830746e+00, -1.278706155866979e+00, 1.963612499177015e+00, -7.149444742400535e-01,
|
|||
2.854512196711251e+00, -1.617625082200842e-01, -6.170863635190793e-01, 4.618556574885894e+00,
|
|||
9.087219524177454e-01, -2.422226101938949e+00, -1.786745383326708e+00, -1.276937137201355e+00,
|
|||
5.230935547165801e+00, -1.293868043086650e+00, 3.687342499608545e+00, 3.666842103111971e-01,
|
|||
4.690446349542567e-01, 3.354686164448831e+00, 1.459522623361330e+00, -7.836282087117322e-01,
|
|||
-1.556476042488200e+00, 9.977746254405300e+00, 3.615874982837306e+00, 7.587231541051001e-01,
|
|||
-1.663885294732292e+00, -4.893547445581650e+00, 6.195623059940027e+00, 6.233312200748062e-01,
|
|||
-7.389630549527272e+00, -1.774569316216395e+00, -9.065368226930496e-01, -5.980324595351290e+00,
|
|||
3.272997662902595e+00, -8.599788876820805e-01, 2.931287676659427e+00, -4.844159203841096e+00,
|
|||
-6.026900117940132e+00, -5.010921049858612e+00, 7.092481670250197e-01, -2.703433464882523e+00,
|
|||
-3.310419708767940e+00, 3.606335895631941e+00, -1.115479477600923e+01, -4.306474671574700e+00,
|
|||
-7.448658248653059e-01, 5.402306741679653e+00, 7.270283940301631e+00, 1.866320798541251e+00,
|
|||
2.470666768058556e+00, 3.302494992111579e+00, 3.949947040413504e+00, -6.999949435933990e+00,
|
|||
-1.804396937714905e+00, 8.514196593390326e-01, -5.420457900742202e+00, -3.376083828388293e+00,
|
|||
4.707814979696565e+00, 0.000000000000000e+00, -5.420457900742202e+00, 3.376083828388293e+00,
|
|||
-1.804396937714905e+00, -8.514196593390326e-01, 3.949947040413504e+00, 6.999949435933990e+00,
|
|||
2.470666768058556e+00, -3.302494992111579e+00, 7.270283940301631e+00, -1.866320798541251e+00,
|
|||
-7.448658248653059e-01, -5.402306741679653e+00, -1.115479477600923e+01, 4.306474671574700e+00,
|
|||
-3.310419708767940e+00, -3.606335895631941e+00, 7.092481670250197e-01, 2.703433464882523e+00,
|
|||
-6.026900117940132e+00, 5.010921049858612e+00, 2.931287676659427e+00, 4.844159203841096e+00,
|
|||
3.272997662902595e+00, 8.599788876820805e-01, -9.065368226930496e-01, 5.980324595351290e+00,
|
|||
-7.389630549527272e+00, 1.774569316216395e+00, 6.195623059940027e+00, -6.233312200748062e-01,
|
|||
-1.663885294732292e+00, 4.893547445581650e+00, 3.615874982837306e+00, -7.587231541051001e-01,
|
|||
-1.556476042488200e+00, -9.977746254405300e+00, 1.459522623361330e+00, 7.836282087117322e-01,
|
|||
4.690446349542567e-01, -3.354686164448831e+00, 3.687342499608545e+00, -3.666842103111971e-01,
|
|||
5.230935547165801e+00, 1.293868043086650e+00, -1.786745383326708e+00, 1.276937137201355e+00,
|
|||
9.087219524177454e-01, 2.422226101938949e+00, -6.170863635190793e-01, -4.618556574885894e+00,
|
|||
2.854512196711251e+00, 1.617625082200842e-01, 1.963612499177015e+00, 7.149444742400535e-01,
|
|||
6.404452401830746e+00, 1.278706155866979e+00, -2.717460886180259e+00, -1.425577896601245e+00,
|
|||
-2.586009495883930e+00, -2.331792485469409e+00, 1.125523162622212e+00, 1.354631807011866e+00,
|
|||
2.016971203832223e+00, 3.163328419816367e+00, 5.732968806672320e+00, -6.229199225361914e+00,
|
|||
3.842811024005547e+00, -2.182079534549411e+00, 2.032171253558434e+00, -5.788737425987882e+00,
|
|||
-5.667678788988395e+00, -2.665378472115218e+00, 4.044899973907196e+00, -3.871341157699510e+00,
|
|||
2.794228129172385e-01, 5.617586502190708e-01, -3.775415231602213e+00, -2.718975366537348e-01,
|
|||
3.840150506416120e+00, 1.699490542466287e+00, -2.751931334150639e+00, 2.651729205325561e+00,
|
|||
3.270734032557803e+00, 4.681342238696377e+00, 5.114525363780107e-01, -3.372272082430229e+00,
|
|||
3.370243371985926e-02, -3.533526922763765e+00, -1.623242793328371e+00, 7.524531068476575e-01,
|
|||
-2.585342599501457e+00, -1.416415611654855e-01, -3.050344297876335e-01, -5.928476092041176e+00,
|
|||
3.234961768517784e+00, 2.208252455058217e+00, 1.691355121676642e+00, 5.149258565119261e+00,
|
|||
-1.664463833645840e+00, 7.738272374453387e+00, -3.307128656712724e-01, -1.491213952741355e+00,
|
|||
1.508419785650108e+00, -7.575939593955644e-01, 5.074411884642281e+00, -2.371137223330093e+00,
|
|||
6.183938698585155e-01, -9.413936219073080e-01, -2.244646753286113e+00, 8.133506606215240e+00,
|
|||
3.141032040974913e+00, -4.233118739006381e+00, -1.135715370257396e+00, -5.432062981893455e+00,
|
|||
2.238378162968156e+00, 3.333393703264438e+00, -1.572925906246435e+00, -2.734328259634699e+00,
|
|||
2.017147084475464e+00, 3.909911542141400e+00, -2.644960216780778e+00, -1.689639671556237e+00,
|
|||
-1.555563215691436e+00, 4.167697436792233e+00, -3.174227772880593e+00, -3.445449943922659e+00,
|
|||
-3.991693675979821e+00, -2.395612192990072e+00, -7.608791527035966e+00, -1.199605557244359e+00,
|
|||
3.119768676762977e+00, 2.647386306731720e+00, 3.088495481715207e+00, 4.835922591012088e+00,
|
|||
-2.126408608816460e+00, -6.496133889843878e-01, -3.574988339289840e+00, 4.774591638105163e-01,
|
|||
-8.057225542680848e-01, -1.502186010252237e+00, -4.468302161079752e+00, -6.560811803588420e-01,
|
|||
-3.901614280067265e+00, 6.215718415805858e+00, -4.681753970646017e+00, 6.445270984734710e+00,
|
|||
2.021391810490292e-02, 1.805385996360099e+00, -8.937461326272578e-01, -7.588584122960702e-01,
|
|||
-2.798464518993120e+00, -2.355688055046297e+00, 2.173264828603092e+00, -8.248948121629960e-01,
|
|||
2.639682132748301e+00, 1.701633154204415e+00, -9.959356075165555e-01, 2.054128218014691e+00,
|
|||
1.118615654278817e+00, 1.238455571070932e+00, -2.543476747185558e+00, -1.221476001211498e+00,
|
|||
-3.719950405898309e+00, -3.654794911963335e+00, -1.782620750385735e-01, -6.191786592630609e+00,
|
|||
2.312768769350037e+00, -3.796429682741911e+00, 4.028770258877906e+00, -7.235631972573928e+00,
|
|||
3.480135296267813e+00, 1.372346334547339e+00, 4.772947230001412e+00, -5.943735485336072e-01,
|
|||
-7.037646240419698e-01, -2.824304911746514e+00, 5.150135192916220e+00, -2.544519592918017e+00,
|
|||
7.601446066545735e-01, 3.263458881514898e+00, 3.044651859669117e+00, -1.746167472193509e+00,
|
|||
-3.579498902285684e+00, 1.349669158977704e+00, 1.497677302367308e+00, -4.248256795204092e+00,
|
|||
1.689911156425059e+00, -8.268603075350915e-01, -1.492165597423655e+00, 5.490578426839169e+00,
|
|||
-3.831851193928844e+00, -3.944330086139181e+00, -6.773746016629306e+00, 1.640287552626490e+00,
|
|||
-4.844351629884981e+00, -2.524159012105676e+00, -1.042998871212450e-01, 1.101626615691207e+00,
|
|||
1.455587976273307e+00, 5.712855301747824e+00, 6.450571433636654e-02, -1.463660986831282e+00,
|
|||
5.372292947253837e-01, 4.845214246729507e+00, -5.343117610163509e+00, -5.248479799162289e+00,
|
|||
-3.568747367377906e-01, 1.708135182867247e+00, 1.120142690086254e+00, 1.554454960578805e+00,
|
|||
8.727435711779785e-02, -5.200789512413666e+00, -1.645310465960079e+00, -1.955745233096744e-01,
|
|||
-3.804426226346088e+00, 2.360628066063453e+00, 3.152848007718109e+00, 1.882857879463846e+00,
|
|||
-3.966269981614962e+00, -2.578889617469152e+00, 3.502762058115909e-01, -1.939344791605027e+00,
|
|||
-1.143465327856217e+00, -3.381662456994260e+00, -5.867907573418165e-01, 1.188914452808486e+00,
|
|||
2.787306134089560e+00, 4.406059514292826e-01, -1.209463421383755e+00, -2.081549368638949e+00,
|
|||
-2.239363597649238e+00, 2.622333161216238e+00, -3.376141283756011e-01, -3.873091478779083e-01,
|
|||
-4.554423293554938e+00, -3.928695392899054e+00, -3.549075039135673e+00, 7.723961671240310e+00,
|
|||
-5.515738367157939e-01, 7.532580478755269e-01, 9.470909676459618e-01, 1.133537735465806e+00,
|
|||
-3.729301277306694e+00, -1.188929523990150e+00, -6.963879517225685e+00, 1.359220918694192e+00,
|
|||
2.470203860537831e+00, -1.880268489878626e+00, -3.526081640989057e+00, 6.639837287112855e-01,
|
|||
-4.712992966498973e+00, -3.386970116076343e+00, 2.581170396731584e+00, -1.851687150427199e-01,
|
|||
];
|
|||
|
|||
pub const TIME_DATA_512: [f64; 512] = [
|
|||
1.806168877531084e-01, 4.505110747357421e-02, 7.231734791830953e-01, 3.474376455817901e-01,
|
|||
6.606168245029038e-01, 3.838686010719714e-01, 6.273465024434670e-01, 2.164981463030646e-02,
|
|||
9.105699885230285e-01, 8.005586562788111e-01, 7.458474843427212e-01, 8.131128136107607e-01,
|
|||
3.833063186255292e-01, 6.172792323164492e-01, 5.754948597028139e-01, 5.300517047650156e-01,
|
|||
2.750697558219350e-01, 2.486289596619704e-01, 4.516387704519728e-01, 2.277128260265476e-01,
|
|||
8.044495836130701e-01, 9.861042418959701e-01, 2.999195026938994e-02, 5.356641906672377e-01,
|
|||
8.707721990089234e-02, 8.020914405558039e-01, 9.891449097003400e-01, 6.694625839775015e-02,
|
|||
9.393983618845348e-01, 1.817753363669572e-02, 6.838386137463554e-01, 7.837364800832186e-01,
|
|||
5.341375678827283e-01, 8.853594509311418e-01, 8.990048989061401e-01, 6.259376260804959e-01,
|
|||
1.378689924125582e-01, 2.178015937121246e-01, 1.821410758904337e-01, 4.181986397295434e-02,
|
|||
1.069416585502070e-01, 6.164434850856851e-01, 9.396610101610667e-01, 3.544557309673289e-01,
|
|||
4.106290900595140e-01, 9.843494169844516e-01, 9.455791890352626e-01, 6.766446784335391e-01,
|
|||
9.883022623132862e-01, 7.668313872165943e-01, 3.366992643914761e-01, 6.623818603994812e-01,
|
|||
2.441652867902793e-01, 2.955072508315968e-01, 6.801783712305021e-01, 5.278468304187979e-01,
|
|||
4.115935134075346e-01, 6.026382180363972e-01, 7.505200559237356e-01, 5.835331742619586e-01,
|
|||
5.517925149359675e-01, 5.835706187577144e-01, 5.118199199584752e-01, 8.259272699869935e-02,
|
|||
7.195701348594897e-01, 9.961561112968694e-01, 3.545343049569218e-01, 9.712588151834057e-01,
|
|||
3.464487613003596e-01, 8.865438617603063e-01, 4.546948649919078e-01, 4.134272890208153e-01,
|
|||
2.177320683573004e-01, 1.256545873626262e-01, 3.089145935668153e-01, 7.261044316648319e-01,
|
|||
7.828720729791232e-01, 6.937876149868972e-01, 9.802252263062083e-03, 8.432133380105096e-01,
|
|||
9.223319977962757e-01, 7.709542206739245e-01, 4.265985593504873e-02, 3.781861370502189e-01,
|
|||
7.043396244833676e-01, 7.295130455046469e-01, 2.242770706645144e-01, 2.690547317733650e-01,
|
|||
6.730311650041190e-01, 4.774921977268612e-01, 6.237164126674425e-01, 2.364449326409104e-01,
|
|||
1.771237544983165e-01, 8.296433856975846e-01, 7.669216679352648e-01, 9.344782731182696e-01,
|
|||
1.078889050843636e-01, 1.822275056010557e-01, 9.909528242245846e-02, 4.897638019234469e-01,
|
|||
1.932453304688705e-01, 8.958915737925682e-01, 9.908964968181455e-02, 4.416557176266112e-02,
|
|||
5.572951558047619e-01, 7.724950671876241e-01, 3.119400574962689e-01, 1.789824793143351e-01,
|
|||
3.389556782477182e-01, 2.101456370435520e-01, 5.101525197652502e-01, 9.063643232652148e-01,
|
|||
6.289239386523179e-01, 1.015338888123122e-01, 3.908547527263546e-01, 5.461661522365757e-02,
|
|||
5.012829132032153e-01, 4.317211718842472e-01, 9.975603495121891e-01, 8.116025809953229e-01,
|
|||
4.856516698980177e-01, 8.944477555673932e-01, 1.375465947670648e-01, 3.900049144452854e-01,
|
|||
9.273562249981249e-01, 9.174938324161169e-01, 7.135740115943158e-01, 6.183373836219400e-01,
|
|||
3.432878902413454e-01, 9.360273266897697e-01, 1.247740406604926e-01, 7.305853615057071e-01,
|
|||
6.464774324258138e-01, 8.331519856692950e-01, 3.982822282187755e-01, 7.498222093606359e-01,
|
|||
8.352205104781305e-01, 3.224603973622594e-01, 5.522616168583550e-01, 9.791291324338921e-01,
|
|||
5.493085330183027e-01, 3.304236096066028e-01, 6.194715551777799e-01, 3.606365710022027e-01,
|
|||
7.565095435019443e-01, 4.139007486901897e-01, 4.923451043849377e-01, 6.947432331326101e-01,
|
|||
9.727338850797841e-01, 3.277549604934068e-01, 8.378031830785756e-01, 7.390722272735281e-01,
|
|||
9.541744563795431e-01, 3.192262950397839e-02, 3.568689861825420e-01, 6.626538342872145e-01,
|
|||
2.815015591484906e-01, 2.303830673174637e-01, 7.111285511803251e-01, 6.245729169933085e-01,
|
|||
5.906086529196359e-01, 6.604379663126019e-01, 4.755467311386607e-02, 3.487848085100589e-01,
|
|||
4.513405803557432e-01, 2.409049971201107e-01, 7.150450132961765e-01, 8.561822920062879e-01,
|
|||
2.815076951185533e-01, 7.310508297237415e-01, 1.377628925195163e-01, 8.367227817497175e-01,
|
|||
1.386017157423600e-01, 5.882093853894936e-01, 3.661568004549378e-01, 8.067595446611057e-01,
|
|||
5.037807857761559e-01, 4.895943387233542e-01, 8.770487233850439e-01, 3.531418129389555e-01,
|
|||
4.494435565717483e-01, 9.635302868434269e-01, 4.229779791454280e-02, 9.729583341406347e-01,
|
|||
1.892068431223760e-01, 6.671203000400749e-01, 5.864396146789179e-01, 6.751124164051153e-01,
|
|||
3.610220491946609e-01, 6.202784270710855e-01, 8.111508851002852e-01, 1.925747741414141e-02,
|
|||
8.387350828289986e-02, 9.748016671848904e-01, 6.513495324153533e-01, 2.312378161643522e-01,
|
|||
4.034911431245899e-01, 1.220205182521296e-01, 2.684388213972831e-01, 2.578461701126047e-01,
|
|||
3.316652387426293e-01, 1.522340128629465e-01, 3.480076597161135e-01, 1.216584543077261e-01,
|
|||
8.841530577496601e-01, 9.427839006414607e-02, 9.300406261074891e-01, 3.990199690345555e-01,
|
|||
4.740146202915074e-02, 3.423735031607398e-01, 7.359661588801641e-01, 7.946821573338052e-01,
|
|||
5.449058982446715e-01, 6.862234629840409e-01, 8.936326959336016e-01, 5.479178991973244e-02,
|
|||
3.036613797170159e-01, 4.619155633154781e-02, 1.954767636337984e-01, 7.201658025165256e-01,
|
|||
7.217532734992967e-01, 8.777990711515272e-01, 5.824329644874103e-01, 7.068433538664998e-02,
|
|||
9.227445701890922e-01, 8.003720923511071e-01, 2.859468564203632e-01, 5.436632328413619e-01,
|
|||
9.847762369706098e-01, 7.156780671266215e-01, 8.389695973300002e-01, 4.332605610079483e-01,
|
|||
4.706247156065407e-01, 5.607134110445561e-01, 2.690915435309975e-01, 7.490184676419461e-01,
|
|||
5.038877734604886e-01, 6.468096662727805e-01, 3.077455820309407e-01, 1.387246360781446e-01,
|
|||
4.755729337975629e-01, 3.624592808187460e-01, 7.881134283985473e-01, 7.802958208441096e-01,
|
|||
6.685122142535449e-01, 1.335038596613123e-01, 2.155588720349699e-02, 5.598407058725097e-01,
|
|||
3.008190180694891e-01, 9.394097138734583e-01, 9.809036360468590e-01, 2.866203888942593e-01,
|
|||
8.008202869515346e-01, 8.961113514326038e-01, 5.975265768178296e-01, 8.840167357238198e-01,
|
|||
9.437315411957914e-01, 5.491580874199027e-01, 7.283868245943567e-01, 5.767582978580098e-01,
|
|||
2.585747108313963e-02, 4.465309782848144e-01, 6.463019573506555e-01, 5.212029526724182e-01,
|
|||
3.723126607795121e-01, 9.371346663415623e-01, 8.295328245265149e-01, 8.490854799544552e-01,
|
|||
3.725342398995395e-01, 5.931845752184903e-01, 8.725525646475586e-01, 9.335016085071053e-01,
|
|||
6.684642743613756e-01, 2.067764579351050e-01, 6.538505920625881e-01, 7.205155122064988e-02,
|
|||
4.067269150893638e-01, 6.669315332074987e-01, 9.337256595459297e-01, 8.109500322382651e-01,
|
|||
4.845482718349904e-01, 7.567492100655122e-01, 4.170474537427670e-01, 9.717859929892940e-01,
|
|||
9.879747012308320e-01, 8.641475290312027e-01, 3.888837759124285e-01, 4.547418280391118e-01,
|
|||
2.466871976380792e-01, 7.844230930241771e-01, 8.828376055830525e-01, 9.137116812930182e-01,
|
|||
5.582849236222750e-01, 5.988681027462054e-01, 1.488767203375491e-01, 8.997134845357385e-01,
|
|||
4.503935806521155e-01, 2.056723394639635e-01, 8.996509905090808e-01, 7.625855393732269e-01,
|
|||
8.824863074002980e-01, 2.849502180248212e-01, 6.732259864522577e-01, 6.642799044180507e-01,
|
|||
1.228149938995259e-01, 4.073184230568129e-01, 2.752869513156900e-01, 7.166697406391417e-01,
|
|||
2.833843816289363e-01, 8.961988568494954e-01, 8.265788923135602e-01, 3.900265128139977e-01,
|
|||
4.979029429641866e-01, 6.948051926724939e-01, 8.343690010999377e-01, 6.096296896757324e-01,
|
|||
5.747371608564080e-01, 3.260421709227913e-01, 4.564246008517470e-01, 7.137955832331345e-01,
|
|||
8.844050452759949e-01, 7.208556708169315e-01, 1.861277472638612e-02, 6.747764671282858e-01,
|
|||
4.385088242365128e-01, 4.378201791662700e-01, 1.170368195056578e-01, 8.146816895185822e-01,
|
|||
3.248554386305090e-01, 2.462281142346414e-01, 3.427132211232795e-01, 3.756921400095883e-01,
|
|||
5.465537930829589e-01, 5.619201542659767e-01, 3.958222286240010e-01, 3.981308795313359e-01,
|
|||
5.153672192115724e-01, 6.575305420959110e-01, 9.509151982649592e-01, 7.223485143274979e-01,
|
|||
4.000797453623376e-01, 8.318713393298099e-01, 1.343383417287082e-01, 6.046677193982841e-02,
|
|||
8.424705231465957e-02, 1.638983183297082e-01, 3.242199202940490e-01, 3.017267772046470e-01,
|
|||
1.168099113033960e-02, 5.399050938496253e-01, 9.537269262782155e-02, 1.465148564422315e-01,
|
|||
6.311412070149550e-01, 8.593204114287853e-01, 9.742216312387133e-01, 5.708384274721835e-01,
|
|||
9.968502145749486e-01, 5.535415734955326e-01, 5.154584548403258e-01, 3.306820659902671e-01,
|
|||
4.300017983933964e-01, 4.918062536037447e-01, 7.103708391295271e-02, 8.877392155327161e-01,
|
|||
6.463359105086841e-02, 4.361849557314483e-01, 8.266295066188918e-01, 3.945346842330335e-01,
|
|||
6.134748817052620e-01, 8.186407350822091e-01, 8.862350390626065e-01, 9.311116274872206e-01,
|
|||
1.907846480091222e-01, 2.585822514187723e-01, 8.978656848402992e-01, 5.933618603861089e-01,
|
|||
5.038400818468479e-01, 6.128095888355591e-01, 8.194222422318759e-01, 5.318891694929258e-01,
|
|||
2.020750965484316e-01, 4.538934656805219e-01, 4.279109198201708e-01, 9.660527496119991e-01,
|
|||
6.200550541334737e-01, 6.953899519180036e-01, 7.201646120179794e-01, 3.468951902876136e-01,
|
|||
5.169904205253102e-01, 5.566946320121019e-01, 1.564952191140445e-01, 5.620560455617748e-01,
|
|||
6.948032891084562e-01, 4.264555357102374e-01, 8.362704206763141e-01, 7.313870661619331e-01,
|
|||
3.600310420857716e-01, 4.542123718533986e-01, 3.863898985921723e-01, 7.755546422505355e-01,
|
|||
7.342711056859393e-01, 4.302778450741556e-01, 6.937525741339134e-01, 9.452134871684603e-01,
|
|||
7.842325982317409e-01, 7.055718581310688e-01, 1.093342395243457e-01, 3.899306571564850e-01,
|
|||
5.909047304053364e-01, 4.593800479663254e-01, 5.033998673895412e-02, 2.286875840202208e-01,
|
|||
8.341890610568995e-01, 1.564469269652702e-02, 8.637108650558657e-01, 7.806905303243428e-02,
|
|||
6.690425900815554e-01, 5.002113242811024e-01, 2.179937987501536e-01, 5.716157254040891e-01,
|
|||
1.221891509234198e-01, 6.711662329886530e-01, 5.995855481228138e-01, 5.597615738779049e-02,
|
|||
5.634301854335677e-02, 1.525006370024703e-01, 1.962106676558406e-02, 4.351755456969518e-01,
|
|||
8.322214752828176e-01, 6.173901714540843e-01, 5.201294153107420e-01, 8.638682229336107e-01,
|
|||
9.769791816144313e-02, 9.080522031867692e-01, 1.080166941367590e-01, 5.169967580969449e-01,
|
|||
1.431560220835761e-01, 5.593705724030039e-01, 4.579623947323475e-03, 7.666819986214874e-01,
|
|||
8.487092264582824e-01, 9.168212702537381e-01, 9.869682747836581e-01, 5.051331017988225e-01,
|
|||
2.714216244175151e-01, 1.007505119212356e-01, 5.078488308295366e-01, 5.856091257018784e-01,
|
|||
7.628870959107409e-01, 8.296264911054385e-02, 6.615961930827142e-01, 5.169790147062131e-01,
|
|||
1.710480175254472e-01, 9.385578643318424e-01, 5.904831771425717e-01, 4.406346807608401e-01,
|
|||
9.419189303112829e-01, 6.559138202571413e-01, 4.519457092603858e-01, 8.396974207196690e-01,
|
|||
5.326235024743463e-01, 5.538870657912750e-01, 6.800655300833607e-01, 3.671899053173674e-01,
|
|||
2.392906061935454e-01, 5.789234924590936e-01, 8.668870546725078e-01, 4.067767602152256e-01,
|
|||
1.126151410250468e-01, 4.438458367269573e-01, 3.001844012139000e-01, 4.013868538144928e-01,
|
|||
8.333635634531343e-01, 4.036286627736071e-01, 3.901759381306066e-01, 3.604488933789446e-01,
|
|||
1.402553592694443e-01, 2.601301941124401e-01, 8.681510086583366e-02, 4.293973370858053e-01,
|
|||
2.572827847698599e-01, 2.975553841511184e-01, 4.248584117046258e-01, 1.192072594212871e-01,
|
|||
4.950669238004591e-01, 7.064072275375605e-01, 2.435733726809508e-01, 7.850700819340061e-01,
|
|||
7.408957686092688e-02, 3.938834269816966e-01, 3.394122964307411e-03, 2.206768919330240e-01,
|
|||
1.300568700596139e-03, 1.891796709947352e-01, 1.424840548209715e-01, 2.680759991233760e-01,
|
|||
1.748920653357828e-01, 1.386489715925953e-01, 5.988856103678650e-01, 9.010579056827256e-01,
|
|||
9.393797658842382e-01, 2.211844559390779e-01, 4.826713753964138e-01, 3.760111159247546e-01,
|
|||
5.237800369658695e-01, 2.648725935485898e-01, 6.835722047082915e-02, 4.363270774801027e-01,
|
|||
1.738530373650010e-01, 2.610710815490491e-02, 9.546782740804495e-01, 4.305965198594173e-01,
|
|||
];
|
|||
|
|||
pub const FREQUENCY_DATA_512_REAL_UNPACKED: [f64; 2 * 512] = [
|
|||
2.619138110805671e+02, 0.000000000000000e+00, -1.115198053389060e+01, -2.093238257176621e+00,
|
|||
-8.200015102444658e-01, -7.430644653475370e+00, -7.705513879535983e+00, -7.961932330163530e-01,
|
|||
4.808921541164337e+00, -1.175049590959020e+01, -9.898825616254497e+00, -1.046847356411203e+00,
|
|||
-8.538542464542386e+00, -3.124513512169643e+00, 5.929533007177103e+00, -6.682324683920234e+00,
|
|||
9.294132606813310e+00, -3.078788645618447e+00, 4.735864707544096e+00, -2.834662284625422e+00,
|
|||
-2.704976477147880e+00, -4.771762179832171e-01, 2.781628079065968e+00, 7.607033774189008e+00,
|
|||
4.536471930820263e-01, -4.234186011130483e+00, -2.694473246748331e+00, -3.027108115093186e+00,
|
|||
4.170109743112776e+00, -1.529841079065024e-01, -7.016838902047954e+00, 3.293945497290087e-01,
|
|||
-1.469436230459260e+00, 4.015828382290277e+00, -1.348484236823121e+00, -2.737227825621715e+00,
|
|||
2.580580187332635e+00, -3.037540370839985e+00, -2.914789371223259e+00, 3.805515700385120e-01,
|
|||
4.607789858888227e+00, 4.391538789546265e-01, -2.039094736161577e+00, 1.710674414552282e+00,
|
|||
-1.561214747151728e+00, -1.391093257125061e+00, -2.471811499127627e-01, -4.384445856884108e+00,
|
|||
-4.028581652984820e+00, 5.805438051017495e+00, -7.499100689400009e+00, -1.066241172885081e+01,
|
|||
-4.318228299783605e+00, -3.144074839146552e+00, -3.323455275844535e+00, 8.396352081437128e-01,
|
|||
-1.077138648563686e+01, -3.135963014122133e+00, 5.203510979945534e-01, 1.629783978974322e+00,
|
|||
-5.489661601924908e+00, 8.166418133379253e+00, -5.113967597278687e+00, -2.547150414055323e+00,
|
|||
6.894482090786214e+00, -8.231000673725068e-01, 2.642620807324227e+00, 1.676033773179202e-01,
|
|||
-2.811320166242819e-01, -9.308479974806125e-01, -1.170323937144983e+00, -1.923971471364242e+01,
|
|||
4.986096547926358e+00, 4.451554500839894e-02, 1.605346036925677e-01, -2.271501508783336e+00,
|
|||
8.405811536822286e+00, 8.286416405851164e-01, 6.696466094116618e-01, 9.936421116532120e-01,
|
|||
-3.967756035766337e+00, 5.035600043550436e+00, -4.975862449438469e+00, -1.073002510922096e+00,
|
|||
3.518076757813177e+00, 2.972120781785964e+00, 3.232843066707336e+00, 5.005214256068108e+00,
|
|||
8.425460654609068e+00, 1.083552106138148e+01, 3.655636545651687e+00, 4.942944805021971e+00,
|
|||
5.591137088101026e+00, 1.761738247406500e+00, -2.984093429544520e+00, -2.218066839523427e+00,
|
|||
3.215220533360645e+00, -3.128430150390831e+00, 1.086079136001600e+00, -4.019600896223478e+00,
|
|||
-2.324426904773080e+00, -1.068077096198534e+00, 4.024480538702931e+00, 3.509122313302369e+00,
|
|||
-1.119130895924454e+00, 2.432804817795666e+00, 3.008268220389146e+00, 1.705981736759047e+00,
|
|||
-7.743663023539586e+00, 3.131051861809782e+00, 3.222893719481340e+00, -6.577825036895151e+00,
|
|||
5.224562383239652e+00, -5.788258352733448e+00, -4.609225183406877e+00, 6.278249376932217e+00,
|
|||
1.566503184043088e+00, 4.731268374069121e+00, -7.394233645645288e+00, 2.728068669997588e+00,
|
|||
1.980268836206709e+00, 3.542570478843931e+00, 5.186505496936096e+00, -5.283947875955040e+00,
|
|||
-1.990235482339024e+00, -4.276211188283089e+00, -2.883109503407805e+00, -1.064048413268301e+00,
|
|||
-1.410970776522150e+00, -2.517124568836177e+00, 1.055180728528839e+01, 1.047260703002487e+00,
|
|||
-6.451549378495589e+00, -3.335397255493711e+00, -7.499255668636902e+00, 5.317817777814344e-01,
|
|||
9.951693195362443e-01, -1.039482760623180e+00, -7.114591885454081e+00, 8.158194346990129e+00,
|
|||
-1.302307674670791e-01, -2.374747305214465e+00, -8.881661156617103e+00, -3.248060173083817e+00,
|
|||
4.950075451033101e+00, 7.368026970180210e-01, -5.992306970550251e+00, 7.797959221937784e+00,
|
|||
9.677969079964690e+00, -2.442582586274967e+00, -3.613491495111024e+00, 1.399683997077632e+00,
|
|||
-2.309781414201543e-01, -4.024697025058348e-01, 4.622841749472442e+00, -1.465485020859071e+00,
|
|||
6.131933084766453e+00, -9.117509119579497e+00, 2.355314674509621e+00, -2.288029974265379e+00,
|
|||
3.091776866072473e+00, 8.755469413649359e-01, -8.649090391178405e-01, 1.050403628184431e+01,
|
|||
-1.696728568992433e+00, 1.740913703996018e+00, -8.816405714122906e-01, -5.731103583499061e+00,
|
|||
-8.933035833007693e+00, 3.197595516414023e+00, -2.540807335668393e+00, -6.229493532160216e+00,
|
|||
-6.453143645663326e-01, 1.073060787660790e+01, 4.331264438236961e+00, -2.941850938813325e+00,
|
|||
-4.313753143682344e-01, 3.018899019083947e+00, -6.051879349876754e+00, -1.728740776409845e+00,
|
|||
-3.139444199854440e+00, 2.145999890329052e+00, -3.384269724366646e+00, 4.405313260844331e+00,
|
|||
-2.896001808690837e+00, 7.559961197961543e+00, -1.638182672518742e+00, -4.082193744619680e-01,
|
|||
-4.727842565426033e+00, 4.855440625454208e+00, -1.790739114954947e+00, 7.525039452975838e+00,
|
|||
1.241090425199624e+00, 3.123291753380865e+00, -6.068289539732885e-02, 6.143211733539042e+00,
|
|||
7.229887948433212e-01, -3.475310030263739e+00, -2.318171287092368e+00, -1.170967907224973e+00,
|
|||
-2.968963641410836e+00, 2.469949496124910e+00, 3.388508532171732e-01, 4.789425545228717e+00,
|
|||
3.637640475089873e+00, 6.649844154272362e+00, 8.826458701518895e+00, -6.980243097247519e+00,
|
|||
-1.266147389960346e+00, -7.088716718480166e-01, -6.744394204515544e+00, -3.594984129647252e-01,
|
|||
-8.430184913706638e+00, -1.305497034366212e+00, -4.879622472929892e+00, 1.819633493360833e+00,
|
|||
5.212016365855454e+00, -6.281540531689200e+00, 3.864620927561699e+00, 3.881224926440831e+00,
|
|||
-1.502451167763855e+00, -4.268215810346013e+00, 4.327407054442016e-01, -1.583096056467947e+00,
|
|||
-3.995151503093658e-01, -4.667499549445483e+00, -3.634428182616939e+00, 3.776311383916513e+00,
|
|||
3.719809958874579e+00, 2.570744809568180e+00, 9.567748439612478e-01, 2.839338648906699e+00,
|
|||
-1.577291426041798e-01, -1.597019113268755e+00, -1.320768450278335e+00, -3.099578121966010e+00,
|
|||
-3.408303508938111e+00, 1.021495222387502e+00, 6.056619718885509e+00, 3.287912723104686e+00,
|
|||
-2.067717321818745e+00, 5.902778124521634e+00, 6.991904328291065e-02, 5.366962567660710e+00,
|
|||
7.247167857384769e+00, -9.987817259132376e+00, 7.006817941978442e+00, 3.206690324747669e+00,
|
|||
-4.039152373799737e+00, 1.483261747626578e+00, 1.316149382945287e+00, 2.899506605970243e-01,
|
|||
-2.737498689702138e+00, -1.299115283811872e+00, 3.085717015621618e+00, 6.665104828580986e-01,
|
|||
-2.551385250652210e+00, 1.052417983754310e-01, -8.389993662474575e-01, -3.696966275555670e+00,
|
|||
-6.672280480071879e+00, -9.056162591704429e-01, -8.126681518176483e+00, 6.129234224931580e+00,
|
|||
4.584323345988825e+00, 5.016242991080830e+00, -1.219393826108348e+00, -2.993870037055617e+00,
|
|||
-1.864312726912067e+00, 8.062054710462570e+00, 4.455035352772764e+00, 3.120998307009305e+00,
|
|||
-2.924636195377698e+00, -1.668578268256297e+00, -3.473727290432167e+00, -3.870691703118520e+00,
|
|||
-6.185334722726848e+00, 3.984395876382242e+00, -1.527851891080256e+00, 1.993364544205765e-01,
|
|||
-7.666009294630983e+00, -3.917504929311941e-01, 2.888140400676157e+00, -3.716178197877443e+00,
|
|||
4.980166715244614e-01, 5.942302773943424e+00, -6.430845495211380e+00, 8.812516704722375e-01,
|
|||
2.227989700065884e+00, -6.791950308263385e+00, -9.328538374431355e+00, 9.147826621930625e+00,
|
|||
2.048806823194851e-01, 1.713872506312473e+00, 9.013265074447729e-01, 9.844987073093869e-01,
|
|||
4.118838672020591e+00, 3.729736774300223e-01, 5.629103306378829e-01, -4.175870224636906e+00,
|
|||
-6.405664448972425e+00, 4.602133214791547e+00, 1.026855599307259e+00, -1.902249771522030e+00,
|
|||
2.071808028976322e+00, -5.489037448246241e+00, -2.880374687838525e+00, -4.804607566030888e+00,
|
|||
-4.658936772476315e+00, -6.007793054144102e+00, -6.837257087056265e+00, 5.018812073479129e+00,
|
|||
7.708317658744543e-01, 1.815061951080991e+00, -1.710941178124903e+00, -2.166134537369716e+00,
|
|||
1.094038329635999e+00, 8.533521028686508e+00, -5.526632973003027e-01, 4.288943996680091e+00,
|
|||
-5.852033276229081e+00, 4.407153040194589e-02, -5.425581620899147e+00, -1.815508258033112e-01,
|
|||
2.402622804491986e+00, -3.706878132036692e+00, -6.468255867015987e+00, -9.899006388950724e+00,
|
|||
-9.764037678609139e-02, 1.814994637565298e+00, -3.203759165327217e+00, 1.141425690003025e+00,
|
|||
5.223945858903594e+00, 6.435077209064109e+00, -2.040287466475237e+00, -2.562399278971683e+00,
|
|||
1.642149723401189e+00, 4.824685794822206e+00, -3.044537976414709e+00, 3.660214507064629e+00,
|
|||
3.079161095441084e+00, 1.538355571483298e+00, -4.284845705831135e+00, -1.947331240925162e+00,
|
|||
-3.768483997655424e+00, 4.683615603641362e+00, -2.804522014157483e+00, -3.986619943343518e+00,
|
|||
-1.817984909284021e+00, -3.305358818768953e+00, 1.502584872579042e+00, 4.708364731482699e+00,
|
|||
1.143729189846115e+00, -8.794631259124452e-02, -2.895754994560165e+00, 3.017419983238508e+00,
|
|||
3.474806338399494e+00, 5.104246173950999e+00, -4.406737051771778e+00, -4.078246385418372e+00,
|
|||
-4.404694477921830e+00, 7.830813624414137e+00, 4.163608559006926e-01, -7.926413840769740e+00,
|
|||
1.303461176226292e+01, -7.365683904389641e+00, 4.476211897682230e+00, -1.338373993085695e+00,
|
|||
-2.274764327943855e+00, 3.969082207635650e+00, -6.453082146368692e-01, -6.143999341367548e+00,
|
|||
-3.475488869191185e+00, -2.023271683875887e+00, -1.369103524248871e+00, -1.387037019447591e+00,
|
|||
-1.210489761702059e+00, -4.542343222749198e+00, -1.331431110781724e-01, -9.075946127921182e-01,
|
|||
-5.177564629651572e+00, 2.455970528216657e+00, 3.691249052573440e+00, -1.673080242300862e+00,
|
|||
1.912182035375140e+00, -1.312615300521312e+00, -1.251141744555015e+00, 3.958327304016206e+00,
|
|||
2.771123716702051e-01, 1.999063877905356e+00, -4.155155433181079e+00, -8.444156417906978e-01,
|
|||
-2.116273521786312e+00, 3.788095838420060e+00, -7.507754666590323e+00, 3.326089670218413e-02,
|
|||
4.905796052897330e+00, 4.556223645818581e+00, 9.240108598837768e+00, -1.009350499228775e+01,
|
|||
3.598337919127382e+00, -3.048404278311585e+00, 4.980718588535794e+00, 3.047519697392533e-01,
|
|||
-2.344033930886350e+00, -8.035245093554686e+00, 9.170890073497524e+00, -3.543571096766250e+00,
|
|||
4.183930943883264e+00, -3.673598274208000e+00, -3.005278029624455e+00, -1.135725746340678e+00,
|
|||
-6.545171960243179e-02, 3.965945117860259e-01, 5.129683349114183e+00, -4.001620807901958e+00,
|
|||
-2.738518015096642e+00, -5.113202762289758e+00, -4.122911420601460e+00, -1.601192787646148e+00,
|
|||
-4.940616875054313e-01, -7.625851861756456e-01, -6.140656867341225e+00, 7.056509108397250e+00,
|
|||
-1.047647277680205e+01, -1.490537740526122e+00, 1.750125158407559e+00, -8.980052096244597e-01,
|
|||
-4.441113625642239e+00, -9.630808301176916e-01, 4.871201570796909e+00, 9.950714330413124e+00,
|
|||
7.578893938310987e-01, -3.625968249215687e+00, -5.915214379585120e+00, 1.156388804338686e-01,
|
|||
1.105860925400031e+00, 5.146404866535110e+00, 3.018223037908849e+00, -5.585303882451983e+00,
|
|||
7.939380851394719e+00, 9.404451546831240e+00, 2.662384827989065e+00, 5.415980217834097e+00,
|
|||
5.384808730374431e+00, -2.099994208860945e+00, -3.214839687312243e+00, -3.190403849749028e+00,
|
|||
3.449820285335980e+00, -4.869521848106168e+00, -2.936756738941453e-01, -9.408874776611528e-01,
|
|||
6.332613968385270e-01, 4.006208820446869e+00, 1.992726081555017e+00, 4.469594342604584e+00,
|
|||
-3.843002077006955e+00, 7.743129531845536e+00, -7.008944518173879e+00, -4.197783446638493e+00,
|
|||
4.408841096823935e+00, 1.177308232239781e+00, -4.272335699448684e+00, 4.757654871323830e+00,
|
|||
-1.191146139678042e+00, -9.221772364771397e-04, 3.349188462779500e+00, 3.948069260833601e+00,
|
|||
9.127371019005301e-01, -6.716150719696672e-01, -1.828365952626035e+00, 6.137975289408976e+00,
|
|||
-3.418884852600284e+00, 8.777867800360051e-01, -3.135109195213406e+00, 6.533347753457486e+00,
|
|||
3.683389139629988e+00, -2.574900489200746e+00, 6.990020013124132e+00, -7.916582488718228e+00,
|
|||
7.991122184404597e-01, -4.859788512723076e+00, 3.264782829214391e+00, 3.965023595567049e+00,
|
|||
7.610469396179063e-01, 5.532678888281716e+00, 3.790752503936816e+00, -3.802744465906520e+00,
|
|||
-2.706339202089834e+00, -5.722734566436507e+00, 1.674161414638171e+00, 1.147184591426204e+00,
|
|||
1.414569524174249e+01, -1.188079386264216e+00, 7.934033025983180e-01, -2.743016641560216e+00,
|
|||
-1.245322153627866e-01, 7.150529101422920e+00, 4.076112080871496e+00, -1.506043506392340e+00,
|
|||
-4.866676790136244e+00, -6.803342622748687e-01, 2.599023021817089e+00, 5.720397531899284e+00,
|
|||
6.140571612873296e+00, -1.049863266190272e-01, 2.993531810286013e+00, 5.044661398396778e+00,
|
|||
5.214526690760704e+00, -3.585233477406347e+00, 1.063679699244957e+00, 4.691687296086943e-01,
|
|||
-9.086160107535221e+00, 0.000000000000000e+00, 1.063679699244957e+00, -4.691687296086943e-01,
|
|||
5.214526690760704e+00, 3.585233477406347e+00, 2.993531810286013e+00, -5.044661398396778e+00,
|
|||
6.140571612873296e+00, 1.049863266190272e-01, 2.599023021817089e+00, -5.720397531899284e+00,
|
|||
-4.866676790136244e+00, 6.803342622748687e-01, 4.076112080871496e+00, 1.506043506392340e+00,
|
|||
-1.245322153627866e-01, -7.150529101422920e+00, 7.934033025983180e-01, 2.743016641560216e+00,
|
|||
1.414569524174249e+01, 1.188079386264216e+00, 1.674161414638171e+00, -1.147184591426204e+00,
|
|||
-2.706339202089834e+00, 5.722734566436507e+00, 3.790752503936816e+00, 3.802744465906520e+00,
|
|||
7.610469396179063e-01, -5.532678888281716e+00, 3.264782829214391e+00, -3.965023595567049e+00,
|
|||
7.991122184404597e-01, 4.859788512723076e+00, 6.990020013124132e+00, 7.916582488718228e+00,
|
|||
3.683389139629988e+00, 2.574900489200746e+00, -3.135109195213406e+00, -6.533347753457486e+00,
|
|||
-3.418884852600284e+00, -8.777867800360051e-01, -1.828365952626035e+00, -6.137975289408976e+00,
|
|||
9.127371019005301e-01, 6.716150719696672e-01, 3.349188462779500e+00, -3.948069260833601e+00,
|
|||
-1.191146139678042e+00, 9.221772364771397e-04, -4.272335699448684e+00, -4.757654871323830e+00,
|
|||
4.408841096823935e+00, -1.177308232239781e+00, -7.008944518173879e+00, 4.197783446638493e+00,
|
|||
-3.843002077006955e+00, -7.743129531845536e+00, 1.992726081555017e+00, -4.469594342604584e+00,
|
|||
6.332613968385270e-01, -4.006208820446869e+00, -2.936756738941453e-01, 9.408874776611528e-01,
|
|||
3.449820285335980e+00, 4.869521848106168e+00, -3.214839687312243e+00, 3.190403849749028e+00,
|
|||
5.384808730374431e+00, 2.099994208860945e+00, 2.662384827989065e+00, -5.415980217834097e+00,
|
|||
7.939380851394719e+00, -9.404451546831240e+00, 3.018223037908849e+00, 5.585303882451983e+00,
|
|||
1.105860925400031e+00, -5.146404866535110e+00, -5.915214379585120e+00, -1.156388804338686e-01,
|
|||
7.578893938310987e-01, 3.625968249215687e+00, 4.871201570796909e+00, -9.950714330413124e+00,
|
|||
-4.441113625642239e+00, 9.630808301176916e-01, 1.750125158407559e+00, 8.980052096244597e-01,
|
|||
-1.047647277680205e+01, 1.490537740526122e+00, -6.140656867341225e+00, -7.056509108397250e+00,
|
|||
-4.940616875054313e-01, 7.625851861756456e-01, -4.122911420601460e+00, 1.601192787646148e+00,
|
|||
-2.738518015096642e+00, 5.113202762289758e+00, 5.129683349114183e+00, 4.001620807901958e+00,
|
|||
-6.545171960243179e-02, -3.965945117860259e-01, -3.005278029624455e+00, 1.135725746340678e+00,
|
|||
4.183930943883264e+00, 3.673598274208000e+00, 9.170890073497524e+00, 3.543571096766250e+00,
|
|||
-2.344033930886350e+00, 8.035245093554686e+00, 4.980718588535794e+00, -3.047519697392533e-01,
|
|||
3.598337919127382e+00, 3.048404278311585e+00, 9.240108598837768e+00, 1.009350499228775e+01,
|
|||
4.905796052897330e+00, -4.556223645818581e+00, -7.507754666590323e+00, -3.326089670218413e-02,
|
|||
-2.116273521786312e+00, -3.788095838420060e+00, -4.155155433181079e+00, 8.444156417906978e-01,
|
|||
2.771123716702051e-01, -1.999063877905356e+00, -1.251141744555015e+00, -3.958327304016206e+00,
|
|||
1.912182035375140e+00, 1.312615300521312e+00, 3.691249052573440e+00, 1.673080242300862e+00,
|
|||
-5.177564629651572e+00, -2.455970528216657e+00, -1.331431110781724e-01, 9.075946127921182e-01,
|
|||
-1.210489761702059e+00, 4.542343222749198e+00, -1.369103524248871e+00, 1.387037019447591e+00,
|
|||
-3.475488869191185e+00, 2.023271683875887e+00, -6.453082146368692e-01, 6.143999341367548e+00,
|
|||
-2.274764327943855e+00, -3.969082207635650e+00, 4.476211897682230e+00, 1.338373993085695e+00,
|
|||
1.303461176226292e+01, 7.365683904389641e+00, 4.163608559006926e-01, 7.926413840769740e+00,
|
|||
-4.404694477921830e+00, -7.830813624414137e+00, -4.406737051771778e+00, 4.078246385418372e+00,
|
|||
3.474806338399494e+00, -5.104246173950999e+00, -2.895754994560165e+00, -3.017419983238508e+00,
|
|||
1.143729189846115e+00, 8.794631259124452e-02, 1.502584872579042e+00, -4.708364731482699e+00,
|
|||
-1.817984909284021e+00, 3.305358818768953e+00, -2.804522014157483e+00, 3.986619943343518e+00,
|
|||
-3.768483997655424e+00, -4.683615603641362e+00, -4.284845705831135e+00, 1.947331240925162e+00,
|
|||
3.079161095441084e+00, -1.538355571483298e+00, -3.044537976414709e+00, -3.660214507064629e+00,
|
|||
1.642149723401189e+00, -4.824685794822206e+00, -2.040287466475237e+00, 2.562399278971683e+00,
|
|||
5.223945858903594e+00, -6.435077209064109e+00, -3.203759165327217e+00, -1.141425690003025e+00,
|
|||
-9.764037678609139e-02, -1.814994637565298e+00, -6.468255867015987e+00, 9.899006388950724e+00,
|
|||
2.402622804491986e+00, 3.706878132036692e+00, -5.425581620899147e+00, 1.815508258033112e-01,
|
|||
-5.852033276229081e+00, -4.407153040194589e-02, -5.526632973003027e-01, -4.288943996680091e+00,
|
|||
1.094038329635999e+00, -8.533521028686508e+00, -1.710941178124903e+00, 2.166134537369716e+00,
|
|||
7.708317658744543e-01, -1.815061951080991e+00, -6.837257087056265e+00, -5.018812073479129e+00,
|
|||
-4.658936772476315e+00, 6.007793054144102e+00, -2.880374687838525e+00, 4.804607566030888e+00,
|
|||
2.071808028976322e+00, 5.489037448246241e+00, 1.026855599307259e+00, 1.902249771522030e+00,
|
|||
-6.405664448972425e+00, -4.602133214791547e+00, 5.629103306378829e-01, 4.175870224636906e+00,
|
|||
4.118838672020591e+00, -3.729736774300223e-01, 9.013265074447729e-01, -9.844987073093869e-01,
|
|||
2.048806823194851e-01, -1.713872506312473e+00, -9.328538374431355e+00, -9.147826621930625e+00,
|
|||
2.227989700065884e+00, 6.791950308263385e+00, -6.430845495211380e+00, -8.812516704722375e-01,
|
|||
4.980166715244614e-01, -5.942302773943424e+00, 2.888140400676157e+00, 3.716178197877443e+00,
|
|||
-7.666009294630983e+00, 3.917504929311941e-01, -1.527851891080256e+00, -1.993364544205765e-01,
|
|||
-6.185334722726848e+00, -3.984395876382242e+00, -3.473727290432167e+00, 3.870691703118520e+00,
|
|||
-2.924636195377698e+00, 1.668578268256297e+00, 4.455035352772764e+00, -3.120998307009305e+00,
|
|||
-1.864312726912067e+00, -8.062054710462570e+00, -1.219393826108348e+00, 2.993870037055617e+00,
|
|||
4.584323345988825e+00, -5.016242991080830e+00, -8.126681518176483e+00, -6.129234224931580e+00,
|
|||
-6.672280480071879e+00, 9.056162591704429e-01, -8.389993662474575e-01, 3.696966275555670e+00,
|
|||
-2.551385250652210e+00, -1.052417983754310e-01, 3.085717015621618e+00, -6.665104828580986e-01,
|
|||
-2.737498689702138e+00, 1.299115283811872e+00, 1.316149382945287e+00, -2.899506605970243e-01,
|
|||
-4.039152373799737e+00, -1.483261747626578e+00, 7.006817941978442e+00, -3.206690324747669e+00,
|
|||
7.247167857384769e+00, 9.987817259132376e+00, 6.991904328291065e-02, -5.366962567660710e+00,
|
|||
-2.067717321818745e+00, -5.902778124521634e+00, 6.056619718885509e+00, -3.287912723104686e+00,
|
|||
-3.408303508938111e+00, -1.021495222387502e+00, -1.320768450278335e+00, 3.099578121966010e+00,
|
|||
-1.577291426041798e-01, 1.597019113268755e+00, 9.567748439612478e-01, -2.839338648906699e+00,
|
|||
3.719809958874579e+00, -2.570744809568180e+00, -3.634428182616939e+00, -3.776311383916513e+00,
|
|||
-3.995151503093658e-01, 4.667499549445483e+00, 4.327407054442016e-01, 1.583096056467947e+00,
|
|||
-1.502451167763855e+00, 4.268215810346013e+00, 3.864620927561699e+00, -3.881224926440831e+00,
|
|||
5.212016365855454e+00, 6.281540531689200e+00, -4.879622472929892e+00, -1.819633493360833e+00,
|
|||
-8.430184913706638e+00, 1.305497034366212e+00, -6.744394204515544e+00, 3.594984129647252e-01,
|
|||
-1.266147389960346e+00, 7.088716718480166e-01, 8.826458701518895e+00, 6.980243097247519e+00,
|
|||
3.637640475089873e+00, -6.649844154272362e+00, 3.388508532171732e-01, -4.789425545228717e+00,
|
|||
-2.968963641410836e+00, -2.469949496124910e+00, -2.318171287092368e+00, 1.170967907224973e+00,
|
|||
7.229887948433212e-01, 3.475310030263739e+00, -6.068289539732885e-02, -6.143211733539042e+00,
|
|||
1.241090425199624e+00, -3.123291753380865e+00, -1.790739114954947e+00, -7.525039452975838e+00,
|
|||
-4.727842565426033e+00, -4.855440625454208e+00, -1.638182672518742e+00, 4.082193744619680e-01,
|
|||
-2.896001808690837e+00, -7.559961197961543e+00, -3.384269724366646e+00, -4.405313260844331e+00,
|
|||
-3.139444199854440e+00, -2.145999890329052e+00, -6.051879349876754e+00, 1.728740776409845e+00,
|
|||
-4.313753143682344e-01, -3.018899019083947e+00, 4.331264438236961e+00, 2.941850938813325e+00,
|
|||
-6.453143645663326e-01, -1.073060787660790e+01, -2.540807335668393e+00, 6.229493532160216e+00,
|
|||
-8.933035833007693e+00, -3.197595516414023e+00, -8.816405714122906e-01, 5.731103583499061e+00,
|
|||
-1.696728568992433e+00, -1.740913703996018e+00, -8.649090391178405e-01, -1.050403628184431e+01,
|
|||
3.091776866072473e+00, -8.755469413649359e-01, 2.355314674509621e+00, 2.288029974265379e+00,
|
|||
6.131933084766453e+00, 9.117509119579497e+00, 4.622841749472442e+00, 1.465485020859071e+00,
|
|||
-2.309781414201543e-01, 4.024697025058348e-01, -3.613491495111024e+00, -1.399683997077632e+00,
|
|||
9.677969079964690e+00, 2.442582586274967e+00, -5.992306970550251e+00, -7.797959221937784e+00,
|
|||
4.950075451033101e+00, -7.368026970180210e-01, -8.881661156617103e+00, 3.248060173083817e+00,
|
|||
-1.302307674670791e-01, 2.374747305214465e+00, -7.114591885454081e+00, -8.158194346990129e+00,
|
|||
9.951693195362443e-01, 1.039482760623180e+00, -7.499255668636902e+00, -5.317817777814344e-01,
|
|||
-6.451549378495589e+00, 3.335397255493711e+00, 1.055180728528839e+01, -1.047260703002487e+00,
|
|||
-1.410970776522150e+00, 2.517124568836177e+00, -2.883109503407805e+00, 1.064048413268301e+00,
|
|||
-1.990235482339024e+00, 4.276211188283089e+00, 5.186505496936096e+00, 5.283947875955040e+00,
|
|||
1.980268836206709e+00, -3.542570478843931e+00, -7.394233645645288e+00, -2.728068669997588e+00,
|
|||
1.566503184043088e+00, -4.731268374069121e+00, -4.609225183406877e+00, -6.278249376932217e+00,
|
|||
5.224562383239652e+00, 5.788258352733448e+00, 3.222893719481340e+00, 6.577825036895151e+00,
|
|||
-7.743663023539586e+00, -3.131051861809782e+00, 3.008268220389146e+00, -1.705981736759047e+00,
|
|||
-1.119130895924454e+00, -2.432804817795666e+00, 4.024480538702931e+00, -3.509122313302369e+00,
|
|||
-2.324426904773080e+00, 1.068077096198534e+00, 1.086079136001600e+00, 4.019600896223478e+00,
|
|||
3.215220533360645e+00, 3.128430150390831e+00, -2.984093429544520e+00, 2.218066839523427e+00,
|
|||
5.591137088101026e+00, -1.761738247406500e+00, 3.655636545651687e+00, -4.942944805021971e+00,
|
|||
8.425460654609068e+00, -1.083552106138148e+01, 3.232843066707336e+00, -5.005214256068108e+00,
|
|||
3.518076757813177e+00, -2.972120781785964e+00, -4.975862449438469e+00, 1.073002510922096e+00,
|
|||
-3.967756035766337e+00, -5.035600043550436e+00, 6.696466094116618e-01, -9.936421116532120e-01,
|
|||
8.405811536822286e+00, -8.286416405851164e-01, 1.605346036925677e-01, 2.271501508783336e+00,
|
|||
4.986096547926358e+00, -4.451554500839894e-02, -1.170323937144983e+00, 1.923971471364242e+01,
|
|||
-2.811320166242819e-01, 9.308479974806125e-01, 2.642620807324227e+00, -1.676033773179202e-01,
|
|||
6.894482090786214e+00, 8.231000673725068e-01, -5.113967597278687e+00, 2.547150414055323e+00,
|
|||
-5.489661601924908e+00, -8.166418133379253e+00, 5.203510979945534e-01, -1.629783978974322e+00,
|
|||
-1.077138648563686e+01, 3.135963014122133e+00, -3.323455275844535e+00, -8.396352081437128e-01,
|
|||
-4.318228299783605e+00, 3.144074839146552e+00, -7.499100689400009e+00, 1.066241172885081e+01,
|
|||
-4.028581652984820e+00, -5.805438051017495e+00, -2.471811499127627e-01, 4.384445856884108e+00,
|
|||
-1.561214747151728e+00, 1.391093257125061e+00, -2.039094736161577e+00, -1.710674414552282e+00,
|
|||
4.607789858888227e+00, -4.391538789546265e-01, -2.914789371223259e+00, -3.805515700385120e-01,
|
|||
2.580580187332635e+00, 3.037540370839985e+00, -1.348484236823121e+00, 2.737227825621715e+00,
|
|||
-1.469436230459260e+00, -4.015828382290277e+00, -7.016838902047954e+00, -3.293945497290087e-01,
|
|||
4.170109743112776e+00, 1.529841079065024e-01, -2.694473246748331e+00, 3.027108115093186e+00,
|
|||
4.536471930820263e-01, 4.234186011130483e+00, 2.781628079065968e+00, -7.607033774189008e+00,
|
|||
-2.704976477147880e+00, 4.771762179832171e-01, 4.735864707544096e+00, 2.834662284625422e+00,
|
|||
9.294132606813310e+00, 3.078788645618447e+00, 5.929533007177103e+00, 6.682324683920234e+00,
|
|||
-8.538542464542386e+00, 3.124513512169643e+00, -9.898825616254497e+00, 1.046847356411203e+00,
|
|||
4.808921541164337e+00, 1.175049590959020e+01, -7.705513879535983e+00, 7.961932330163530e-01,
|
|||
-8.200015102444658e-01, 7.430644653475370e+00, -1.115198053389060e+01, 2.093238257176621e+00,
|
|||
];
|
@ -1,76 +0,0 @@ |
|||
extern crate assert;
|
|||
extern crate complex;
|
|||
extern crate dft;
|
|||
|
|||
use complex::c64;
|
|||
|
|||
mod fixtures;
|
|||
|
|||
#[test]
|
|||
fn complex_forward_128() {
|
|||
let mut data = fixtures::TIME_DATA_256.to_vec();
|
|||
dft::complex::forward(as_c64_mut(&mut data));
|
|||
assert::close(&data, &fixtures::FREQUENCY_DATA_128_COMPLEX[..], 1e-14);
|
|||
}
|
|||
|
|||
#[test]
|
|||
fn complex_forward_real_256() {
|
|||
let mut data = to_c64(&fixtures::TIME_DATA_256);
|
|||
dft::complex::forward(&mut data);
|
|||
assert::close(as_f64(&data), &fixtures::FREQUENCY_DATA_256_REAL_UNPACKED[..], 1e-13);
|
|||
}
|
|||
|
|||
#[test]
|
|||
fn complex_inverse_128() {
|
|||
let mut data = fixtures::FREQUENCY_DATA_128_COMPLEX.to_vec();
|
|||
dft::complex::inverse(as_c64_mut(&mut data));
|
|||
assert::close(&data, &fixtures::TIME_DATA_256[..], 1e-14);
|
|||
}
|
|||
|
|||
#[test]
|
|||
fn real_forward_256() {
|
|||
let mut data = fixtures::TIME_DATA_256.to_vec();
|
|||
dft::real::forward(&mut data);
|
|||
assert::close(&data, &fixtures::FREQUENCY_DATA_256_REAL_PACKED[..], 1e-13);
|
|||
let data = dft::real::unpack(&data);
|
|||
assert::close(as_f64(&data), &fixtures::FREQUENCY_DATA_256_REAL_UNPACKED[..], 1e-13);
|
|||
}
|
|||
|
|||
#[test]
|
|||
fn real_forward_512() {
|
|||
let mut data = fixtures::TIME_DATA_512.to_vec();
|
|||
dft::real::forward(&mut data);
|
|||
let data = dft::real::unpack(&data);
|
|||
assert::close(as_f64(&data), &fixtures::FREQUENCY_DATA_512_REAL_UNPACKED[..], 1e-12);
|
|||
}
|
|||
|
|||
#[test]
|
|||
fn real_inverse_256() {
|
|||
let mut data = fixtures::FREQUENCY_DATA_256_REAL_PACKED.to_vec();
|
|||
dft::real::inverse(&mut data);
|
|||
assert::close(&data, &fixtures::TIME_DATA_256[..], 1e-14);
|
|||
}
|
|||
|
|||
#[test]
|
|||
fn real_inverse_512() {
|
|||
let mut data = fixtures::TIME_DATA_512.to_vec();
|
|||
dft::real::forward(&mut data);
|
|||
dft::real::inverse(&mut data);
|
|||
assert::close(&data, &fixtures::TIME_DATA_512[..], 1e-14);
|
|||
}
|
|||
|
|||
fn as_f64<'l>(slice: &'l [c64]) -> &'l [f64] {
|
|||
unsafe {
|
|||
std::slice::from_raw_parts(slice.as_ptr() as *const _, 2 * slice.len())
|
|||
}
|
|||
}
|
|||
|
|||
fn as_c64_mut<'l>(slice: &'l mut [f64]) -> &'l mut [c64] {
|
|||
unsafe {
|
|||
std::slice::from_raw_parts_mut(slice.as_mut_ptr() as *mut _, slice.len() / 2)
|
|||
}
|
|||
}
|
|||
|
|||
fn to_c64(slice: &[f64]) -> Vec<c64> {
|
|||
slice.iter().map(|&re| c64(re, 0.0)).collect()
|
|||
}
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue