Skip to content

Commit b090011

Browse files
committed
Restored calls to analyseLp in simplex/HSimplex.cpp, and using explcit std::min/max/fabs in lp_data/HighsLpUtils.cpp
1 parent 84d2381 commit b090011

File tree

2 files changed

+6
-38
lines changed

2 files changed

+6
-38
lines changed

highs/lp_data/HighsLpUtils.cpp

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
#include "util/HighsMatrixUtils.h"
2525
#include "util/HighsSort.h"
2626

27-
using std::fabs;
28-
using std::max;
29-
using std::min;
27+
//using std::fabs;
28+
//using std::max;
29+
//using std::min;
3030

3131
const HighsInt kMaxLineLength = 80;
3232

@@ -1449,24 +1449,6 @@ void reportMatrix(const HighsLogOptions& log_options, const std::string message,
14491449
}
14501450

14511451
void analyseLp(const HighsLogOptions& log_options, const HighsLp& lp) {
1452-
/*
1453-
vector<double> min_colBound;
1454-
vector<double> min_rowBound;
1455-
vector<double> colRange;
1456-
vector<double> rowRange;
1457-
min_colBound.resize(lp.num_col_);
1458-
min_rowBound.resize(lp.num_row_);
1459-
colRange.resize(lp.num_col_);
1460-
rowRange.resize(lp.num_row_);
1461-
for (HighsInt col = 0; col < lp.num_col_; col++)
1462-
min_colBound[col] = min(fabs(lp.col_lower_[col]), fabs(lp.col_upper_[col]));
1463-
for (HighsInt row = 0; row < lp.num_row_; row++)
1464-
min_rowBound[row] = min(fabs(lp.row_lower_[row]), fabs(lp.row_upper_[row]));
1465-
for (HighsInt col = 0; col < lp.num_col_; col++)
1466-
colRange[col] = lp.col_upper_[col] - lp.col_lower_[col];
1467-
for (HighsInt row = 0; row < lp.num_row_; row++)
1468-
rowRange[row] = lp.row_upper_[row] - lp.row_lower_[row];
1469-
*/
14701452
std::string message;
14711453
if (lp.is_scaled_) {
14721454
message = "Scaled";
@@ -1488,20 +1470,10 @@ void analyseLp(const HighsLogOptions& log_options, const HighsLp& lp) {
14881470
lp.col_lower_, true, lp.model_name_);
14891471
analyseVectorValues(&log_options, "Column upper bounds", lp.num_col_,
14901472
lp.col_upper_, true, lp.model_name_);
1491-
// analyseVectorValues(&log_options, "Column min abs bound", lp.num_col_,
1492-
// min_colBound, true, lp.model_name_);
1493-
// analyseVectorValues(&log_options, "Column range", lp.num_col_, colRange,
1494-
// true,
1495-
// lp.model_name_);
14961473
analyseVectorValues(&log_options, "Row lower bounds", lp.num_row_,
14971474
lp.row_lower_, true, lp.model_name_);
14981475
analyseVectorValues(&log_options, "Row upper bounds", lp.num_row_,
14991476
lp.row_upper_, true, lp.model_name_);
1500-
// analyseVectorValues(&log_options, "Row min abs bound", lp.num_row_,
1501-
// min_rowBound, true, lp.model_name_);
1502-
// analyseVectorValues(&log_options, "Row range", lp.num_row_, rowRange,
1503-
// true,
1504-
// lp.model_name_);
15051477
analyseVectorValues(&log_options, "Matrix sparsity",
15061478
lp.a_matrix_.start_[lp.num_col_], lp.a_matrix_.value_,
15071479
true, lp.model_name_);
@@ -2068,7 +2040,7 @@ HighsStatus assessLpPrimalSolution(const std::string message,
20682040
std::max(row_infeasibility, max_row_infeasibility);
20692041
sum_row_infeasibilities += row_infeasibility;
20702042
}
2071-
double row_residual = fabs(primal - row_value[iRow]);
2043+
double row_residual = std::fabs(primal - row_value[iRow]);
20722044
if (row_residual > kRowResidualTolerance) {
20732045
if (row_residual > 2 * max_row_residual) {
20742046
highsLogUser(options.log_options, HighsLogType::kWarning,
@@ -2516,7 +2488,7 @@ bool isLessInfeasibleDSECandidate(const HighsLogOptions& log_options,
25162488
en < lp.a_matrix_.start_[col + 1]; en++) {
25172489
double value = lp.a_matrix_.value_[en];
25182490
// All nonzeros must be +1 or -1
2519-
if (fabs(value) != 1) return false;
2491+
if (std::fabs(value) != 1) return false;
25202492
}
25212493
}
25222494
double average_col_num_en = lp.a_matrix_.start_[lp.num_col_];

highs/simplex/HSimplex.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <cmath>
1717
#include <vector>
1818

19-
// #include "lp_data/HighsLpUtils.h"
19+
#include "lp_data/HighsLpUtils.h"
2020
// #include "util/HighsSort.h"
2121

2222
using std::max;
@@ -427,17 +427,13 @@ bool considerSimplexScaling(const HighsOptions& options, HighsLp& lp) {
427427
if (try_scaling) {
428428
// Scaling will be tried, so ensure that any previous scaling is not applied
429429
lp.unapplyScale();
430-
/*
431430
const bool analyse_lp_data =
432431
kHighsAnalysisLevelModelData & options.highs_analysis_level;
433432
if (analyse_lp_data) analyseLp(options.log_options, lp);
434-
*/
435433
simplexScaleLp(options, lp);
436434
// If the LP is now scaled, then the scaling is new
437435
new_scaling = lp.is_scaled_;
438-
/*
439436
if (analyse_lp_data && lp.is_scaled_) analyseLp(options.log_options, lp);
440-
*/
441437
} else if (lp.scale_.has_scaling) {
442438
// Scaling factors are known, so ensure that they are applied
443439
lp.applyScale();

0 commit comments

Comments
 (0)