Skip to main content

Module analysis

Module analysis 

Source
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§

AnalysisConfig
Configuration for analysis behavior and thresholds.
AnalysisIssue
A detected issue in the LP problem.
CoefficientAnalysis
Coefficient analysis results.
CoefficientLocation
Location of a coefficient in the problem.
ConstraintAnalysis
Constraint analysis results.
ConstraintTypeDistribution
Distribution of constraint types.
FixedVariable
A variable that is fixed (lower == upper).
InvalidBound
A variable with invalid bounds (lower > upper).
ProblemAnalysis
Complete analysis results for an LP problem.
ProblemSummary
Basic problem summary statistics.
RangeStats
Statistical range information.
SOSSummary
Summary of SOS constraints.
SingletonConstraint
A singleton constraint (only one variable).
SparsityMetrics
Sparsity and structural metrics.
VariableAnalysis
Variable type distribution and analysis.
VariableTypeDistribution
Distribution of variable types.

Enums§

IssueCategory
Category of detected issue.
IssueSeverity
Severity level for detected issues.