Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

API surface

Rust

Published API documentation: ledge and ledge-core. To generate the Rust documentation locally:

cargo doc -p ledge-portfolio --no-deps --open

The ledge crate re-exports everything from ledge-core. Main types:

Type / functionRole
PortfolioProblemportfolio-vocabulary builder over the QP
QpProblem, FactorQuad, L1Termthe underlying factor-structured QP
Solver, SolverSettingssettings container and entry point
Solution, SolveStatus, DualVariablesresults with audited residuals and duals
Solver::workspaceWorkspaceequilibration + factorization cache across solves
PortfolioSequence, RebalanceStep, solve_sequencerolling date-by-date API
solve_batch, BatchAccount (feature rayon)parallel multi-account batch
check_kkt, check_primal_certificate, check_dual_certificateindependent audits
generate_synthetic, SyntheticConfigdeterministic test instances

Python

The package installs as ledge-portfolio, imports as ledge, and carries docstrings on every public symbol:

import ledge
help(ledge.PortfolioProblem)
help(ledge.solve_batch)
SymbolRole
ledge.PortfolioProblemproblem construction (NumPy arrays, keyword constraints/templates)
.solve(**settings)one solve → SolveResult
.sequence(**settings)PortfolioSequence.solve_next(...)rolling API
ledge.solve_batch(problems, steps, ...)parallel multi-account batch
ledge.solve_mean_variance_factor(...)one-shot function form
PortfolioProblem.to_json() / from_json(), SolveResult.to_json()reproduction dumps
SolveResultweights, status, objective, audited residuals, diagnostics, certificate; to_json() includes the full dual blocks

Python does not currently expose solution dual multipliers as direct SolveResult attributes. Use to_json() when a bug report or audit needs the complete serialized solver result.