| 1303 | } |
| 1304 | |
| 1305 | void vtkGenerateStatistics::PrepareAlgorithmRequests( |
| 1306 | const std::vector<vtkSmartPointer<vtkAbstractArray>>& columns) |
| 1307 | { |
| 1308 | int mm = static_cast<int>(columns.size()); |
| 1309 | int nn = this->StatisticsAlgorithm->GetMaximumNumberOfColumnsPerRequest(); |
| 1310 | this->StatisticsAlgorithm->ResetRequests(); |
| 1311 | if (nn > 0 && mm > nn) |
| 1312 | { |
| 1313 | auto* combo = vtkMath::BeginCombination(mm, nn); |
| 1314 | for (int more = 1; more && combo; more = vtkMath::NextCombination(mm, nn, combo)) |
| 1315 | { |
| 1316 | this->StatisticsAlgorithm->ResetAllColumnStates(); |
| 1317 | for (int ii = 0; ii < nn; ++ii) |
| 1318 | { |
| 1319 | this->StatisticsAlgorithm->SetColumnStatus(columns[combo[ii]]->GetName(), true); |
| 1320 | } |
| 1321 | this->StatisticsAlgorithm->RequestSelectedColumns(); |
| 1322 | } |
| 1323 | vtkMath::FreeCombination(combo); |
| 1324 | } |
| 1325 | else |
| 1326 | { |
| 1327 | this->StatisticsAlgorithm->ResetAllColumnStates(); |
| 1328 | for (const auto& column : columns) |
| 1329 | { |
| 1330 | this->StatisticsAlgorithm->SetColumnStatus(column->GetName(), true); |
| 1331 | } |
| 1332 | this->StatisticsAlgorithm->RequestSelectedColumns(); |
| 1333 | } |
| 1334 | } |
| 1335 | |
| 1336 | vtkIdType vtkGenerateStatistics::GetNumberOfObservationsForTraining(vtkIdType N) |
| 1337 | { |
no test coverage detected