| xgboost | 
| 类型定义 | |
| 使用 | ptrdiff_t = typename std::conditional_t< std::is_same_v< std::ptrdiff_t, std::int64_t >, std::ptrdiff_t, std::int64_t > | 
| 函数 | |
| template<class InputIt1 , class InputIt2 , class Compare = detail::Less<decltype(std::declval<InputIt1>().operator*())>> | |
| XGBOOST_DEVICE bool | LexicographicalCompare (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2) | 
| 使用 xgboost::common::detail::ptrdiff_t = typedef typename std::conditional_t< std::is_same_v<std::ptrdiff_t, std::int64_t>, std::ptrdiff_t, std::int64_t> | 
默认情况下,XGBoost 使用 uint32_t 进行数据索引。int64_t 覆盖了 uint32_t 可以表示的所有值。此外,在 x86-64 Linux 上,GCC 使用 long int 来表示 ptrdiff_t,它就是 int64_t。所以我们在这里将其确定化。
| XGBOOST_DEVICE bool xgboost::common::detail::LexicographicalCompare | ( | InputIt1 | first1, | 
| InputIt1 | last1, | ||
| InputIt2 | first2, | ||
| InputIt2 | last2 | ||
| ) |