Expand description
Analysis and statistics for Linear Programming problems.
This module provides comprehensive analysis capabilities for LP problems, including summary statistics, issue detection, and structural metrics.
§Example
use lp_parser::{LpProblem, analysis::ProblemAnalysis};
fn analyze_problem(input: &str) -> Result<(), Box<dyn std::error::Error>> {
let problem = LpProblem::parse(input)?;
let analysis = problem.analyze();
println!("Variables: {}", analysis.summary.variable_count);
println!("Density: {:.2}%", analysis.summary.density * 100.0);
for issue in &analysis.issues {
println!("[{:?}] {}", issue.severity, issue.message);
}
Ok(())
}Structs§
- Analysis
Config - Configuration for analysis behavior and thresholds.
- Analysis
Issue - A detected issue in the LP problem.
- Coefficient
Analysis - Coefficient analysis results.
- Coefficient
Location - Location of a coefficient in the problem.
- Constraint
Analysis - Constraint analysis results.
- Constraint
Type Distribution - Distribution of constraint types.
- Fixed
Variable - A variable that is fixed (lower == upper).
- Invalid
Bound - A variable with invalid bounds (lower > upper).
- Problem
Analysis - Complete analysis results for an LP problem.
- Problem
Summary - Basic problem summary statistics.
- Range
Stats - Statistical range information.
- SOSSummary
- Summary of SOS constraints.
- Singleton
Constraint - A singleton constraint (only one variable).
- Sparsity
Metrics - Sparsity and structural metrics.
- Variable
Analysis - Variable type distribution and analysis.
- Variable
Type Distribution - Distribution of variable types.
Enums§
- Issue
Category - Category of detected issue.
- Issue
Severity - Severity level for detected issues.