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

Method getCol

highs/util/HighsSparseMatrix.cpp:542–566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

540}
541
542void 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
568void HighsSparseMatrix::getRow(const HighsInt iRow, HighsInt& num_nz,
569 HighsInt* index, double* value) const {

Callers 1

test_exampleMethod · 0.45

Calls 1

isColwiseMethod · 0.95

Tested by 1

test_exampleMethod · 0.36