pub struct PortfolioSequence { /* private fields */ }Expand description
A rolling solve sequence over a fixed portfolio structure.
Built by PortfolioProblem::sequence or
PortfolioProblem::sequence_with. Owns a
Workspace, so equilibration and SMW-reduced
factorizations persist across dates, and manages warm starts internally:
each solve starts from the previous solution’s full primal/dual iterate.
Solution::solve_time on sequence solves covers iteration only; the
one-time setup was paid when the sequence was constructed.
Implementations§
Source§impl PortfolioSequence
impl PortfolioSequence
Sourcepub const fn settings(&self) -> &SolverSettings
pub const fn settings(&self) -> &SolverSettings
Settings every solve in this sequence iterates with.
Sourcepub const fn factorizations(&self) -> usize
pub const fn factorizations(&self) -> usize
Number of reduced factorizations built since construction (including the initial one). A stable count across rolling dates demonstrates factorization reuse.
Sourcepub fn solve_next(
&mut self,
step: &RebalanceStep,
) -> Result<Solution, PortfolioError>
pub fn solve_next( &mut self, step: &RebalanceStep, ) -> Result<Solution, PortfolioError>
Applies one step’s data changes, then solves, warm-started from the previous solution.
The step is validated in full before any state changes, so an Err
leaves the sequence exactly as it was. The first solve of a sequence
is cold; every later solve chains the previous full primal/dual
iterate (unless the previous solve failed numerically, which would
make a non-finite start).
§Errors
Returns PortfolioError when the step data has wrong dimensions or
non-finite values, updates a constraint the base problem does not
have (budget / turnover anchor), or moves the budget outside what the
box constraints can reach.