| 136 | template <typename Real> |
| 137 | template <typename FromReal> |
| 138 | void HVectorBase<Real>::copy(const HVectorBase<FromReal>* from) { |
| 139 | /* |
| 140 | * Copy from another HVector structure to this instance |
| 141 | * The real type of "from" does not need to be the same, but must be |
| 142 | * convertible to this HVector's real type. |
| 143 | */ |
| 144 | clear(); |
| 145 | synthetic_tick = from->synthetic_tick; |
| 146 | const HighsInt fromCount = count = from->count; |
| 147 | const HighsInt* fromIndex = &from->index[0]; |
| 148 | const FromReal* fromArray = &from->array[0]; |
| 149 | for (HighsInt i = 0; i < fromCount; i++) { |
| 150 | const HighsInt iFrom = fromIndex[i]; |
| 151 | const FromReal xFrom = fromArray[iFrom]; |
| 152 | index[i] = iFrom; |
| 153 | array[iFrom] = Real(xFrom); |
| 154 | } |
| 155 | } |
| 156 | template <typename Real> |
| 157 | Real HVectorBase<Real>::norm2() const { |
| 158 | /* |
no test coverage detected