fn test(file_name: &str, objective: f64, tolerance: f64) {
    type T = RationalBig;
    type S = RationalBig;

    let path = get_test_file_path(file_name);
    let result = import::<T>(&path).unwrap();

    let mut general = result.try_into().ok().unwrap();
    let data = general.derive_matrix_data().ok().unwrap();
    let result = data.solve_relaxation::<Carry<S, BasisInverseRows<_>>>();

    match result {
        OptimizationResult::FiniteOptimum(vector) => {
            let reconstructed = data.reconstruct_solution(vector);
            let solution = general.compute_full_solution_with_reduced_solution(reconstructed);

            // TODO(CORRECTNESS): Make this a relative error check.
            assert!((solution.objective_value - RB!(objective)).abs() < RB!(tolerance));
        },
        _ => assert!(false),
    }
}
/// Testing a problem, comparing only the objective value.
Testing a problem, comparing only the objective value.
Testing a problem comparing only the objective value .
fn test(file_name: &str, objective: f64, tolerance: f64) {
    type T = RationalBig;
    type S = RationalBig;
    let path = get_test_file_path(file_name);
    let result = import::<T>(&path).unwrap();
    let mut general = result.try_into().ok().unwrap();
    let data = general.derive_matrix_data().ok().unwrap();
    let result = data.solve_relaxation::<Carry<S, BasisInverseRows<_>>>();
    match result {
        OptimizationResult::FiniteOptimum(vector) => {
            let reconstructed = data.reconstruct_solution(vector);
            let solution = general.compute_full_solution_with_reduced_solution(reconstructed);
            // TODO(CORRECTNESS): Make this a relative error check.
            assert!((solution.objective_value - RB!(objective)).abs() < RB!(tolerance));
        },
        _ => assert!(false),
    }
}
fn test ( file_name : & str , objective : f64 , tolerance : f64 ) { type T = RationalBig ; type S = RationalBig ; let path = get_test_file_path ( file_name ) ; let result = import :: < T > ( & path ) . unwrap ( ) ; let mut general = result . try_into ( ) . ok ( ) . unwrap ( ) ; let data = general . derive_matrix_data ( ) . ok ( ) . unwrap ( ) ; let result = data . solve_relaxation :: < Carry < S , BasisInverseRows < _ > > > ( ) ; match result { OptimizationResult :: FiniteOptimum ( vector ) => { let reconstructed = data . reconstruct_solution ( vector ) ; let solution = general . compute_full_solution_with_reduced_solution ( reconstructed ) ; // TODO(CORRECTNESS): Make this a relative error check. assert ! ( ( solution objective_value RB ( objective ) ) abs ( ) RB ( tolerance ) ) ; } , _ => assert ! ( false ) , } }
Testing a problem, comparing only the objective value.
Testing a problem comparing only the objective value .
file_name
&str
objective
f64
tolerance
f64
file_name
&str
objective
f64
tolerance
f64