| 173 | template <typename Real> |
| 174 | template <typename RealPivX, typename RealPiv> |
| 175 | void HVectorBase<Real>::saxpy(const RealPivX pivotX, |
| 176 | const HVectorBase<RealPiv>* pivot) { |
| 177 | /* |
| 178 | * Add a multiple pivotX of *pivot into this vector, maintaining |
| 179 | * indices of nonzeros but not tracking cancellation. |
| 180 | * The real types may all be different but must mix in operations and be |
| 181 | * convertible to this HVector's real type. |
| 182 | */ |
| 183 | HighsInt workCount = count; |
| 184 | HighsInt* workIndex = &index[0]; |
| 185 | Real* workArray = &array[0]; |
| 186 | |
| 187 | const HighsInt pivotCount = pivot->count; |
| 188 | const HighsInt* pivotIndex = &pivot->index[0]; |
| 189 | const RealPiv* pivotArray = &pivot->array[0]; |
| 190 | |
| 191 | using std::abs; |
| 192 | for (HighsInt k = 0; k < pivotCount; k++) { |
| 193 | const HighsInt iRow = pivotIndex[k]; |
| 194 | const Real x0 = workArray[iRow]; |
| 195 | const Real x1 = Real(x0 + pivotX * pivotArray[iRow]); |
| 196 | if (x0 == Real{0}) workIndex[workCount++] = iRow; |
| 197 | workArray[iRow] = (abs(x1) < kHighsTiny) ? kHighsZero : x1; |
| 198 | } |
| 199 | count = workCount; |
| 200 | } |
| 201 | |
| 202 | template <typename Real> |
| 203 | bool HVectorBase<Real>::isEqual(const HVectorBase<Real>& v0) { |
no outgoing calls
no test coverage detected