diff options
Diffstat (limited to 'src/Partitioning.h')
-rw-r--r-- | src/Partitioning.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Partitioning.h b/src/Partitioning.h index 11c64bc83..195daae9b 100644 --- a/src/Partitioning.h +++ b/src/Partitioning.h @@ -122,6 +122,26 @@ public: stepPartition++; } + void InsertPartitions(T partition, const T *positions, size_t length) { + if (stepPartition < partition) { + ApplyStep(partition); + } + body->InsertFromArray(partition, positions, 0, length); + stepPartition += static_cast<T>(length); + } + + void InsertPartitionsWithCast(T partition, const ptrdiff_t *positions, size_t length) { + // Used for 64-bit builds when T is 32-bits + if (stepPartition < partition) { + ApplyStep(partition); + } + T *pInsertion = body->InsertEmpty(partition, length); + for (size_t i = 0; i < length; i++) { + pInsertion[i] = static_cast<T>(positions[i]); + } + stepPartition += static_cast<T>(length); + } + void SetPartitionStartPosition(T partition, T pos) noexcept { ApplyStep(partition+1); if ((partition < 0) || (partition > body->Length())) { |