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

Method getRow

highs/util/HighsSparseMatrix.cpp:568–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

566}
567
568void 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
594void HighsSparseMatrix::deleteCols(
595 const HighsIndexCollection& index_collection) {

Callers 4

formStandardFormLpMethod · 0.45
test_exampleMethod · 0.45
getExprMethod · 0.45

Calls 1

isRowwiseMethod · 0.95

Tested by 1

test_exampleMethod · 0.36