#[repr(transparent)]pub struct Rcplx(c64);
Expand description
Rcplx is a wrapper for f64 in the context of an R’s complex vector.
Rcplx has a special NA value, obtained from R headers via R_NaReal.
Rcplx has the same footprint as R’s complex value allowing us to use it in zero copy slices.
Tuple Fields§
§0: c64
Implementations§
Trait Implementations§
Source§impl AddAssign<Complex<f64>> for &mut Rcplx
impl AddAssign<Complex<f64>> for &mut Rcplx
Source§fn add_assign(&mut self, other: c64)
fn add_assign(&mut self, other: c64)
Add two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl AddAssign<Complex<f64>> for Rcplx
impl AddAssign<Complex<f64>> for Rcplx
Source§fn add_assign(&mut self, other: c64)
fn add_assign(&mut self, other: c64)
Add two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl AddAssign<Rcplx> for &mut Rcplx
impl AddAssign<Rcplx> for &mut Rcplx
Source§fn add_assign(&mut self, other: Rcplx)
fn add_assign(&mut self, other: Rcplx)
Add two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl AddAssign<Rcplx> for Option<c64>
impl AddAssign<Rcplx> for Option<c64>
Source§fn add_assign(&mut self, other: Rcplx)
fn add_assign(&mut self, other: Rcplx)
Add two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl AddAssign for Rcplx
impl AddAssign for Rcplx
Source§fn add_assign(&mut self, other: Rcplx)
fn add_assign(&mut self, other: Rcplx)
Add two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl<'a> AsTypedSlice<'a, Rcplx> for Robjwhere
Self: 'a,
impl<'a> AsTypedSlice<'a, Rcplx> for Robjwhere
Self: 'a,
fn as_typed_slice(&self) -> Option<&'a [Rcplx]>
fn as_typed_slice_mut(&mut self) -> Option<&'a mut [Rcplx]>
Source§impl CanBeNA for Rcplx
impl CanBeNA for Rcplx
use extendr_api::prelude::*;
test! {
assert!((<Rcplx>::na()).is_na());
}
Source§impl Default for Rcplx
impl Default for Rcplx
use extendr_api::prelude::*;
test! {
assert_eq!(<Rcplx>::default(), <c64>::default());
}
Source§impl DivAssign<Complex<f64>> for &mut Rcplx
impl DivAssign<Complex<f64>> for &mut Rcplx
Source§fn div_assign(&mut self, other: c64)
fn div_assign(&mut self, other: c64)
Divide two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl DivAssign<Complex<f64>> for Rcplx
impl DivAssign<Complex<f64>> for Rcplx
Source§fn div_assign(&mut self, other: c64)
fn div_assign(&mut self, other: c64)
Divide two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl DivAssign<Rcplx> for &mut Rcplx
impl DivAssign<Rcplx> for &mut Rcplx
Source§fn div_assign(&mut self, other: Rcplx)
fn div_assign(&mut self, other: Rcplx)
Divide two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl DivAssign<Rcplx> for Option<c64>
impl DivAssign<Rcplx> for Option<c64>
Source§fn div_assign(&mut self, other: Rcplx)
fn div_assign(&mut self, other: Rcplx)
Divide two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl DivAssign for Rcplx
impl DivAssign for Rcplx
Source§fn div_assign(&mut self, other: Rcplx)
fn div_assign(&mut self, other: Rcplx)
Divide two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl FromIterator<Rcplx> for Complexes
impl FromIterator<Rcplx> for Complexes
Source§fn from_iter<T: IntoIterator<Item = Rcplx>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = Rcplx>>(iter: T) -> Self
A more generalised iterator collector for small vectors. Generates a non-ALTREP vector.
Source§impl MulAssign<Complex<f64>> for &mut Rcplx
impl MulAssign<Complex<f64>> for &mut Rcplx
Source§fn mul_assign(&mut self, other: c64)
fn mul_assign(&mut self, other: c64)
Multiply two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl MulAssign<Complex<f64>> for Rcplx
impl MulAssign<Complex<f64>> for Rcplx
Source§fn mul_assign(&mut self, other: c64)
fn mul_assign(&mut self, other: c64)
Multiply two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl MulAssign<Rcplx> for &mut Rcplx
impl MulAssign<Rcplx> for &mut Rcplx
Source§fn mul_assign(&mut self, other: Rcplx)
fn mul_assign(&mut self, other: Rcplx)
Multiply two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl MulAssign<Rcplx> for Option<c64>
impl MulAssign<Rcplx> for Option<c64>
Source§fn mul_assign(&mut self, other: Rcplx)
fn mul_assign(&mut self, other: Rcplx)
Multiply two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl MulAssign for Rcplx
impl MulAssign for Rcplx
Source§fn mul_assign(&mut self, other: Rcplx)
fn mul_assign(&mut self, other: Rcplx)
Multiply two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl PartialEq<Complex<f64>> for Rcplx
impl PartialEq<Complex<f64>> for Rcplx
use extendr_api::prelude::*;
test! {
assert!(<Rcplx>::default().eq(&<c64>::default()));
}
Source§impl PartialEq<Rcplx> for c64
impl PartialEq<Rcplx> for c64
use extendr_api::prelude::*;
test! {
assert!(<c64>::default().eq(&<Rcplx>::default()));
}
Source§impl PartialEq for Rcplx
impl PartialEq for Rcplx
use extendr_api::prelude::*;
test! {
assert!(<Rcplx>::default().eq(&<Rcplx>::default()));
assert!(!<Rcplx>::na().eq(&<Rcplx>::na()));
}
Source§impl SubAssign<Complex<f64>> for &mut Rcplx
impl SubAssign<Complex<f64>> for &mut Rcplx
Source§fn sub_assign(&mut self, other: c64)
fn sub_assign(&mut self, other: c64)
Subtract two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl SubAssign<Complex<f64>> for Rcplx
impl SubAssign<Complex<f64>> for Rcplx
Source§fn sub_assign(&mut self, other: c64)
fn sub_assign(&mut self, other: c64)
Subtract two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl SubAssign<Rcplx> for &mut Rcplx
impl SubAssign<Rcplx> for &mut Rcplx
Source§fn sub_assign(&mut self, other: Rcplx)
fn sub_assign(&mut self, other: Rcplx)
Subtract two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl SubAssign<Rcplx> for Option<c64>
impl SubAssign<Rcplx> for Option<c64>
Source§fn sub_assign(&mut self, other: Rcplx)
fn sub_assign(&mut self, other: Rcplx)
Subtract two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl SubAssign for Rcplx
impl SubAssign for Rcplx
Source§fn sub_assign(&mut self, other: Rcplx)
fn sub_assign(&mut self, other: Rcplx)
Subtract two Rcplx values or an option of c64, modifying the left-hand side in place. Overflows to NA.
Source§impl ToVectorValue for &Rcplx
impl ToVectorValue for &Rcplx
fn sexptype() -> SEXPTYPE
fn to_complex(&self) -> Rcomplex
fn to_real(&self) -> f64where
Self: Sized,
fn to_integer(&self) -> i32where
Self: Sized,
fn to_logical(&self) -> i32where
Self: Sized,
fn to_raw(&self) -> u8where
Self: Sized,
fn to_sexp(&self) -> SEXPwhere
Self: Sized,
Source§impl ToVectorValue for Rcplx
impl ToVectorValue for Rcplx
fn sexptype() -> SEXPTYPE
fn to_complex(&self) -> Rcomplex
fn to_real(&self) -> f64where
Self: Sized,
fn to_integer(&self) -> i32where
Self: Sized,
fn to_logical(&self) -> i32where
Self: Sized,
fn to_raw(&self) -> u8where
Self: Sized,
fn to_sexp(&self) -> SEXPwhere
Self: Sized,
impl Copy for Rcplx
Auto Trait Implementations§
impl Freeze for Rcplx
impl RefUnwindSafe for Rcplx
impl Send for Rcplx
impl Sync for Rcplx
impl Unpin for Rcplx
impl UnwindSafe for Rcplx
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more