pub struct ComplexNumbersLib;Expand description
The library that installs the numbers/complex domain: its literal class
and shapes, the ComplexValue class, the complex ops, and the incoming
promotion rules from f64, i64, and rational.
§Examples
use std::sync::Arc;
use sim_kernel::{Cx, DefaultFactory, NoopEvalPolicy};
use sim_lib_numbers_complex::{ComplexNumbersLib, number_domain, complex_value};
let mut cx = Cx::new(Arc::new(NoopEvalPolicy), Arc::new(DefaultFactory));
cx.load_lib(&ComplexNumbersLib::new()).unwrap();
let value = complex_value(&mut cx, 3.0, -4.0).unwrap();
let number = cx.number_value_ref(value).unwrap().unwrap();
assert_eq!(number.domain, number_domain());Implementations§
Trait Implementations§
Source§impl Default for ComplexNumbersLib
impl Default for ComplexNumbersLib
Auto Trait Implementations§
impl Freeze for ComplexNumbersLib
impl RefUnwindSafe for ComplexNumbersLib
impl Send for ComplexNumbersLib
impl Sync for ComplexNumbersLib
impl Unpin for ComplexNumbersLib
impl UnsafeUnpin for ComplexNumbersLib
impl UnwindSafe for ComplexNumbersLib
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