pub enum UnaryOp {
Show 20 variants
Neg,
Sqrt,
Log,
Exp,
Abs,
Sin,
Cos,
Log10,
Tan,
Atan,
Acos,
Sinh,
Cosh,
Tanh,
Asin,
Acosh,
Asinh,
Atanh,
Erf,
XLogX,
}Variants§
Neg
Sqrt
Log
Exp
Abs
Sin
Cos
Log10
Tan
Atan
Acos
Sinh
Cosh
Tanh
Asin
Acosh
Asinh
Atanh
Erf
Gauss error function. No .nl opcode maps here — AMPL has no erf,
so the parser never emits it — but the in-memory builder (issue #469)
does, which is the whole point: a frontend that constructs an Expr
directly is not limited to what .nl can spell.
XLogX
a·ln(a) — GAMS entropy. Like UnaryOp::Erf, no .nl opcode maps
here; it is reachable only from an in-memory Expr.
Fused rather than lowered to Mul(a, Log(a)) because the chain rule
cannot produce its second derivative. (a·ln a)'' = 1/a is finite
wherever a > 0 — at a = 1e-299 it is 1e299 — but every
decomposition routes through ln''(a) = -1/a² = -1e598, which exceeds
f64::MAX. A composite that is in range, built from a factor that is
not, is unreachable by any chain rule however carefully written, so the
fusion is a correctness requirement rather than an optimization.
Trait Implementations§
impl Copy for UnaryOp
impl Eq for UnaryOp
impl StructuralPartialEq for UnaryOp
Auto Trait Implementations§
impl Freeze for UnaryOp
impl RefUnwindSafe for UnaryOp
impl Send for UnaryOp
impl Sync for UnaryOp
impl Unpin for UnaryOp
impl UnsafeUnpin for UnaryOp
impl UnwindSafe for UnaryOp
Blanket Implementations§
impl<T> Boilerplate for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more