Skip to main content

PortfolioSequence

Struct PortfolioSequence 

Source
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

Source

pub fn dimension(&self) -> usize

Number of portfolio weights.

Source

pub const fn settings(&self) -> &SolverSettings

Settings every solve in this sequence iterates with.

Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.