| 5 | #include <numeric> |
| 6 | |
| 7 | void NCatboostCuda::TDataPermutation::FillOrder(TVector<ui32>& order) const { |
| 8 | if (Index != IdentityPermutationId()) { |
| 9 | if (DataProvider->MetaInfo.HasGroupId && !DataProvider->ObjectsGrouping->IsTrivial()) { |
| 10 | GenerateQueryDocsOrder(GetSeed(), BlockSize, DataProvider->ObjectsGrouping->GetNonTrivialGroups(), &order); |
| 11 | } else { |
| 12 | Shuffle(GetSeed(), BlockSize, DataProvider->GetObjectCount(), &order); |
| 13 | } |
| 14 | } else { |
| 15 | order.resize(DataProvider->GetObjectCount()); |
| 16 | std::iota(order.begin(), order.end(), 0); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | void NCatboostCuda::TDataPermutation::FillGroupOrder(TVector<ui32>& groupOrder) const { |
| 21 | CB_ENSURE_INTERNAL(DataProvider->MetaInfo.HasGroupId, "FillGroupOrder supports only datasets with group ids"); |