Skip to content

Commit 93f664e

Browse files
committed
Added model and dimensions for LPStats; formatted
1 parent bda37c4 commit 93f664e

File tree

5 files changed

+53
-54
lines changed

5 files changed

+53
-54
lines changed

src/ipm/IpxWrapper.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -1218,15 +1218,15 @@ void HighsIpxStats::report(FILE* file, const std::string message,
12181218
"ipm_time,crossover_time,solve_time,");
12191219
} else if (style == HighsSolverStatsReportCsvData) {
12201220
this->averages();
1221-
fprintf(
1222-
file, "%d,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%g,%g,%g,%g,%g,%g,",
1223-
int(this->valid), this->model.c_str(),
1224-
int(this->num_col), int(this->num_row), int(this->num_nz),
1225-
int(this->num_type1_iteration), int(this->average_type1_cr_count),
1226-
int(this->num_type2_iteration), int(this->average_type2_cr_count),
1227-
int(this->average_type2_matrix_nz), int(this->average_type2_invert_nz),
1228-
this->type1_time, this->basis0_time, this->type2_time, this->ipm_time,
1229-
this->crossover_time, this->solve_time);
1221+
fprintf(file, "%d,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%g,%g,%g,%g,%g,%g,",
1222+
int(this->valid), this->model.c_str(), int(this->num_col),
1223+
int(this->num_row), int(this->num_nz),
1224+
int(this->num_type1_iteration), int(this->average_type1_cr_count),
1225+
int(this->num_type2_iteration), int(this->average_type2_cr_count),
1226+
int(this->average_type2_matrix_nz),
1227+
int(this->average_type2_invert_nz), this->type1_time,
1228+
this->basis0_time, this->type2_time, this->ipm_time,
1229+
this->crossover_time, this->solve_time);
12301230
} else {
12311231
fprintf(file, "Unknown IPX stats report style of %d\n", int(style));
12321232
assert(123 == 456);

src/lp_data/HStruct.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ struct HighsLpStats {
172172
double relative_max_matrix_entry;
173173
double relative_num_equal_a_matrix_nz;
174174
double relative_num_dense_row;
175-
void report(FILE* file, std::string message = "", const HighsInt style = HighsLpStatsReportPretty);
175+
void report(FILE* file, std::string message = "",
176+
const HighsInt style = HighsLpStatsReportPretty);
176177
void clear();
177178
};
178179

src/lp_data/HighsLp.cpp

+30-33
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,10 @@ void HighsLp::deleteRows(const HighsIndexCollection& index_collection) {
514514

515515
void HighsLpStats::clear() {
516516
valid = false;
517-
model = "Not set";// "";
518-
num_col = -kHighsIInf;// 0;
519-
num_row = -kHighsIInf;// 0;
520-
num_nz = -kHighsIInf;// 0;
517+
model = "Not set"; // "";
518+
num_col = -kHighsIInf; // 0;
519+
num_row = -kHighsIInf; // 0;
520+
num_nz = -kHighsIInf; // 0;
521521
relative_max_cost_entry = -kHighsInf; // 0;
522522
relative_num_equal_cost = -kHighsInf; // 0;
523523
relative_num_inf_upper = -kHighsInf; // 0;
@@ -533,7 +533,7 @@ void HighsLpStats::clear() {
533533
}
534534

535535
void HighsLpStats::report(FILE* file, std::string message,
536-
const HighsInt style) {
536+
const HighsInt style) {
537537
if (style == HighsLpStatsReportPretty) {
538538
fprintf(file, "\nLP stats\n");
539539
if (message == "") {
@@ -547,49 +547,46 @@ void HighsLpStats::report(FILE* file, std::string message,
547547
fprintf(file, " Number of rows = %d\n", num_row);
548548
fprintf(file, " Number of entries = %d\n", num_nz);
549549
fprintf(file, " Relative maximum cost_entry = %g\n",
550-
relative_max_cost_entry);
550+
relative_max_cost_entry);
551551
fprintf(file, " Relative number of identical costs = %g\n",
552-
relative_num_equal_cost);
552+
relative_num_equal_cost);
553553
fprintf(file, " Relative number of infinite column upper bounds = %g\n",
554-
relative_num_inf_upper);
554+
relative_num_inf_upper);
555555
fprintf(file, " Relative number of equations = %g\n",
556-
relative_num_equations);
556+
relative_num_equations);
557557
fprintf(file, " Relative maximum rhs entry = %g\n",
558-
relative_max_rhs_entry);
558+
relative_max_rhs_entry);
559559
fprintf(file, " Relative number of identical rhs entries = %g\n",
560-
relative_num_equal_rhs);
560+
relative_num_equal_rhs);
561561
fprintf(file, " Constraint matrix stats\n");
562562
fprintf(file, " Density = %g\n",
563-
a_matrix_density);
563+
a_matrix_density);
564564
fprintf(file, " Nonzeros per column = %g\n",
565-
a_matrix_nz_per_col);
565+
a_matrix_nz_per_col);
566566
fprintf(file, " Nonzeros per row = %g\n",
567-
a_matrix_nz_per_row);
567+
a_matrix_nz_per_row);
568568
fprintf(file, " Relative maximum entry = %g\n",
569-
relative_max_matrix_entry);
569+
relative_max_matrix_entry);
570570
fprintf(file, " Relative number of almost identical entries = %g\n",
571-
relative_num_equal_a_matrix_nz);
571+
relative_num_equal_a_matrix_nz);
572572
fprintf(file, " Relative number of dense rows = %g\n",
573-
relative_num_dense_row);
573+
relative_num_dense_row);
574574
} else if (style == HighsLpStatsReportCsvHeader) {
575575
fprintf(file,
576-
"valid,model,col,row,nz,relative_max_cost_entry,relative_num_equal_cost,relative_num_inf_upper,relative_num_equations,relative_max_rhs_entry,relative_num_equal_rhs,a_matrix_density,a_matrix_nz_per_col,a_matrix_nz_per_row,relative_max_matrix_entry,relative_num_equal_a_matrix_nz,relative_num_dense_row");
576+
"valid,model,col,row,nz,relative_max_cost_entry,relative_num_equal_"
577+
"cost,relative_num_inf_upper,relative_num_equations,relative_max_"
578+
"rhs_entry,relative_num_equal_rhs,a_matrix_density,a_matrix_nz_per_"
579+
"col,a_matrix_nz_per_row,relative_max_matrix_entry,relative_num_"
580+
"equal_a_matrix_nz,relative_num_dense_row");
577581
} else if (style == HighsLpStatsReportCsvData) {
578582
fprintf(file, "%d,%s,%d,%d,%d,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g",
579-
int(this->valid), this->model.c_str(),
580-
int(this->num_col), int(this->num_row), int(this->num_nz),
581-
relative_max_cost_entry,
582-
relative_num_equal_cost,
583-
relative_num_inf_upper,
584-
relative_num_equations,
585-
relative_max_rhs_entry,
586-
relative_num_equal_rhs,
587-
a_matrix_density,
588-
a_matrix_nz_per_col,
589-
a_matrix_nz_per_row,
590-
relative_max_matrix_entry,
591-
relative_num_equal_a_matrix_nz,
592-
relative_num_dense_row);
583+
int(this->valid), this->model.c_str(), int(this->num_col),
584+
int(this->num_row), int(this->num_nz), relative_max_cost_entry,
585+
relative_num_equal_cost, relative_num_inf_upper,
586+
relative_num_equations, relative_max_rhs_entry,
587+
relative_num_equal_rhs, a_matrix_density, a_matrix_nz_per_col,
588+
a_matrix_nz_per_row, relative_max_matrix_entry,
589+
relative_num_equal_a_matrix_nz, relative_num_dense_row);
593590
} else {
594591
fprintf(file, "Unknown LP stats report style of %d\n", int(style));
595592
assert(123 == 456);
@@ -747,7 +744,7 @@ void HighsLp::stats() {
747744
if (row_count[iRow] >= dense_row_count) num_dense_row++;
748745

749746
this->stats_.relative_num_dense_row =
750-
this->num_row_ > 0 ? (1.0 * num_dense_row) / this->num_row_ : 0;
747+
this->num_row_ > 0 ? (1.0 * num_dense_row) / this->num_row_ : 0;
751748
this->stats_.valid = true;
752749
}
753750

src/simplex/HEkk.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -4454,17 +4454,17 @@ void HighsSimplexStats::report(FILE* file, std::string message,
44544454
fprintf(file, " simplex time = = %g\n", this->simplex_time);
44554455
fprintf(file, " solve time = = %g\n", this->solve_time);
44564456
} else if (style == HighsSolverStatsReportCsvHeader) {
4457-
fprintf(file,
4458-
"valid,model,col,row,nz,iteration_count,num_invert,last_factored_basis_"
4459-
"num_el,last_invert_num_el,"
4460-
"col_aq_density,row_ep_density,row_ap_density,row_DSE_"
4461-
"density,simplex_time,solve_time,");
4457+
fprintf(
4458+
file,
4459+
"valid,model,col,row,nz,iteration_count,num_invert,last_factored_basis_"
4460+
"num_el,last_invert_num_el,"
4461+
"col_aq_density,row_ep_density,row_ap_density,row_DSE_"
4462+
"density,simplex_time,solve_time,");
44624463
} else if (style == HighsSolverStatsReportCsvData) {
44634464
fprintf(file, "%d,%s,%d,%d,%d,%d,%d,%d,%d,%g,%g,%g,%g,%g,%g,",
4464-
int(this->valid), this->model.c_str(),
4465-
int(this->num_col), int(this->num_row), int(this->num_nz),
4466-
int(this->iteration_count), int(this->num_invert),
4467-
int(this->last_factored_basis_num_el),
4465+
int(this->valid), this->model.c_str(), int(this->num_col),
4466+
int(this->num_row), int(this->num_nz), int(this->iteration_count),
4467+
int(this->num_invert), int(this->last_factored_basis_num_el),
44684468
int(this->last_invert_num_el), this->col_aq_density,
44694469
this->row_ep_density, this->row_ap_density, this->row_DSE_density,
44704470
this->simplex_time, this->solve_time);

src/util/HighsUtils.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1395,8 +1395,9 @@ std::vector<std::pair<double, HighsInt>> valueCountSorted(
13951395
}
13961396
newCluster(num_distinct_value);
13971397
if (num_cluster < num_distinct_value) {
1398-
printf("grep valueCountSorted: num clusters = %d < %d = num distinct values\n",
1399-
int(num_cluster), int(num_distinct_value))
1398+
printf(
1399+
"grep valueCountSorted: num clusters = %d < %d = num distinct values\n",
1400+
int(num_cluster), int(num_distinct_value));
14001401
}
14011402
value_count.resize(num_cluster);
14021403
if (!by_value)

0 commit comments

Comments
 (0)