@@ -215,41 +215,27 @@ inline T fractionality(T input, T* intval = nullptr) {
215215 return abs (input - val);
216216}
217217
218- inline std::pair<double , double > infeasibility (const double * lower,
219- const double * value,
220- const double * upper,
221- const double * tolerance) {
218+ inline std::pair<double , double > infeasibility (const double lower,
219+ const double value,
220+ const double upper,
221+ const double tolerance) {
222222 using std::fabs;
223223 using std::min;
224224 double residual = 0 ;
225225 double infeasibility = 0 ;
226- std::string bound_type = " " ;
227- double bound_value = 0 ;
228226 // Determine the infeasibility exceeding the tolerance used in
229- // computing the number of infeasibilities - which defines
230- // feasibility of a solution
227+ // computing the number of infeasibilities in a basic solution -
228+ // which defines its feasibility
231229 //
232230 // @primal_infeasibility calculation
233- if (*value < *lower - *tolerance) {
234- infeasibility = *lower - *value;
235- }
236- if (*value > *upper + *tolerance) {
237- infeasibility = *value - *upper;
238- }
231+ if (value < lower - tolerance) infeasibility = lower - value;
232+ if (value > upper + tolerance) infeasibility = value - upper;
239233 // Determine the residual used in computing the sum of
240234 // infeasibilities and max infeasibility - which are just for
241235 // reporting
242- if (*tolerance > 0 ) {
243- if (*value < *lower) {
244- bound_type = " LB" ;
245- bound_value = *lower;
246- residual = *lower - *value;
247- }
248- if (*value > *upper) {
249- bound_type = " UB" ;
250- bound_value = *upper;
251- residual = *value - *upper;
252- }
236+ if (tolerance > 0 ) {
237+ if (value < lower) residual = lower - value;
238+ if (value > upper) residual = value - upper;
253239 } else {
254240 residual = infeasibility;
255241 }
@@ -279,7 +265,7 @@ inline std::pair<double, double> infeasibility(const double* lower,
279265 // so that values of maximum infeasibility defined by residual
280266 // doesn't exceed the tolerance
281267 //
282- if (infeasibility == 0 ) residual = min (residual, * tolerance);
268+ if (infeasibility == 0 ) residual = min (residual, tolerance);
283269 return std::make_pair (infeasibility, residual);
284270}
285271#endif // UTIL_HIGHSUTILS_H_
0 commit comments