Intel® oneAPI Threading Building Blocks Developer Guide and API Reference
proportional split
[algorithms.proportional_split]
Type of an argument for a proportional splitting constructor of Range.
An argument of type proportional_split may be used by classes that satisfy Range requirements to distinguish a proportional splitting constructor from a basic splitting constructor and from a copy constructor, and to suggest a ratio in which a particular instance of the class should be split.
// Defined in header <oneapi/tbb/blocked_range.h>
// Defined in header <oneapi/tbb/blocked_range2d.h>
// Defined in header <oneapi/tbb/blocked_range3d.h>
// Defined in header <oneapi/tbb/blocked_nd_range.h>
// Defined in header <oneapi/tbb/partitioner.h>
// Defined in header <oneapi/tbb/parallel_for.h>
// Defined in header <oneapi/tbb/parallel_reduce.h>
// Defined in header <oneapi/tbb/parallel_scan.h>
namespace oneapi {
namespace tbb {
class proportional_split {
public:
proportional_split(std::size_t _left = 1, std::size_t _right = 1);
std::size_t left() const;
std::size_t right() const;
explicit operator split() const;
};
} // namespace tbb
} // namespace oneapi
Member functions
proportional_split(std::size_t_left=1, std::size_t_right=1)
Constructs a proportion with the ratio specified by coefficients _left and _right.
std::size_tleft()const
Returns the size of the left part of the proportion.
std::size_tright()const
Returns the size of the right part of the proportion.
explicitoperatorsplit()const
Makes proportional_split convertible to the split type to use with ranges that do not support proportional splitting.
See also: