| 45 | |
| 46 | template <typename Real> |
| 47 | void HVectorBase<Real>::clear() { |
| 48 | /* |
| 49 | * Clear an HVector instance |
| 50 | */ |
| 51 | // Standard HVector to clear |
| 52 | HighsInt dense_clear = count < 0 || count > size * 0.3; |
| 53 | if (dense_clear) { |
| 54 | // Treat the array as full if there are no indices or too many |
| 55 | // indices |
| 56 | array.assign(size, Real{0}); |
| 57 | } else { |
| 58 | // Zero according to the indices of (possible) nonzeros |
| 59 | for (HighsInt i = 0; i < count; i++) { |
| 60 | array[index[i]] = 0; |
| 61 | } |
| 62 | } |
| 63 | this->clearScalars(); |
| 64 | } |
| 65 | |
| 66 | template <typename Real> |
| 67 | void HVectorBase<Real>::clearScalars() { |
nothing calls this directly
no test coverage detected