use alloc::vec::Vec;
use super::ConstraintId;
use crate::Ticks;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Bound {
Upper,
Lower,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct CycleEdge {
pub constraint: ConstraintId,
pub bound: Bound,
}
impl CycleEdge {
pub(crate) const fn new(constraint: ConstraintId, bound: Bound) -> Self {
Self { constraint, bound }
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct NegativeCycle {
edges: Vec<CycleEdge>,
weight: Ticks,
}
impl NegativeCycle {
pub(crate) fn new(edges: Vec<CycleEdge>, weight: Ticks) -> Self {
Self { edges, weight }
}
#[must_use]
pub fn edges(&self) -> &[CycleEdge] {
&self.edges
}
#[must_use]
pub fn weight(&self) -> Ticks {
self.weight
}
}