Commit 9bd8ad5e authored by Mathias Goldau's avatar Mathias Goldau
Browse files

[PATCH #190] This commit closes #190, as in WValueSet the minimum was...

[PATCH #190] This commit closes #190, as in WValueSet the minimum was initialized with MAX_DOUBLE which lead to the invalid data. Instead we may use std::numeric_limits< T > and every thing is fine.
parent 83337e9b
...@@ -123,8 +123,8 @@ public: ...@@ -123,8 +123,8 @@ public:
{ {
// calculate min and max // calculate min and max
// Calculating this once simply ensures that it does not need to be recalculated in textures, histograms ... // Calculating this once simply ensures that it does not need to be recalculated in textures, histograms ...
m_minimum = wlimits::MAX_DOUBLE; m_minimum = std::numeric_limits< T >::max();
m_maximum = wlimits::MIN_DOUBLE; m_maximum = std::numeric_limits< T >::min();
for( typename std::vector< T >::const_iterator iter = data->begin(); iter != data->end(); ++iter ) for( typename std::vector< T >::const_iterator iter = data->begin(); iter != data->end(); ++iter )
{ {
m_minimum = m_minimum > *iter ? *iter : m_minimum; m_minimum = m_minimum > *iter ? *iter : m_minimum;
...@@ -145,8 +145,8 @@ public: ...@@ -145,8 +145,8 @@ public:
{ {
// calculate min and max // calculate min and max
// Calculating this once simply ensures that it does not need to be recalculated in textures, histograms ... // Calculating this once simply ensures that it does not need to be recalculated in textures, histograms ...
m_minimum = wlimits::MAX_DOUBLE; m_minimum = std::numeric_limits< T >::max();
m_maximum = wlimits::MIN_DOUBLE; m_maximum = std::numeric_limits< T >::min();
for( typename std::vector< T >::const_iterator iter = data->begin(); iter != data->end(); ++iter ) for( typename std::vector< T >::const_iterator iter = data->begin(); iter != data->end(); ++iter )
{ {
m_minimum = m_minimum > *iter ? *iter : m_minimum; m_minimum = m_minimum > *iter ? *iter : m_minimum;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment