Skip to main content

Crate ledge

Crate ledge 

Source
Expand description

Public Rust API for the Ledge portfolio QP solver.

Numerical implementation details live in ledge-core; this crate is the import surface intended for Rust applications and the Python bindings.

Structs§

BatchAccount
One account in a batch: its own portfolio problem plus its per-date steps.
BenchmarkRecord
One measured solver/instance result.
BenchmarkRunner
Executes the same generated instance through registered adapters.
ConvergenceDiagnostics
Heuristic diagnosis of a solve that stopped before convergence.
DualCertificate
An unbounded-descent certificate of dual infeasibility, normalized to unit infinity norm.
DualCertificateResiduals
Independently recomputed residuals of a DualCertificate.
DualVariables
Dual multipliers associated with each constraint block.
FactorQuad
A positive-semidefinite quadratic represented as (Q = F\Omega F^\mathsf{T} + \operatorname{diag}(d)).
GeneratedInstance
Generated problem plus a known feasible reference point.
KktResiduals
Infinity-norm KKT diagnostics.
L1Term
A piecewise-linear proportional cost sum_i costs[i] * |x[i] - anchor[i]| added to the smooth objective (for portfolios: exact L1 turnover around the previous weights).
LinearConstraints
A block of constraints matrix * x = rhs or matrix * x <= rhs.
Matrix
A contiguous row-major dense matrix.
PortfolioProblem
A mean-variance portfolio problem backed by a factor covariance.
PortfolioSequence
A rolling solve sequence over a fixed portfolio structure.
PrimalCertificate
A Farkas certificate of primal infeasibility, normalized to unit infinity norm.
PrimalCertificateResiduals
Independently recomputed residuals of a PrimalCertificate.
QpProblem
Standard-form convex QP accepted by Ledge.
RebalanceStep
Per-date data changes for one PortfolioSequence::solve_next call.
Solution
Solver result and diagnostics.
Solver
Structure-exploiting convex QP solver.
SolverSettings
ADMM settings.
SyntheticConfig
Configuration for a reproducible synthetic portfolio QP.
WarmStart
Optional initial primal and dual iterates.
Workspace
Reusable solve state for a fixed problem structure.

Enums§

Certificate
Proof that a solve stopped because the problem itself is pathological.
FactorCovariance
Factor covariance matrix (\Omega).
GeneratorError
Synthetic generator errors.
KktError
Errors from the standalone KKT checker.
MatrixError
Errors raised while constructing a Matrix.
PortfolioError
Errors from high-level portfolio construction and solution.
ProblemError
Input validation errors.
SolveStatus
Solver termination status.
SolverError
Errors that prevent solver setup.

Traits§

ComparisonSolver
Solver-neutral adapter for benchmark integrations.

Functions§

check_dual_certificate
Recomputes the defining residuals of a dual infeasibility certificate on the original problem data.
check_kkt
Evaluates primal feasibility, stationarity/dual feasibility, and complementarity.
check_primal_certificate
Recomputes the defining residuals of a primal infeasibility certificate on the original problem data.
generate_synthetic
Generates a deterministic, feasible, long-only factor-model portfolio QP.
solve_batch
Solves every account’s rolling sequence, in parallel over the account axis when the rayon cargo feature is enabled (roadmap 3.2).
solve_mean_variance_factor
Solves a factor mean-variance portfolio with optional custom settings.
solve_sequence
Solves a whole rolling sequence in one call: one Solution per step, in order (roadmap 2.5).

Type Aliases§

AccountResult
Per-account outcome of solve_batch: all step solutions in order, or the error that stopped that account.