pub struct DemandCurve<Idx, A: IntoIterator<Item = (Idx, f64)>, B: IntoIterator<Item = Point>> {
pub domain: (f64, f64),
pub group: A,
pub points: B,
}Expand description
A demand curve represents utility via a piecewise linear function
Fields§
§domain: (f64, f64)Constrains the otherwise-infinite domain of the function to q ∈ 𝒟
group: AThe sparse vector that combines in an inner product with the portfolio variables
points: BThe points that define a piecewise-linear curve, extrapolated to q = ±∞ via the nearest price
Trait Implementations§
Auto Trait Implementations§
impl<Idx, A, B> Freeze for DemandCurve<Idx, A, B>
impl<Idx, A, B> RefUnwindSafe for DemandCurve<Idx, A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<Idx, A, B> Send for DemandCurve<Idx, A, B>
impl<Idx, A, B> Sync for DemandCurve<Idx, A, B>
impl<Idx, A, B> Unpin for DemandCurve<Idx, A, B>
impl<Idx, A, B> UnwindSafe for DemandCurve<Idx, A, B>where
A: UnwindSafe,
B: UnwindSafe,
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
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>
Converts
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>
Converts
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