pub struct ComplexAlgebraic {
pub re: Algebraic,
pub im: Algebraic,
}Expand description
re + im·i with real algebraic parts.
Fields§
§re: Algebraic§im: AlgebraicImplementations§
Source§impl ComplexAlgebraic
impl ComplexAlgebraic
pub fn new(re: Algebraic, im: Algebraic) -> ComplexAlgebraic
pub fn real(re: Algebraic) -> ComplexAlgebraic
pub fn imag(im: Algebraic) -> ComplexAlgebraic
pub fn from_rational(r: Rational) -> ComplexAlgebraic
pub fn from_i64(n: i64) -> ComplexAlgebraic
pub fn zero() -> ComplexAlgebraic
pub fn one() -> ComplexAlgebraic
pub fn is_zero(&self) -> bool
pub fn is_real(&self) -> bool
pub fn add(&self, o: &ComplexAlgebraic) -> ComplexAlgebraic
pub fn sub(&self, o: &ComplexAlgebraic) -> ComplexAlgebraic
pub fn neg(&self) -> ComplexAlgebraic
pub fn conj(&self) -> ComplexAlgebraic
pub fn mul(&self, o: &ComplexAlgebraic) -> ComplexAlgebraic
Sourcepub fn scale(&self, r: &Rational) -> ComplexAlgebraic
pub fn scale(&self, r: &Rational) -> ComplexAlgebraic
self·r for a rational r.
Sourcepub fn recip(&self) -> Option<ComplexAlgebraic>
pub fn recip(&self) -> Option<ComplexAlgebraic>
None at zero.
pub fn div(&self, o: &ComplexAlgebraic) -> Option<ComplexAlgebraic>
pub fn pow(&self, e: u32) -> ComplexAlgebraic
Sourcepub fn eval(p: &Poly, z: &ComplexAlgebraic) -> ComplexAlgebraic
pub fn eval(p: &Poly, z: &ComplexAlgebraic) -> ComplexAlgebraic
p(self) by Horner’s rule.
Trait Implementations§
Source§impl Clone for ComplexAlgebraic
impl Clone for ComplexAlgebraic
Source§fn clone(&self) -> ComplexAlgebraic
fn clone(&self) -> ComplexAlgebraic
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComplexAlgebraic
impl Debug for ComplexAlgebraic
Source§impl Display for ComplexAlgebraic
impl Display for ComplexAlgebraic
Source§impl Hash for ComplexAlgebraic
impl Hash for ComplexAlgebraic
Source§impl Ord for ComplexAlgebraic
impl Ord for ComplexAlgebraic
Source§fn cmp(&self, other: &ComplexAlgebraic) -> Ordering
fn cmp(&self, other: &ComplexAlgebraic) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ComplexAlgebraic
impl PartialEq for ComplexAlgebraic
Source§impl PartialOrd for ComplexAlgebraic
impl PartialOrd for ComplexAlgebraic
impl Eq for ComplexAlgebraic
impl StructuralPartialEq for ComplexAlgebraic
Auto Trait Implementations§
impl Freeze for ComplexAlgebraic
impl RefUnwindSafe for ComplexAlgebraic
impl Send for ComplexAlgebraic
impl Sync for ComplexAlgebraic
impl Unpin for ComplexAlgebraic
impl UnsafeUnpin for ComplexAlgebraic
impl UnwindSafe for ComplexAlgebraic
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
Mutably borrows from an owned value. Read more