File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
highs/ipm/hipo/factorhighs Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ Int64 Analyse::getPermutation(bool metis_no2hop) {
7676 // element is skipped.
7777
7878 std::vector<Int> work (n_, 0 );
79+ Int64 total_nz = 0 ;
7980
8081 // go through the columns to count nonzeros
8182 for (Int64 j = 0 ; j < n_; ++j) {
@@ -90,9 +91,16 @@ Int64 Analyse::getPermutation(bool metis_no2hop) {
9091
9192 // duplicated on the lower part of column i
9293 ++work[i];
94+
95+ total_nz += 2 ;
9396 }
9497 }
9598
99+ if (total_nz > kHighsIInf ) {
100+ if (log_) log_->printe (" Integer overflow while preparing Metis\n " );
101+ return kRetIntOverflow ;
102+ }
103+
96104 // compute column pointers from column counts
97105 std::vector<Int> temp_ptr (n_ + 1 , 0 );
98106 counts2Ptr (temp_ptr, work);
You can’t perform that action at this time.
0 commit comments