#[derive(Debug, Clone)]
pub struct OptimalCertificate {
stationarity_rel: f64,
primal_residual_rel: f64,
dual_sign_violation: f64,
duality_gap_rel: f64,
tol: f64,
}
impl OptimalCertificate {
pub(crate) fn new(
stationarity_rel: f64,
primal_residual_rel: f64,
dual_sign_violation: f64,
duality_gap_rel: f64,
tol: f64,
) -> Self {
Self {
stationarity_rel,
primal_residual_rel,
dual_sign_violation,
duality_gap_rel,
tol,
}
}
pub fn stationarity_rel(&self) -> f64 {
self.stationarity_rel
}
pub fn primal_residual_rel(&self) -> f64 {
self.primal_residual_rel
}
pub fn dual_sign_violation(&self) -> f64 {
self.dual_sign_violation
}
pub fn duality_gap_rel(&self) -> f64 {
self.duality_gap_rel
}
pub fn tol(&self) -> f64 {
self.tol
}
}
#[derive(Debug, Clone)]
pub struct NotProven {
pub stationarity_rel: f64,
pub primal_residual_rel: f64,
pub bound_violation: f64,
pub complementarity_rel: f64,
pub dual_sign_violation: f64,
pub duality_gap_rel: f64,
pub tol: f64,
pub failing_conditions: Vec<&'static str>,
}
#[derive(Debug, Clone)]
pub struct BoundGapCertificate {
incumbent_obj: f64,
lower_bound: f64,
gap_rel: f64,
gap_tol: f64,
}
impl BoundGapCertificate {
pub(crate) fn new(incumbent_obj: f64, lower_bound: f64, gap_rel: f64, gap_tol: f64) -> Self {
Self {
incumbent_obj,
lower_bound,
gap_rel,
gap_tol,
}
}
pub fn incumbent_obj(&self) -> f64 {
self.incumbent_obj
}
pub fn lower_bound(&self) -> f64 {
self.lower_bound
}
pub fn gap_rel(&self) -> f64 {
self.gap_rel
}
pub fn gap_tol(&self) -> f64 {
self.gap_tol
}
}