soplex_rs/
basis_status.rs

1/// Column basis status
2#[derive(Debug, Clone, Copy, PartialEq, Eq)]
3pub enum ColBasisStatus {
4    /// column is set to its upper bound
5    AtUpper = 0,
6    /// column is set to its lower bound
7    AtLower = 1,
8    /// column is fixed to its identical bounds
9    Fixed = 2,
10    /// column is free and fixed to zero
11    Free = 3,
12    /// column is basic
13    Basic = 4,
14    /// nothing known about basis status
15    Unknown = 5,
16}
17
18/// Row basis status
19#[derive(Debug, Clone, Copy, PartialEq, Eq)]
20pub enum RowBasisStatus {
21    /// row is set to its upper bound
22    AtUpper = 0,
23    /// row is set to its lower bound
24    AtLower = 1,
25    /// row is fixed to its identical bounds
26    Fixed = 2,
27    /// row is basic
28    Basic = 4,
29    /// nothing known about basis status
30    Unknown = 5,
31}
32
33impl From<i32> for ColBasisStatus {
34    fn from(item: i32) -> Self {
35        match item {
36            0 => ColBasisStatus::AtUpper,
37            1 => ColBasisStatus::AtLower,
38            2 => ColBasisStatus::Fixed,
39            3 => ColBasisStatus::Free,
40            4 => ColBasisStatus::Basic,
41            5 => ColBasisStatus::Unknown,
42            _ => panic!("Invalid value for BasisStatus"),
43        }
44    }
45}
46
47impl From<i32> for RowBasisStatus {
48    fn from(item: i32) -> Self {
49        match item {
50            0 => RowBasisStatus::AtUpper,
51            1 => RowBasisStatus::AtLower,
52            2 => RowBasisStatus::Fixed,
53            4 => RowBasisStatus::Basic,
54            5 => RowBasisStatus::Unknown,
55            _ => panic!("Invalid value for BasisStatus"),
56        }
57    }
58}