| 1170 | } |
| 1171 | |
| 1172 | void TCalcScoreFold::SetSampledControl( |
| 1173 | int docCount, |
| 1174 | ESamplingUnit samplingUnit, |
| 1175 | const TVector<TQueryInfo>& queriesInfo, |
| 1176 | TRestorableFastRng64* rand |
| 1177 | ) { |
| 1178 | if (BernoulliSampleRate == 1.0f || IsPairwiseScoring) { |
| 1179 | Fill(Control.begin(), Control.end(), true); |
| 1180 | return; |
| 1181 | } |
| 1182 | if (samplingUnit == ESamplingUnit::Group) { |
| 1183 | for (auto& queryInfo : queriesInfo) { |
| 1184 | auto itBegin = GetDataPtr(Control, queryInfo.Begin); |
| 1185 | auto itEnd = GetDataPtr(Control, queryInfo.End); |
| 1186 | auto isTaken = rand->GenRandReal1() < BernoulliSampleRate; |
| 1187 | Fill(itBegin, itEnd, isTaken); |
| 1188 | } |
| 1189 | } else { |
| 1190 | for (int docIdx = 0; docIdx < docCount; ++docIdx) { |
| 1191 | Control[docIdx] = rand->GenRandReal1() < BernoulliSampleRate; |
| 1192 | } |
| 1193 | } |
| 1194 | } |
| 1195 | |
| 1196 | void TCalcScoreFold::SetControlNoZeroWeighted( |
| 1197 | int docCount, |
nothing calls this directly
no test coverage detected