MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / deleteRowsInterface

Method deleteRowsInterface

highs/lp_data/HighsInterface.cpp:769–820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

767}
768
769void Highs::deleteRowsInterface(HighsIndexCollection& index_collection) {
770 HighsLp& lp = model_.lp_;
771 HighsBasis& basis = basis_;
772 lp.ensureColwise();
773 // Keep a copy of the original number of rows to check whether
774 // any rows have been removed, and if there is mask to be updated
775 HighsInt original_num_row = lp.num_row_;
776
777 lp.deleteRows(index_collection);
778 // Bail out if no rows were actually deleted
779 if (lp.num_row_ == original_num_row) return;
780
781 assert(lp.num_row_ < original_num_row);
782
783 // Nontrivial deletion so reset the model_status and update any
784 // Highs basis
785 model_status_ = HighsModelStatus::kNotset;
786 if (basis_.useful) {
787 assert(basis_.row_status.size() == static_cast<size_t>(original_num_row));
788 // Have a full set of row basis status values, so maintain them,
789 // and only invalidate the basis if a nonbasic row has been
790 // deleted
791 deleteBasisRows(basis_, index_collection, original_num_row);
792 } else {
793 assert(!basis.valid);
794 }
795
796 if (lp.scale_.has_scaling) {
797 deleteScale(lp.scale_.row, index_collection);
798 lp.scale_.row.resize(lp.num_row_);
799 lp.scale_.num_row = lp.num_row_;
800 }
801 // Deduce the consequences of deleting rows
802 invalidateModelStatusSolutionAndInfo();
803
804 // Determine any implications for simplex data
805 ekk_instance_.deleteRows(index_collection);
806 if (index_collection.is_mask_) {
807 HighsInt new_row = 0;
808 for (HighsInt row = 0; row < original_num_row; row++) {
809 if (!index_collection.mask_[row]) {
810 index_collection.mask_[row] = new_row;
811 new_row++;
812 } else {
813 index_collection.mask_[row] = -1;
814 }
815 }
816 assert(new_row == lp.num_row_);
817 }
818 assert(lpDimensionsOk("deleteRows", lp, options_.log_options));
819 lp.row_hash_.name2index.clear();
820}
821
822void Highs::getColsInterface(const HighsIndexCollection& index_collection,
823 HighsInt& num_col, double* cost, double* lower,

Callers

nothing calls this directly

Calls 8

deleteBasisRowsFunction · 0.85
deleteScaleFunction · 0.85
lpDimensionsOkFunction · 0.85
ensureColwiseMethod · 0.45
deleteRowsMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected