| 98 | |
| 99 | template <class TColumn, typename TBucketIndexType> |
| 100 | inline static void ExtractBucketIndex( |
| 101 | const TCalcScoreFold& fold, |
| 102 | const TColumn& column, |
| 103 | bool isEstimatedData, |
| 104 | bool isOnlineData, |
| 105 | TIndexRange<ui32> docIndexRange, |
| 106 | int groupSize, |
| 107 | const TVector<ui32>& groupPartsBucketsOffsets, |
| 108 | TVector<TBucketIndexType>* bucketIdx // already of proper size |
| 109 | ) { |
| 110 | if (const auto* denseColumnData |
| 111 | = dynamic_cast<const TCompressedValuesHolderImpl<TColumn>*>(&column)) |
| 112 | { |
| 113 | const ui32* objectIndexing; |
| 114 | int beginOffset; |
| 115 | GetIndexingParams(fold, isEstimatedData, isOnlineData, &objectIndexing, &beginOffset); |
| 116 | |
| 117 | const TCompressedArray& compressedArray = *denseColumnData->GetCompressedData().GetSrc(); |
| 118 | |
| 119 | compressedArray.DispatchBitsPerKeyToDataType( |
| 120 | "ExtractBucketIndex", |
| 121 | [&] (const auto* columnData) { |
| 122 | SetBucketIndex( |
| 123 | columnData, |
| 124 | objectIndexing, |
| 125 | beginOffset, |
| 126 | docIndexRange, |
| 127 | groupSize, |
| 128 | groupPartsBucketsOffsets, |
| 129 | bucketIdx |
| 130 | ); |
| 131 | } |
| 132 | ); |
| 133 | } else { |
| 134 | CB_ENSURE(false, "ExtractBucketIndex: unexpected column type"); |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | |
| 139 | // Calculate index of leaf for each document given a new split ensemble. |
no test coverage detected