pub struct ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,{ /* private fields */ }Expand description
Two complex numbers: [re0, im0, re1, im1] in one 4‑lane vector.
Implementations§
Source§impl<T, V> ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
impl<T, V> ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
Sourcepub fn from_raw(data: V) -> ComplexVector<T, V>
pub fn from_raw(data: V) -> ComplexVector<T, V>
Wrap a raw Vector<T,4> in [re0, im0, re1, im1] interleaved layout.
Sourcepub fn splat_pair(re: T, im: T) -> ComplexVector<T, V>
pub fn splat_pair(re: T, im: T) -> ComplexVector<T, V>
Duplicate a single (re, im) pair into both lane pairs.
Sourcepub fn from_pair(c: (T, T)) -> ComplexVector<T, V>
pub fn from_pair(c: (T, T)) -> ComplexVector<T, V>
Create from a single (re, im) pair, duplicated to both lane pairs.
Sourcepub fn from_two(c0: (T, T), c1: (T, T)) -> ComplexVector<T, V>
pub fn from_two(c0: (T, T), c1: (T, T)) -> ComplexVector<T, V>
Create from two possibly-different complex pairs. Pairs go to lanes (0,1) and (2,3) respectively.
Sourcepub fn conj(&self) -> ComplexVector<T, V>
pub fn conj(&self) -> ComplexVector<T, V>
Complex conjugate.
Sourcepub fn cmul(&self, other: &ComplexVector<T, V>) -> ComplexVector<T, V>
pub fn cmul(&self, other: &ComplexVector<T, V>) -> ComplexVector<T, V>
Complex multiplication: self * other (element-wise).
Sourcepub fn cadd(&self, other: &ComplexVector<T, V>) -> ComplexVector<T, V>
pub fn cadd(&self, other: &ComplexVector<T, V>) -> ComplexVector<T, V>
Complex addition: self + other.
Sourcepub fn csub(&self, other: &ComplexVector<T, V>) -> ComplexVector<T, V>
pub fn csub(&self, other: &ComplexVector<T, V>) -> ComplexVector<T, V>
Complex subtraction: self - other.
Sourcepub fn norm_sqr(&self) -> (T, T)
pub fn norm_sqr(&self) -> (T, T)
Magnitude squared per complex element: re² + im² (lane‑pair summed).
Sourcepub fn scale_real(&self, scalar: T) -> ComplexVector<T, V>
pub fn scale_real(&self, scalar: T) -> ComplexVector<T, V>
Multiply both real and imaginary parts by a real scalar.
Sourcepub fn to_complex0(&self) -> (T, T)
pub fn to_complex0(&self) -> (T, T)
Extract the first complex value as (re, im).
Sourcepub fn to_complex1(&self) -> (T, T)
pub fn to_complex1(&self) -> (T, T)
Extract the second complex value as (re, im).
Sourcepub fn map_complex<F>(&self, f: F) -> ComplexVector<T, V>
pub fn map_complex<F>(&self, f: F) -> ComplexVector<T, V>
Apply a closure to each of the two 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 two complex elements as (re, im) pairs.
Trait Implementations§
Source§impl<T, V> Add for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
impl<T, V> Add for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
Source§type Output = ComplexVector<T, V>
type Output = ComplexVector<T, V>
+ operator.Source§fn add(self, rhs: ComplexVector<T, V>) -> ComplexVector<T, V>
fn add(self, rhs: ComplexVector<T, V>) -> ComplexVector<T, V>
+ operation. Read moreSource§impl<T, V> AddAssign for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
impl<T, V> AddAssign for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
Source§fn add_assign(&mut self, rhs: ComplexVector<T, V>)
fn add_assign(&mut self, rhs: ComplexVector<T, V>)
+= operation. Read moreSource§impl<T, V> Clone for ComplexVector<T, V>
impl<T, V> Clone for ComplexVector<T, V>
Source§fn clone(&self) -> ComplexVector<T, V>
fn clone(&self) -> ComplexVector<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, V> Copy for ComplexVector<T, V>
Source§impl<T, V> Debug for ComplexVector<T, V>
impl<T, V> Debug for ComplexVector<T, V>
Source§impl<T, V> Div for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
Complex division: (a+bi)/(c+di) = (ac+bd)/(c²+d²) + i*(bc-ad)/(c²+d²).
impl<T, V> Div for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
Complex division: (a+bi)/(c+di) = (ac+bd)/(c²+d²) + i*(bc-ad)/(c²+d²).
Source§type Output = ComplexVector<T, V>
type Output = ComplexVector<T, V>
/ operator.Source§fn div(self, rhs: ComplexVector<T, V>) -> ComplexVector<T, V>
fn div(self, rhs: ComplexVector<T, V>) -> ComplexVector<T, V>
/ operation. Read moreSource§impl<T, V> DivAssign for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
impl<T, V> DivAssign for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
Source§fn div_assign(&mut self, rhs: ComplexVector<T, V>)
fn div_assign(&mut self, rhs: ComplexVector<T, V>)
/= operation. Read moreSource§impl<T, V> Mul for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
impl<T, V> Mul for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
Source§type Output = ComplexVector<T, V>
type Output = ComplexVector<T, V>
* operator.Source§fn mul(self, rhs: ComplexVector<T, V>) -> ComplexVector<T, V>
fn mul(self, rhs: ComplexVector<T, V>) -> ComplexVector<T, V>
* operation. Read moreSource§impl<T, V> Mul<T> for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
cv * t — scale both complex elements by a real scalar.
impl<T, V> Mul<T> for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
cv * t — scale both complex elements by a real scalar.
Source§type Output = ComplexVector<T, V>
type Output = ComplexVector<T, V>
* operator.Source§fn mul(self, rhs: T) -> ComplexVector<T, V>
fn mul(self, rhs: T) -> ComplexVector<T, V>
* operation. Read moreSource§impl<T, V> MulAssign for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
impl<T, V> MulAssign for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
Source§fn mul_assign(&mut self, rhs: ComplexVector<T, V>)
fn mul_assign(&mut self, rhs: ComplexVector<T, V>)
*= operation. Read moreSource§impl<T, V> Neg for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
impl<T, V> Neg for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
Source§type Output = ComplexVector<T, V>
type Output = ComplexVector<T, V>
- operator.Source§fn neg(self) -> ComplexVector<T, V>
fn neg(self) -> ComplexVector<T, V>
- operation. Read moreSource§impl<T, V> PartialEq for ComplexVector<T, V>
impl<T, V> PartialEq for ComplexVector<T, V>
impl<T, V> StructuralPartialEq for ComplexVector<T, V>
Source§impl<T, V> Sub for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
impl<T, V> Sub for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
Source§type Output = ComplexVector<T, V>
type Output = ComplexVector<T, V>
- operator.Source§fn sub(self, rhs: ComplexVector<T, V>) -> ComplexVector<T, V>
fn sub(self, rhs: ComplexVector<T, V>) -> ComplexVector<T, V>
- operation. Read moreSource§impl<T, V> SubAssign for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
impl<T, V> SubAssign for ComplexVector<T, V>where
T: Transcendental,
V: Vector<T, 4>,
Source§fn sub_assign(&mut self, rhs: ComplexVector<T, V>)
fn sub_assign(&mut self, rhs: ComplexVector<T, V>)
-= operation. Read more