region: change MAX to finite numbers

some algorithms react badly to unexpected infinities. using finite
numbers can aleviate this for some problem cases.
This commit is contained in:
Danny Robson 2015-02-16 23:35:50 +11:00
parent f7f84ef6b8
commit 1c7a92ee48

View File

@ -307,15 +307,16 @@ namespace util {
}
//-----------------------------------------------------------------------------
///----------------------------------------------------------------------------
/// The largest specifiable finite region. Specifically does not allow infinities.
template <typename T>
const util::region<T>
util::region<T>::MAX (std::numeric_limits<T>::lowest (),
util::region<T>::MAX (
std::numeric_limits<T>::lowest (),
std::numeric_limits<T>::lowest (),
std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity () :
std::numeric_limits<T>::max (),
std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity () :
std::numeric_limits<T>::max ());
std::numeric_limits<T>::max ()
);
template <typename T>