pub struct Submission<PortfolioId, ProductId> {
pub portfolios: IndexMap<PortfolioId, IndexMap<ProductId, f64, FxBuildHasher>, FxBuildHasher>,
pub demand_curves: Vec<(IndexMap<PortfolioId, f64, FxBuildHasher>, Vec<Segment>)>,
}Expand description
The fundamental input to a Solver implementation, containing an
independent collection of portfolios and demand curves.
Fields§
§portfolios: IndexMap<PortfolioId, IndexMap<ProductId, f64, FxBuildHasher>, FxBuildHasher>The portfolios that are defined by the submission.
demand_curves: Vec<(IndexMap<PortfolioId, f64, FxBuildHasher>, Vec<Segment>)>The demand curves in the submission
Implementations§
Source§impl<PortfolioId: Clone + Hash + Eq, ProductId: Hash + Eq + Ord> Submission<PortfolioId, ProductId>
impl<PortfolioId: Clone + Hash + Eq, ProductId: Hash + Eq + Ord> Submission<PortfolioId, ProductId>
Sourcepub fn new<T, U, V>(
portfolios: impl IntoIterator<Item = (PortfolioId, T)>,
curves: impl IntoIterator<Item = DemandCurve<PortfolioId, U, V>>,
) -> Result<Submission<PortfolioId, ProductId>, SubmissionError>where
T: IntoIterator<Item = (ProductId, f64)>,
T::IntoIter: ExactSizeIterator,
U: IntoIterator<Item = (PortfolioId, f64)>,
V: IntoIterator<Item = Point>,
pub fn new<T, U, V>(
portfolios: impl IntoIterator<Item = (PortfolioId, T)>,
curves: impl IntoIterator<Item = DemandCurve<PortfolioId, U, V>>,
) -> Result<Submission<PortfolioId, ProductId>, SubmissionError>where
T: IntoIterator<Item = (ProductId, f64)>,
T::IntoIter: ExactSizeIterator,
U: IntoIterator<Item = (PortfolioId, f64)>,
V: IntoIterator<Item = Point>,
Construct a canonicalized submission from the inputs
Auto Trait Implementations§
impl<PortfolioId, ProductId> Freeze for Submission<PortfolioId, ProductId>
impl<PortfolioId, ProductId> RefUnwindSafe for Submission<PortfolioId, ProductId>where
PortfolioId: RefUnwindSafe,
ProductId: RefUnwindSafe,
impl<PortfolioId, ProductId> Send for Submission<PortfolioId, ProductId>
impl<PortfolioId, ProductId> Sync for Submission<PortfolioId, ProductId>
impl<PortfolioId, ProductId> Unpin for Submission<PortfolioId, ProductId>
impl<PortfolioId, ProductId> UnwindSafe for Submission<PortfolioId, ProductId>where
PortfolioId: UnwindSafe,
ProductId: 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> 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