@@ -75,6 +75,7 @@ pub(crate) const DECOMP_VERBOSITY_PARAM_ID: i32 = 27;
7575pub ( crate ) const STAT_TIMER_PARAM_ID : i32 = 29 ;
7676
7777/// Enum representing the objective sense for optimization.
78+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
7879pub enum ObjSense {
7980 /// Minimize the objective function.
8081 Minimize = -1 ,
@@ -83,6 +84,7 @@ pub enum ObjSense {
8384}
8485
8586/// Enum representing the type of representation.
87+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
8688pub enum Representation {
8789 /// Automatically determine the representation type.
8890 Auto = 0 ,
@@ -93,6 +95,7 @@ pub enum Representation {
9395}
9496
9597/// Enum representing the type of algorithm used.
98+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
9699pub enum Algorithm {
97100 /// Primal algorithm.
98101 Primal = 0 ,
@@ -101,6 +104,7 @@ pub enum Algorithm {
101104}
102105
103106/// Enum representing the factor update type.
107+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
104108pub enum FactorUpdateType {
105109 /// ETA update type.
106110 Eta = 0 ,
@@ -109,6 +113,7 @@ pub enum FactorUpdateType {
109113}
110114
111115/// Enum representing verbosity levels.
116+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
112117pub enum Verbosity {
113118 /// Only show errors.
114119 Error = 0 ,
@@ -125,6 +130,7 @@ pub enum Verbosity {
125130}
126131
127132/// Enum representing the simplifier type.
133+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
128134pub enum Simplifier {
129135 /// Simplification is turned off.
130136 Off = 0 ,
@@ -137,6 +143,7 @@ pub enum Simplifier {
137143}
138144
139145/// Enum representing the scalar type.
146+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
140147pub enum Scalar {
141148 /// Scalar operation is turned off.
142149 Off = 0 ,
@@ -155,6 +162,7 @@ pub enum Scalar {
155162}
156163
157164/// Enum representing the starter type.
165+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
158166pub enum Starter {
159167 /// Starter is turned off.
160168 Off = 0 ,
@@ -167,6 +175,7 @@ pub enum Starter {
167175}
168176
169177/// Enum representing the pricer type.
178+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
170179pub enum Pricer {
171180 /// Automatically choose the pricer.
172181 Auto = 0 ,
@@ -183,6 +192,7 @@ pub enum Pricer {
183192}
184193
185194/// Enum representing the ratio tester type.
195+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
186196pub enum RatioTester {
187197 /// Use textbook ratio test.
188198 Textbook = 0 ,
@@ -195,6 +205,8 @@ pub enum RatioTester {
195205}
196206
197207/// Enum representing the synchronization mode.
208+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
209+
198210pub enum SyncMode {
199211 /// Only sync real values.
200212 Onlyreal = 0 ,
@@ -205,6 +217,7 @@ pub enum SyncMode {
205217}
206218
207219/// Enum representing the read mode.
220+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
208221pub enum ReadMode {
209222 /// Read real values.
210223 Real = 0 ,
@@ -213,6 +226,8 @@ pub enum ReadMode {
213226}
214227
215228/// Enum representing the solve mode.
229+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
230+
216231pub enum SolveMode {
217232 /// Solve with real values.
218233 Real = 0 ,
@@ -223,6 +238,8 @@ pub enum SolveMode {
223238}
224239
225240/// Enum representing the check mode.
241+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
242+
226243pub enum CheckMode {
227244 /// Check real values.
228245 Real = 0 ,
@@ -233,6 +250,8 @@ pub enum CheckMode {
233250}
234251
235252/// Enum representing the timer type.
253+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
254+
236255pub enum Timer {
237256 /// Timer is turned off.
238257 Off = 0 ,
@@ -243,6 +262,8 @@ pub enum Timer {
243262}
244263
245264/// Enum representing the hyperpricing mode.
265+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
266+
246267pub enum HyperPricing {
247268 /// Hyperpricing is turned off.
248269 Off = 0 ,
@@ -253,6 +274,8 @@ pub enum HyperPricing {
253274}
254275
255276/// Enum representing the solution polishing mode.
277+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
278+
256279pub enum SolutionPolishing {
257280 /// Solution polishing is turned off.
258281 Off = 0 ,
@@ -358,6 +381,16 @@ macro_rules! impl_from_int_param {
358381 } ;
359382}
360383
384+ impl From < i32 > for ObjSense {
385+ fn from ( value : i32 ) -> Self {
386+ match value {
387+ -1 => ObjSense :: Minimize ,
388+ 1 => ObjSense :: Maximize ,
389+ _ => panic ! ( "Invalid value for ObjSense: {}" , value) ,
390+ }
391+ }
392+ }
393+
361394impl_from_int_param ! (
362395 BoolParam ,
363396 IntParam ,
0 commit comments