pub struct ClarabelSolver<DemandId, PortfolioId, ProductId>(/* private fields */);Expand description
A solver implementation that uses the Clarabel interior point method for quadratic programming to solve the market clearing problem.
This solver is generally more accurate but can be slower than ADMM-based solvers for large problems. It’s a good choice when high precision is needed.
Implementations§
Source§impl<A, B, C> ClarabelSolver<A, B, C>
impl<A, B, C> ClarabelSolver<A, B, C>
Sourcepub fn new(settings: DefaultSettings<f64>) -> Self
pub fn new(settings: DefaultSettings<f64>) -> Self
create a new solver with the given settings
Trait Implementations§
Source§impl<A, B, C> Default for ClarabelSolver<A, B, C>
impl<A, B, C> Default for ClarabelSolver<A, B, C>
Source§impl<DemandId: Clone + Eq + Hash + Ord + Send + Sync + 'static, PortfolioId: Clone + Eq + Hash + Ord + Send + Sync + 'static, ProductId: Clone + Eq + Hash + Ord + Send + Sync + 'static> Solver<DemandId, PortfolioId, ProductId> for ClarabelSolver<DemandId, PortfolioId, ProductId>
impl<DemandId: Clone + Eq + Hash + Ord + Send + Sync + 'static, PortfolioId: Clone + Eq + Hash + Ord + Send + Sync + 'static, ProductId: Clone + Eq + Hash + Ord + Send + Sync + 'static> Solver<DemandId, PortfolioId, ProductId> for ClarabelSolver<DemandId, PortfolioId, ProductId>
Source§type PortfolioOutcome = PortfolioOutcome
type PortfolioOutcome = PortfolioOutcome
A solver will produce outcomes for a portfolio. This should, at a
minimum, include the optimal trade rate. It might also include the
effective portfolio price, as well as other aggregated statistics.
Source§type ProductOutcome = ProductOutcome
type ProductOutcome = ProductOutcome
A solver will produce outcomes for a product. This should, at a
minimum, include the clearing price. It might also include the total
speed of trade, as well as other aggregated statistics.
Source§type State = ()
type State = ()
A solver may leverage additional data to generate a solution, such as
a previous batch’s prices and trades. Read more
Source§async fn solve(
&self,
demand_curves: Map<DemandId, DemandCurve>,
portfolios: Map<PortfolioId, (DemandGroup<DemandId>, ProductGroup<ProductId>)>,
_state: Self::State,
) -> Result<(Map<PortfolioId, Self::PortfolioOutcome>, Map<ProductId, Self::ProductOutcome>), Self::Error>
async fn solve( &self, demand_curves: Map<DemandId, DemandCurve>, portfolios: Map<PortfolioId, (DemandGroup<DemandId>, ProductGroup<ProductId>)>, _state: Self::State, ) -> Result<(Map<PortfolioId, Self::PortfolioOutcome>, Map<ProductId, Self::ProductOutcome>), Self::Error>
Produce a solution given the batch inputs and the solver state. Read more
Auto Trait Implementations§
impl<DemandId, PortfolioId, ProductId> Freeze for ClarabelSolver<DemandId, PortfolioId, ProductId>
impl<DemandId, PortfolioId, ProductId> RefUnwindSafe for ClarabelSolver<DemandId, PortfolioId, ProductId>
impl<DemandId, PortfolioId, ProductId> Send for ClarabelSolver<DemandId, PortfolioId, ProductId>
impl<DemandId, PortfolioId, ProductId> Sync for ClarabelSolver<DemandId, PortfolioId, ProductId>
impl<DemandId, PortfolioId, ProductId> Unpin for ClarabelSolver<DemandId, PortfolioId, ProductId>
impl<DemandId, PortfolioId, ProductId> UnwindSafe for ClarabelSolver<DemandId, PortfolioId, ProductId>
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