pub struct PiecewiseLinearConvexFn { /* private fields */ }
Expand description
Represents a maximum (upper envelope) of a collection of linear functions of one variable, evaluated using an online version of the convex hull trick. It combines the offline algorithm with square root decomposition, resulting in an asymptotically suboptimal but simple algorithm with good amortized performance: N inserts interleaved with Q queries yields O(N sqrt Q + Q log N) time complexity in general, or O((N + Q) log N) if all queries come after all inserts.
Implementations§
Trait Implementations§
Source§impl Default for PiecewiseLinearConvexFn
impl Default for PiecewiseLinearConvexFn
Source§fn default() -> PiecewiseLinearConvexFn
fn default() -> PiecewiseLinearConvexFn
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PiecewiseLinearConvexFn
impl RefUnwindSafe for PiecewiseLinearConvexFn
impl Send for PiecewiseLinearConvexFn
impl Sync for PiecewiseLinearConvexFn
impl Unpin for PiecewiseLinearConvexFn
impl UnwindSafe for PiecewiseLinearConvexFn
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