pub struct Dual<const N: usize> {
pub v: Scalar,
pub d: [Scalar; N],
}Expand description
A value together with its gradient with respect to up to N seeded
variables — as many as the residual it is computed for depends on.
Fields§
§v: Scalar§d: [Scalar; N]Implementations§
Trait Implementations§
impl<const N: usize> Copy for Dual<N>
Source§impl<const N: usize> Number for Dual<N>
impl<const N: usize> Number for Dual<N>
Source§fn acos(self) -> GeopResult<Self>
fn acos(self) -> GeopResult<Self>
d acos(x) = -1 / sqrt(1 - x^2), which fails where it is infinite,
at x = ±1.
Source§fn is_sharp(self) -> bool
fn is_sharp(self) -> bool
A single, exactly known point: a sharp value that does not vary with any variable. A value that is sharp but moves with a variable is no point — taking it for one drops the gradient.
Source§fn union(self, other: Self) -> Self
fn union(self, other: Self) -> Self
The union of the values, with self‘s derivatives: the width a
series’ remainder adds (see crate::primitives::Pose::exp).
const ZERO: Self
const ONE: Self
const TWO: Self
const PI: Self
fn from_i64(v: i64) -> Self
fn from_f64(v: f64) -> Self
Source§fn from_scalar(s: Scalar) -> Self
fn from_scalar(s: Scalar) -> Self
The scalar
s as a constant: depending on no variable.fn from_ratio(num: i64, den: i64) -> GeopResult<Self>
fn add(self, o: Self) -> Self
fn sub(self, o: Self) -> Self
fn mul(self, o: Self) -> Self
fn neg(self) -> Self
Source§fn div(self, o: Self) -> GeopResult<Self>
fn div(self, o: Self) -> GeopResult<Self>
Fails where the divisor could be zero.
fn abs(self) -> Self
fn sqrt(self) -> GeopResult<Self>
fn sin(self) -> Self
fn cos(self) -> Self
fn could_be_equal(self, other: Self) -> bool
fn definitely_not_equal(self, other: Self) -> bool
fn could_be_greater(self, other: Self) -> bool
fn definitely_greater(self, other: Self) -> bool
fn could_be_less(self, other: Self) -> bool
fn definitely_less(self, other: Self) -> bool
Source§fn is_exactly(self, other: Self) -> bool
fn is_exactly(self, other: Self) -> bool
Whether its value is exactly
other’s, as a set (see
Scalar::is_exactly).Source§fn degrees_to_radians(self) -> GeopResult<Self>
fn degrees_to_radians(self) -> GeopResult<Self>
The angle
self, given in degrees, in radians.Auto Trait Implementations§
impl<const N: usize> Freeze for Dual<N>
impl<const N: usize> RefUnwindSafe for Dual<N>
impl<const N: usize> Send for Dual<N>
impl<const N: usize> Sync for Dual<N>
impl<const N: usize> Unpin for Dual<N>
impl<const N: usize> UnsafeUnpin for Dual<N>
impl<const N: usize> UnwindSafe for Dual<N>
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