| 540 | } |
| 541 | |
| 542 | void HighsSparseMatrix::getCol(const HighsInt iCol, HighsInt& num_nz, |
| 543 | HighsInt* index, double* value) const { |
| 544 | assert(iCol >= 0 && iCol < this->num_col_); |
| 545 | num_nz = 0; |
| 546 | if (this->isColwise()) { |
| 547 | for (HighsInt iEl = this->start_[iCol]; iEl < this->start_[iCol + 1]; |
| 548 | iEl++) { |
| 549 | index[num_nz] = this->index_[iEl]; |
| 550 | value[num_nz] = this->value_[iEl]; |
| 551 | num_nz++; |
| 552 | } |
| 553 | } else { |
| 554 | for (HighsInt iRow = 0; iRow < this->num_row_; iRow++) { |
| 555 | for (HighsInt iEl = this->start_[iRow]; iEl < this->start_[iRow + 1]; |
| 556 | iEl++) { |
| 557 | if (this->index_[iEl] == iCol) { |
| 558 | index[num_nz] = iRow; |
| 559 | value[num_nz] = this->value_[iEl]; |
| 560 | num_nz++; |
| 561 | break; |
| 562 | } |
| 563 | } |
| 564 | } |
| 565 | } |
| 566 | } |
| 567 | |
| 568 | void HighsSparseMatrix::getRow(const HighsInt iRow, HighsInt& num_nz, |
| 569 | HighsInt* index, double* value) const { |