MCPcopy Create free account
hub / github.com/Kitware/VTK / UpdateRange

Function UpdateRange

Common/Core/vtkMathUtilities.h:103–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101 */
102template <class A>
103inline void UpdateRange(A& min, A& max, const A& value)
104{
105 if constexpr (std::is_floating_point_v<A>)
106 {
107 if (VTK_UNLIKELY(std::isnan(value)))
108 {
109 return;
110 }
111 }
112 if (value < min)
113 {
114 min = value;
115 max = std::max(max, value);
116 }
117 else if (value > max)
118 {
119 min = std::min(min, value);
120 max = value;
121 }
122}
123
124/**
125 * Update an existing min - max range with a new prospective value. If the

Callers

nothing calls this directly

Calls 3

isnanFunction · 0.70
maxFunction · 0.50
minFunction · 0.50

Tested by

no test coverage detected