| 898 | */ |
| 899 | template<typename XAt, typename YAt> |
| 900 | [[nodiscard]] inline bool dsFiniteEnds( |
| 901 | std::size_t n, XAt xAt, YAt yAt, std::size_t& first, std::size_t& last) |
| 902 | { |
| 903 | first = n; |
| 904 | for (std::size_t i = 0; i < n; ++i) { |
| 905 | if (std::isfinite(xAt(i)) && std::isfinite(yAt(i))) { |
| 906 | first = i; |
| 907 | break; |
| 908 | } |
| 909 | } |
| 910 | |
| 911 | if (first == n) |
| 912 | return false; |
| 913 | |
| 914 | last = first; |
| 915 | for (std::size_t i = n; i > first; --i) { |
| 916 | if (std::isfinite(xAt(i - 1)) && std::isfinite(yAt(i - 1))) { |
| 917 | last = i - 1; |
| 918 | break; |
| 919 | } |
| 920 | } |
| 921 | |
| 922 | return true; |
| 923 | } |
| 924 | |
| 925 | /** |
| 926 | * @brief Extracts the global Y bounds from the filled workspace columns (O(columns), |
no test coverage detected