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

Method copy

highs/util/HVectorBase.cpp:138–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136template <typename Real>
137template <typename FromReal>
138void 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}
156template <typename Real>
157Real HVectorBase<Real>::norm2() const {
158 /*

Callers 6

iterateTasksMethod · 0.45
basis.cppFile · 0.45
btranMethod · 0.45
ftranMethod · 0.45

Calls 1

clearFunction · 0.85

Tested by

no test coverage detected