| 155 | } |
| 156 | template <typename Real> |
| 157 | Real HVectorBase<Real>::norm2() const { |
| 158 | /* |
| 159 | * Compute the squared 2-norm of the vector |
| 160 | */ |
| 161 | const HighsInt workCount = count; |
| 162 | const HighsInt* workIndex = &index[0]; |
| 163 | const Real* workArray = &array[0]; |
| 164 | |
| 165 | Real result = Real{0}; |
| 166 | for (HighsInt i = 0; i < workCount; i++) { |
| 167 | Real value = workArray[workIndex[i]]; |
| 168 | result += value * value; |
| 169 | } |
| 170 | return result; |
| 171 | } |
| 172 | |
| 173 | template <typename Real> |
| 174 | template <typename RealPivX, typename RealPiv> |
no outgoing calls
no test coverage detected