Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:36:52

0001 // Boost.Geometry
0002 
0003 // Copyright (c) 2015-2020 Oracle and/or its affiliates.
0004 
0005 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
0006 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0007 
0008 // Use, modification and distribution is subject to the Boost Software License,
0009 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0010 // http://www.boost.org/LICENSE_1_0.txt)
0011 
0012 #ifndef BOOST_GEOMETRY_UTIL_HAS_NON_FINITE_COORDINATE_HPP
0013 #define BOOST_GEOMETRY_UTIL_HAS_NON_FINITE_COORDINATE_HPP
0014 
0015 #include <type_traits>
0016 
0017 #include <boost/geometry/core/coordinate_type.hpp>
0018 #include <boost/geometry/util/has_nan_coordinate.hpp>
0019 #include <boost/math/special_functions/fpclassify.hpp>
0020 
0021 namespace boost { namespace geometry
0022 {
0023 
0024 #ifndef DOXYGEN_NO_DETAIL
0025 namespace detail
0026 {
0027 
0028 struct is_not_finite
0029 {
0030     template <typename T>
0031     static inline bool apply(T const& t)
0032     {
0033         return ! boost::math::isfinite(t);
0034     }
0035 };
0036 
0037 } // namespace detail
0038 #endif // DOXYGEN_NO_DETAIL
0039 
0040 template <typename Point>
0041 bool has_non_finite_coordinate(Point const& point)
0042 {
0043     return detail::has_coordinate_with_property
0044         <
0045             Point,
0046             detail::is_not_finite,
0047             std::is_floating_point
0048                 <
0049                     typename coordinate_type<Point>::type
0050                 >::value
0051         >::apply(point);
0052 }
0053 
0054 }} // namespace boost::geometry
0055 
0056 #endif // BOOST_GEOMETRY_UTIL_HAS_NON_FINITE_COORDINATE_HPP