12 using Job = std::pair<const Tool*, std::filesystem::path>;
22 struct iterator:
public std::iterator<std::forward_iterator_tag, T, long, const T*, T&> {
29 iterator(std::size_t k, std::size_t factor,
const std::vector<T>& data):
52 mFactor =
static_cast<std::size_t
>(std::sqrt(
static_cast<double>(
mData.size())));
78 for (
const auto& t:
tools) {
79 for (
const auto& b: benchmarks) {
80 if (t->canHandle(b)) {
81 mJobs.emplace_back(t.get(), b);
102 return mJobs.begin();
A set of benchmarks from some common base directory.
Represents a set of jobs, constructed as the cartesian product of a set of tools and a set of benchma...
const BenchmarkSet & mFiles
const auto & files() const
Returns the set of files.
auto begin() const
Begin iterator.
Jobs(const Tools &tools, const BenchmarkSet &benchmarks)
Construct jobs from a set of tools and a set of benchmark files.
auto size() const
Returns the overall number of jobs.
auto end() const
End iterator.
const auto & tools() const
Returns the set of tools.
auto randomized() const
Returns all jobs in a pseudo-randomized order.
Provides iteration over a given std::vector in a pseudo-randomized order.
const std::vector< T > & mData
RandomizationAdaptor(const std::vector< T > &data)
Construct a randomized view on the given vector.
auto end() const
Return end of the randomized range.
auto begin() const
Return begin of the randomized range.
std::pair< const Tool *, std::filesystem::path > Job
Typedef for a job, consisting of a tool and an input file.
std::vector< ToolPtr > Tools
A vector of ToolPtr.
Numeric gcd(const Numeric &_valueA, const Numeric &_valueB)
Calculates the greatest common divisor of the two arguments.
bool operator!=(const iterator &rhs) const
Compare two iterators.
iterator(std::size_t k, std::size_t factor, const std::vector< T > &data)
Create a randomized iterator.
iterator & operator++()
Increment iterator.
const T & operator*()
Dereference iterator.
const std::vector< T > & mData