@@ -20,6 +20,10 @@ pub enum Status {
2020 MemoryLimit ,
2121 /// The solving process was interrupted because the gap limit was reached.
2222 GapLimit ,
23+ /// The solving process was interrupted because the primal limit was reached.
24+ PrimalLimit ,
25+ /// The solving process was interrupted because the dual limit was reached.
26+ DualLimit ,
2327 /// The solving process was interrupted because the solution limit was reached.
2428 SolutionLimit ,
2529 /// The solving process was interrupted because the solution improvement limit was reached.
@@ -50,6 +54,8 @@ impl From<SCIP_Status> for Status {
5054 ffi:: SCIP_Status_SCIP_STATUS_TIMELIMIT => Status :: TimeLimit ,
5155 ffi:: SCIP_Status_SCIP_STATUS_MEMLIMIT => Status :: MemoryLimit ,
5256 ffi:: SCIP_Status_SCIP_STATUS_GAPLIMIT => Status :: GapLimit ,
57+ ffi:: SCIP_Status_SCIP_STATUS_PRIMALLIMIT => Status :: PrimalLimit ,
58+ ffi:: SCIP_Status_SCIP_STATUS_DUALLIMIT => Status :: DualLimit ,
5359 ffi:: SCIP_Status_SCIP_STATUS_SOLLIMIT => Status :: SolutionLimit ,
5460 ffi:: SCIP_Status_SCIP_STATUS_BESTSOLLIMIT => Status :: BestSolutionLimit ,
5561 ffi:: SCIP_Status_SCIP_STATUS_RESTARTLIMIT => Status :: RestartLimit ,
@@ -166,6 +172,34 @@ mod tests {
166172 assert_eq ! ( model. status( ) , Status :: BestSolutionLimit ) ;
167173 }
168174
175+ #[ test]
176+ fn primal_limit ( ) {
177+ let mut model = Model :: new ( )
178+ . hide_output ( )
179+ . include_default_plugins ( )
180+ . read_prob ( "data/test/gen-ip054.mps" )
181+ . unwrap ( ) ;
182+ model = model. set_int_param ( "presolving/maxrounds" , 0 ) . unwrap ( ) ;
183+ model = model. set_real_param ( "limits/primal" , 100000. ) . unwrap ( ) ;
184+ let model = model. solve ( ) ;
185+
186+ assert_eq ! ( model. status( ) , Status :: PrimalLimit ) ;
187+ }
188+
189+ #[ test]
190+ fn dual_limit ( ) {
191+ let mut model = Model :: new ( )
192+ . hide_output ( )
193+ . include_default_plugins ( )
194+ . read_prob ( "data/test/gen-ip054.mps" )
195+ . unwrap ( ) ;
196+ model = model. set_int_param ( "presolving/maxrounds" , 0 ) . unwrap ( ) ;
197+ model = model. set_real_param ( "limits/dual" , -100000. ) . unwrap ( ) ;
198+ let model = model. solve ( ) ;
199+
200+ assert_eq ! ( model. status( ) , Status :: DualLimit ) ;
201+ }
202+
169203 #[ test]
170204 fn unknown ( ) {
171205 assert_eq ! ( Model :: new( ) . status( ) , Status :: Unknown ) ;
0 commit comments