1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Copyright © 2021-2025 Rouven Spreckels <rs@qu1x.dev>
//
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of
// the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
//! Lane-Associated Vector (LAV): [Portable SIMD] vector trait as GAT of SIMD lane trait.
//!
//! **NOTE**: This crate requires nightly Rust.
//!
//! This [`example`] uses SIMD generically over floating-point types while hiding it from the user.
//!
//! # Features
//!
//! * SIMD lane trait [`Real`] abstracting over [`f32`] and [`f64`].
//! * SIMD vector trait [`SimdReal<Real, N>`] abstracting over [`Simd<f32, N>`] and
//! [`Simd<f64, N>`].
//! * Generic associated type (GAT) [`Real::Simd<N>`] as part of SIMD lane trait [`Real`]
//! implementing SIMD vector trait [`SimdReal<Self, N>`] for itself as lane type where the
//! GAT is generic over the number of SIMD vector lanes `N`.
//! * [AoS/SoA/AoSoA] via [`Real::as_simd`]/[`Real::as_simd_mut`] abstracting over
//! [`as_simd`]/[`as_simd_mut`] of [`f32`] and [`f64`] slices.
//! * Lanewise approximate equality test wrt to epsilon and [ULP] SIMD vectors.
//! * [`ApproxEq`] trait complementing [`PartialEq`].
//!
//! # Optional Features
//!
//! Following features are disabled by default unless their feature gate is enabled:
//!
//! * [`target-features`]: Provides native number of SIMD vector lanes
//! `Real::NATIVE_LANE_COUNT` for the current build target.
//! * [`libm`]: Enables [`no_std`] without loss of functionality.
//!
//! [Portable SIMD]: `core::simd`
//! [`Simd<f32, N>`]: `core::simd::Simd`
//! [`Simd<f64, N>`]: `core::simd::Simd`
//! [`Real::Simd<N>`]: `Real::Simd`
//! [`as_simd`]: `slice::as_simd`
//! [`as_simd_mut`]: `slice::as_simd_mut`
//! [`target-features`]: https://docs.rs/target-features
//! [`libm`]: https://docs.rs/libm
//! [`no_std`]: https://docs.rust-embedded.org/book/intro/no-std.html
//! [AoS/SoA/AoSoA]: https://en.wikipedia.org/wiki/AoS_and_SoA
//! [ULP]: https://en.wikipedia.org/wiki/Unit_in_the_last_place
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
/// Selects lanes from two vectors by mask vector.
/// Tests for approximate equality.