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

Method tight

highs/util/HVectorBase.cpp:82–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80
81template <typename Real>
82void HVectorBase<Real>::tight() {
83 /*
84 * Zero values in Vector.array that do not exceed kHighsTiny in
85 * magnitude, maintaining index if it is well defined
86 */
87 HighsInt totalCount = 0;
88 using std::abs;
89 if (count < 0) {
90 for (auto& val : array)
91 if (abs(val) < kHighsTiny) val = 0;
92 } else {
93 for (HighsInt i = 0; i < count; i++) {
94 const HighsInt my_index = index[i];
95 const Real& value = array[my_index];
96 if (abs(value) >= kHighsTiny) {
97 index[totalCount++] = my_index;
98 } else {
99 array[my_index] = Real{0};
100 }
101 }
102 count = totalCount;
103 }
104}
105
106template <typename Real>
107void HVectorBase<Real>::pack() {

Callers 8

minorUpdateRowsMethod · 0.80
priceByRowWithSwitchMethod · 0.80
rebuildMethod · 0.80
addRowsMethod · 0.80
ftranLMethod · 0.80
btranLMethod · 0.80
ftranUMethod · 0.80
btranUMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected