pub trait Builder: Sized {
type F: Clone;
type B: Clone;
Show 14 methods
// Required methods
fn is_f64(&self) -> bool;
fn constant(&mut self, v: f64) -> Self::F;
fn unary(&mut self, op: UnaryOp, x: &Self::F) -> Self::F;
fn binary(&mut self, op: BinaryOp, x: &Self::F, y: &Self::F) -> Self::F;
fn compare(&mut self, op: CompareOp, x: &Self::F, y: &Self::F) -> Self::B;
fn logical(&mut self, op: BinaryOp, x: &Self::B, y: &Self::B) -> Self::B;
fn not(&mut self, x: &Self::B) -> Self::B;
fn select(
&mut self,
pred: &Self::B,
on_true: &Self::F,
on_false: &Self::F,
) -> Self::F;
fn mask(&mut self, v: bool) -> Self::B;
fn is_finite(&mut self, x: &Self::F) -> Self::B;
fn any(&mut self, x: &Self::B) -> Self::B;
fn while_loop(
&mut self,
init: Carry<Self>,
cond: &mut dyn FnMut(&mut Self, &Carry<Self>) -> Self::B,
body: &mut dyn FnMut(&mut Self, &Carry<Self>) -> Carry<Self>,
) -> Carry<Self>;
// Provided methods
fn lgamma(&mut self, x: &Self::F) -> Self::F { ... }
fn digamma(&mut self, x: &Self::F) -> Self::F { ... }
}Expand description
The operations the special functions are written with.
Floats (Builder::F) have one type, f32 or f64 (16-bit floats are
computed in f32), and every value has the same shape.
Required Associated Types§
Required Methods§
Sourcefn logical(&mut self, op: BinaryOp, x: &Self::B, y: &Self::B) -> Self::B
fn logical(&mut self, op: BinaryOp, x: &Self::B, y: &Self::B) -> Self::B
A logical operation on masks (And, Or).
Sourcefn select(
&mut self,
pred: &Self::B,
on_true: &Self::F,
on_false: &Self::F,
) -> Self::F
fn select( &mut self, pred: &Self::B, on_true: &Self::F, on_false: &Self::F, ) -> Self::F
pred ? on_true : on_false, element by element.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".