@@ -1495,98 +1495,6 @@ void appendRowsToLpVectors(HighsLp& lp, const HighsInt num_new_row,
14951495 }
14961496}
14971497
1498- void deleteColsFromLpVectors (HighsLp& lp, HighsInt& new_num_col,
1499- const HighsIndexCollection& index_collection) {
1500- assert (ok (index_collection));
1501- HighsInt from_k;
1502- HighsInt to_k;
1503- limits (index_collection, from_k, to_k);
1504- ;
1505- // Initialise new_num_col in case none is removed due to from_k > to_k
1506- new_num_col = lp.num_col_ ;
1507- if (from_k > to_k) return ;
1508-
1509- HighsInt delete_from_col;
1510- HighsInt delete_to_col;
1511- HighsInt keep_from_col;
1512- HighsInt keep_to_col = -1 ;
1513- HighsInt current_set_entry = 0 ;
1514-
1515- HighsInt col_dim = lp.num_col_ ;
1516- new_num_col = 0 ;
1517- bool have_names = (lp.col_names_ .size () != 0 );
1518- bool have_integrality = (lp.integrality_ .size () != 0 );
1519- for (HighsInt k = from_k; k <= to_k; k++) {
1520- updateOutInIndex (index_collection, delete_from_col, delete_to_col,
1521- keep_from_col, keep_to_col, current_set_entry);
1522- // Account for the initial columns being kept
1523- if (k == from_k) new_num_col = delete_from_col;
1524- if (delete_to_col >= col_dim - 1 ) break ;
1525- assert (delete_to_col < col_dim);
1526- for (HighsInt col = keep_from_col; col <= keep_to_col; col++) {
1527- lp.col_cost_ [new_num_col] = lp.col_cost_ [col];
1528- lp.col_lower_ [new_num_col] = lp.col_lower_ [col];
1529- lp.col_upper_ [new_num_col] = lp.col_upper_ [col];
1530- if (have_names) lp.col_names_ [new_num_col] = lp.col_names_ [col];
1531- if (have_integrality) lp.integrality_ [new_num_col] = lp.integrality_ [col];
1532- new_num_col++;
1533- }
1534- if (keep_to_col >= col_dim - 1 ) break ;
1535- }
1536- lp.col_cost_ .resize (new_num_col);
1537- lp.col_lower_ .resize (new_num_col);
1538- lp.col_upper_ .resize (new_num_col);
1539- if (have_names) lp.col_names_ .resize (new_num_col);
1540- }
1541-
1542- void deleteLpRows (HighsLp& lp, const HighsIndexCollection& index_collection) {
1543- HighsInt new_num_row;
1544- deleteRowsFromLpVectors (lp, new_num_row, index_collection);
1545- lp.a_matrix_ .deleteRows (index_collection);
1546- lp.num_row_ = new_num_row;
1547- }
1548-
1549- void deleteRowsFromLpVectors (HighsLp& lp, HighsInt& new_num_row,
1550- const HighsIndexCollection& index_collection) {
1551- assert (ok (index_collection));
1552- HighsInt from_k;
1553- HighsInt to_k;
1554- limits (index_collection, from_k, to_k);
1555- // Initialise new_num_row in case none is removed due to from_k > to_k
1556- new_num_row = lp.num_row_ ;
1557- if (from_k > to_k) return ;
1558-
1559- HighsInt delete_from_row;
1560- HighsInt delete_to_row;
1561- HighsInt keep_from_row;
1562- HighsInt keep_to_row = -1 ;
1563- HighsInt current_set_entry = 0 ;
1564-
1565- HighsInt row_dim = lp.num_row_ ;
1566- new_num_row = 0 ;
1567- bool have_names = (HighsInt)lp.row_names_ .size () > 0 ;
1568- for (HighsInt k = from_k; k <= to_k; k++) {
1569- updateOutInIndex (index_collection, delete_from_row, delete_to_row,
1570- keep_from_row, keep_to_row, current_set_entry);
1571- if (k == from_k) {
1572- // Account for the initial rows being kept
1573- new_num_row = delete_from_row;
1574- }
1575- if (delete_to_row >= row_dim - 1 ) break ;
1576- assert (delete_to_row < row_dim);
1577- for (HighsInt row = keep_from_row; row <= keep_to_row; row++) {
1578- lp.row_lower_ [new_num_row] = lp.row_lower_ [row];
1579- lp.row_upper_ [new_num_row] = lp.row_upper_ [row];
1580- if (have_names) lp.row_names_ [new_num_row] = lp.row_names_ [row];
1581- new_num_row++;
1582- }
1583- if (keep_to_row >= row_dim - 1 ) break ;
1584- }
1585- lp.row_lower_ .resize (new_num_row);
1586- lp.row_upper_ .resize (new_num_row);
1587- if (have_names) lp.row_names_ .resize (new_num_row);
1588- }
1589-
15901498void deleteScale (vector<double >& scale,
15911499 const HighsIndexCollection& index_collection) {
15921500 assert (ok (index_collection));
0 commit comments