pub struct ComplexSoa<T: Transcendental, V: Vector<T, 4>> {
pub re: V,
pub im: V,
/* private fields */
}Expand description
Four complex numbers, separate re/im arrays. For SIMD‑heavy operations.
Fields§
§re: VReal parts of four complex numbers (one per lane).
im: VImaginary parts of four complex numbers (one per lane).
Implementations§
Source§impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> ComplexSoa<T, V>
impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> ComplexSoa<T, V>
Sourcepub fn load(re_slice: &[T], im_slice: &[T]) -> Self
pub fn load(re_slice: &[T], im_slice: &[T]) -> Self
Load four complex numbers from separate re/im slices.
Sourcepub fn from_pairs(p: [(T, T); 4]) -> Self
pub fn from_pairs(p: [(T, T); 4]) -> Self
Create from four (re, im) pairs.
Sourcepub fn store(&self, re_slice: &mut [T], im_slice: &mut [T])
pub fn store(&self, re_slice: &mut [T], im_slice: &mut [T])
Store back to separate re/im slices.
Sourcepub fn extract_complex(&self, i: usize) -> (T, T)
pub fn extract_complex(&self, i: usize) -> (T, T)
Extract a single complex value at lane i: returns (re, im).
Sourcepub fn to_complexes(&self) -> [(T, T); 4]
pub fn to_complexes(&self) -> [(T, T); 4]
Extract all four complex values as an array of (re, im) pairs.
Sourcepub fn map_complex<F>(&self, f: F) -> Self
pub fn map_complex<F>(&self, f: F) -> Self
Apply a closure to each of the four complex elements.
Sourcepub fn iter_complex(&self) -> impl Iterator<Item = (T, T)>
pub fn iter_complex(&self) -> impl Iterator<Item = (T, T)>
Iterate over the four complex elements as (re, im) pairs.
Sourcepub fn cmul(&self, other: &Self) -> Self
pub fn cmul(&self, other: &Self) -> Self
Complex multiplication: self * other on four numbers at once.
Sourcepub fn all_norm_sqr_lt(&self, threshold_sq: T) -> bool
pub fn all_norm_sqr_lt(&self, threshold_sq: T) -> bool
True if all four norms are below threshold_sq.
Sourcepub fn scale_real(&self, scalar: V) -> Self
pub fn scale_real(&self, scalar: V) -> Self
Multiply both re and im by a real scalar vector (per-lane).
Trait Implementations§
Source§impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> Add for ComplexSoa<T, V>
impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> Add for ComplexSoa<T, V>
Source§impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> AddAssign for ComplexSoa<T, V>
impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> AddAssign for ComplexSoa<T, V>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl<T: Clone + Transcendental, V: Clone + Vector<T, 4>> Clone for ComplexSoa<T, V>
impl<T: Clone + Transcendental, V: Clone + Vector<T, 4>> Clone for ComplexSoa<T, V>
Source§fn clone(&self) -> ComplexSoa<T, V>
fn clone(&self) -> ComplexSoa<T, V>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<T: Copy + Transcendental, V: Copy + Vector<T, 4>> Copy for ComplexSoa<T, V>
Source§impl<T: Debug + Transcendental, V: Debug + Vector<T, 4>> Debug for ComplexSoa<T, V>
impl<T: Debug + Transcendental, V: Debug + Vector<T, 4>> Debug for ComplexSoa<T, V>
Source§impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> Div for ComplexSoa<T, V>
Complex division (four at once): (re+im·i)/(rre+rim·i) per lane.
impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> Div for ComplexSoa<T, V>
Complex division (four at once): (re+im·i)/(rre+rim·i) per lane.
denom = rre² + rim², then re_out = (re·rre + im·rim)/denom,
im_out = (im·rre − re·rim)/denom.
Source§impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> DivAssign for ComplexSoa<T, V>
impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> DivAssign for ComplexSoa<T, V>
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/= operation. Read moreSource§impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> Mul for ComplexSoa<T, V>
impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> Mul for ComplexSoa<T, V>
Source§impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> Mul<V> for ComplexSoa<T, V>
csoa * sv — scale all four complex numbers by a real vector (per‑lane).
impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> Mul<V> for ComplexSoa<T, V>
csoa * sv — scale all four complex numbers by a real vector (per‑lane).
Source§impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> MulAssign for ComplexSoa<T, V>
impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> MulAssign for ComplexSoa<T, V>
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*= operation. Read moreSource§impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> Neg for ComplexSoa<T, V>
impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> Neg for ComplexSoa<T, V>
Source§impl<T: PartialEq + Transcendental, V: PartialEq + Vector<T, 4>> PartialEq for ComplexSoa<T, V>
impl<T: PartialEq + Transcendental, V: PartialEq + Vector<T, 4>> PartialEq for ComplexSoa<T, V>
impl<T: PartialEq + Transcendental, V: PartialEq + Vector<T, 4>> StructuralPartialEq for ComplexSoa<T, V>
Source§impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> Sub for ComplexSoa<T, V>
impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> Sub for ComplexSoa<T, V>
Source§impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> SubAssign for ComplexSoa<T, V>
impl<T: Transcendental, V: Vector<T, 4> + VectorMask<T, 4>> SubAssign for ComplexSoa<T, V>
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read more