pub trait FunctionsComplexType<T: NumKernel>:
FunctionsGeneralType<T>
+ PartialEq
+ MulComplexLeft<T> {
// Required methods
fn arg_(self) -> T::RealType;
fn new_(real_part: T::RealType, imag_part: T::RealType) -> Self;
fn real_(&self) -> T::RealType;
fn imag_(&self) -> T::RealType;
fn set_real_(&mut self, real_part: T::RealType);
fn set_imag_(&mut self, imag_part: T::RealType);
fn add_real_(&mut self, c: &T::RealType);
fn add_imag_(&mut self, c: &T::RealType);
fn multiply_real_(&mut self, c: &T::RealType);
fn multiply_imag_(&mut self, c: &T::RealType);
fn conj_(self) -> Self;
fn try_from_f64_(
real_part: f64,
imag_part: f64,
) -> Result<Self, TryFromf64Errors>;
}
Expand description
This trait represents the functions that can be applied on complex numbers.
Required Methods§
Sourcefn new_(real_part: T::RealType, imag_part: T::RealType) -> Self
fn new_(real_part: T::RealType, imag_part: T::RealType) -> Self
Creates a complex number of type T::ComplexType
from its real and imaginary parts.
Sourcefn add_real_(&mut self, c: &T::RealType)
fn add_real_(&mut self, c: &T::RealType)
Add the value of the the real coefficient c
to real part of self
.
Sourcefn add_imag_(&mut self, c: &T::RealType)
fn add_imag_(&mut self, c: &T::RealType)
Add the value of the the real coefficient c
to imaginary part of self
.
Sourcefn multiply_real_(&mut self, c: &T::RealType)
fn multiply_real_(&mut self, c: &T::RealType)
Multiply the value of the real part by the real coefficient c
.
Sourcefn multiply_imag_(&mut self, c: &T::RealType)
fn multiply_imag_(&mut self, c: &T::RealType)
Multiply the value of the imaginary part by the real coefficient c
.
Sourcefn try_from_f64_(
real_part: f64,
imag_part: f64,
) -> Result<Self, TryFromf64Errors>
fn try_from_f64_( real_part: f64, imag_part: f64, ) -> Result<Self, TryFromf64Errors>
Try to build a Self
from real and imaginary parts as f64
values.
The returned value is Ok
if the input real_part
and imag_part
are finite and can be exactly represented by T::RealType
,
otherwise the returned value is TryFromf64Errors
.
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 FunctionsComplexType<Native64> for Complex<f64>
Implement the FunctionsComplexType
trait for the Complex<f64>
type.
impl FunctionsComplexType<Native64> for Complex<f64>
Implement the FunctionsComplexType
trait for the Complex<f64>
type.
Source§fn new_(real_part: f64, imag_part: f64) -> Self
fn new_(real_part: f64, imag_part: f64) -> Self
Creates a complex number of type T::ComplexType
from its real and imaginary parts.
§Panics
In debug mode a panic!
will be emitted if the real_part
or the imag_part
is not finite.
Source§fn set_real_(&mut self, real_part: f64)
fn set_real_(&mut self, real_part: f64)
Set the value of the real part.
§Panics
In debug mode a panic!
will be emitted if real_part
is not finite.
Source§fn set_imag_(&mut self, imag_part: f64)
fn set_imag_(&mut self, imag_part: f64)
Set the value of the imaginary part.
§Panics
In debug mode a panic!
will be emitted if imaginary_part
is not finite.
Source§fn add_real_(&mut self, c: &f64)
fn add_real_(&mut self, c: &f64)
Add the value of the the real coefficient c
to real part of self
.
Source§fn add_imag_(&mut self, c: &f64)
fn add_imag_(&mut self, c: &f64)
Add the value of the the real coefficient c
to imaginary part of self
.
Source§fn multiply_real_(&mut self, c: &f64)
fn multiply_real_(&mut self, c: &f64)
Multiply the value of the real part by the real coefficient c
.
Source§fn multiply_imag_(&mut self, c: &f64)
fn multiply_imag_(&mut self, c: &f64)
Multiply the value of the imaginary part by the real coefficient c
.
Source§fn try_from_f64_(
real_part: f64,
imag_part: f64,
) -> Result<Self, TryFromf64Errors>
fn try_from_f64_( real_part: f64, imag_part: f64, ) -> Result<Self, TryFromf64Errors>
Try to build a Self
from real and imaginary parts as f64
values.
The returned value is Ok
if the input real_part
and imag_part
are finite and can be exactly represented by T::RealType
,
otherwise the returned value is TryFromf64Errors
.