| 125 | } |
| 126 | |
| 127 | void Metadata::PartitionLabel(const std::vector<data_size_t>& used_indices) { |
| 128 | if (used_indices.empty()) { |
| 129 | return; |
| 130 | } |
| 131 | auto old_label = label_; |
| 132 | num_data_ = static_cast<data_size_t>(used_indices.size()); |
| 133 | label_ = std::vector<label_t>(num_data_); |
| 134 | #pragma omp parallel for schedule(static) |
| 135 | for (data_size_t i = 0; i < num_data_; ++i) { |
| 136 | label_[i] = old_label[used_indices[i]]; |
| 137 | } |
| 138 | old_label.clear(); |
| 139 | } |
| 140 | |
| 141 | void Metadata::CheckOrPartition(data_size_t num_all_data, const std::vector<data_size_t>& used_data_indices) { |
| 142 | if (used_data_indices.empty()) { |
no test coverage detected