pub trait ComplexScalarGetParts: ComplexScalarConstructors {
// Required methods
fn real_part(&self) -> Self::RealType;
fn imag_part(&self) -> Self::RealType;
fn raw_real_part(&self) -> &<Self::RealType as RealScalar>::RawReal;
fn raw_imag_part(&self) -> &<Self::RealType as RealScalar>::RawReal;
// Provided methods
fn is_pure_real(&self) -> bool { ... }
fn is_pure_imaginary(&self) -> bool { ... }
}
Expand description
Trait for accessing the real and imaginary components of a complex scalar.
Required Methods§
Sourcefn raw_real_part(&self) -> &<Self::RealType as RealScalar>::RawReal
fn raw_real_part(&self) -> &<Self::RealType as RealScalar>::RawReal
Returns a reference to the raw real part of the complex number.
Sourcefn raw_imag_part(&self) -> &<Self::RealType as RealScalar>::RawReal
fn raw_imag_part(&self) -> &<Self::RealType as RealScalar>::RawReal
Returns a reference to the raw imaginary part of the complex number.
Provided Methods§
Sourcefn is_pure_real(&self) -> bool
fn is_pure_real(&self) -> bool
Returns true
if the complex number is purely real (i.e., has no imaginary part).
Note: the complex number zero is considered purely real.
Sourcefn is_pure_imaginary(&self) -> bool
fn is_pure_imaginary(&self) -> bool
Returns true
if the complex number is purely imaginary (i.e., has zero real part and non-zero imaginary part).
Note: the complex number zero is considered purely real.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl ComplexScalarGetParts for Complex<f64>
Implement the ComplexScalarGetParts
trait for the Complex<f64>
type.
impl ComplexScalarGetParts for Complex<f64>
Implement the ComplexScalarGetParts
trait for the Complex<f64>
type.
Source§fn raw_real_part(&self) -> &f64
fn raw_real_part(&self) -> &f64
Returns a reference to the raw real part of the complex number.
Source§fn raw_imag_part(&self) -> &f64
fn raw_imag_part(&self) -> &f64
Returns a reference to the raw imaginary part of the complex number.
Implementors§
impl<K: NumKernel> ComplexScalarGetParts for ComplexValidated<K>
Implement the ComplexScalarGetParts
trait for the ComplexValidated
type.