| 566 | } |
| 567 | |
| 568 | void HighsSparseMatrix::getRow(const HighsInt iRow, HighsInt& num_nz, |
| 569 | HighsInt* index, double* value) const { |
| 570 | assert(iRow >= 0 && iRow < this->num_row_); |
| 571 | num_nz = 0; |
| 572 | if (this->isRowwise()) { |
| 573 | for (HighsInt iEl = this->start_[iRow]; iEl < this->start_[iRow + 1]; |
| 574 | iEl++) { |
| 575 | index[num_nz] = this->index_[iEl]; |
| 576 | value[num_nz] = this->value_[iEl]; |
| 577 | num_nz++; |
| 578 | } |
| 579 | } else { |
| 580 | for (HighsInt iCol = 0; iCol < this->num_col_; iCol++) { |
| 581 | for (HighsInt iEl = this->start_[iCol]; iEl < this->start_[iCol + 1]; |
| 582 | iEl++) { |
| 583 | if (this->index_[iEl] == iRow) { |
| 584 | index[num_nz] = iCol; |
| 585 | value[num_nz] = this->value_[iEl]; |
| 586 | num_nz++; |
| 587 | break; |
| 588 | } |
| 589 | } |
| 590 | } |
| 591 | } |
| 592 | } |
| 593 | |
| 594 | void HighsSparseMatrix::deleteCols( |
| 595 | const HighsIndexCollection& index_collection) { |