11#include < memory>
2+ #include < optional>
23#include < string>
34
45#include < ortools/linear_solver/linear_solver.h>
@@ -114,11 +115,11 @@ void init_linear(Rice::Module& m) {
114115 [](MPSolverParameters& self) {
115116 int presolve = self.GetIntegerParam (MPSolverParameters::IntegerParam::PRESOLVE);
116117 if (presolve == MPSolverParameters::PresolveValues::PRESOLVE_ON) {
117- return Rice::True ;
118+ return std::optional< bool >{ true } ;
118119 } else if (presolve == MPSolverParameters::PresolveValues::PRESOLVE_OFF) {
119- return Rice::False ;
120+ return std::optional< bool >{ false } ;
120121 } else {
121- return Rice::Nil ;
122+ return std::optional< bool >{} ;
122123 }
123124 })
124125 .define_method (
@@ -137,11 +138,11 @@ void init_linear(Rice::Module& m) {
137138 [](MPSolverParameters& self) {
138139 int incrementality = self.GetIntegerParam (MPSolverParameters::IntegerParam::INCREMENTALITY);
139140 if (incrementality == MPSolverParameters::IncrementalityValues::INCREMENTALITY_ON) {
140- return Rice::True ;
141+ return std::optional< bool >{ true } ;
141142 } else if (incrementality == MPSolverParameters::IncrementalityValues::INCREMENTALITY_OFF) {
142- return Rice::False ;
143+ return std::optional< bool >{ false } ;
143144 } else {
144- return Rice::Nil ;
145+ return std::optional< bool >{} ;
145146 }
146147 })
147148 .define_method (
@@ -160,11 +161,11 @@ void init_linear(Rice::Module& m) {
160161 [](MPSolverParameters& self) {
161162 int scaling = self.GetIntegerParam (MPSolverParameters::IntegerParam::SCALING);
162163 if (scaling == MPSolverParameters::ScalingValues::SCALING_ON) {
163- return Rice::True ;
164+ return std::optional< bool >{ true } ;
164165 } else if (scaling == MPSolverParameters::ScalingValues::SCALING_OFF) {
165- return Rice::False ;
166+ return std::optional< bool >{ false } ;
166167 } else {
167- return Rice::Nil ;
168+ return std::optional< bool >{} ;
168169 }
169170 });
170171
0 commit comments