Awkward Array: include/awkward/partition/IrregularlyPartitionedArray.h Source File

Loading...
Searching...
No Matches
IrregularlyPartitionedArray.h
Go to the documentation of this file.
1// BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
2
3#ifndef AWKWARD_IRREGULARLYPARTITIONEDARRAY_H_
4#define AWKWARD_IRREGULARLYPARTITIONEDARRAY_H_
5
6#include "awkward/partition/PartitionedArray.h"
7
8namespace awkward {
12 class LIBAWKWARD_EXPORT_SYMBOL IrregularlyPartitionedArray: public PartitionedArray {
13 public:
14 IrregularlyPartitionedArray(const ContentPtrVec& partitions,
15 const std::vector<int64_t> stops);
16
23 const std::vector<int64_t>
24 stops() const;
25
26 int64_t
27 start(int64_t partitionid) const override;
28
29 int64_t
30 stop(int64_t partitionid) const override;
31
32 void
33 partitionid_index_at(int64_t at,
34 int64_t& partitionid,
35 int64_t& index) const override;
36
37 PartitionedArrayPtr
38 repartition(const std::vector<int64_t>& stops) const override;
39
40 const std::string
41 classname() const override;
42
43 const std::string
44 tostring() const override;
45
46 int64_t
47 length() const override;
48
49 const PartitionedArrayPtr
50 shallow_copy() const override;
51
52 const PartitionedArrayPtr
53 copy_to(kernel::lib ptr_lib) const override;
54
55 private:
56 const std::vector<int64_t> stops_;
57 };
58}
59
60#endif // AWKWARD_IRREGULARLYPARTITIONEDARRAY_H_
PartitionedArray.h
awkward::IrregularlyPartitionedArray
PartitionedArray of arbitrary length partitions.
Definition: IrregularlyPartitionedArray.h:12
awkward::IrregularlyPartitionedArray::tostring
const std::string tostring() const override
Returns a string representation of this array (multi-line XML).
awkward::IrregularlyPartitionedArray::stop
int64_t stop(int64_t partitionid) const override
Logical stopping index for a given partitionid.
awkward::IrregularlyPartitionedArray::stops
const std::vector< int64_t > stops() const
Logical index where each partition ends.
awkward::IrregularlyPartitionedArray::partitionid_index_at
void partitionid_index_at(int64_t at, int64_t &partitionid, int64_t &index) const override
Gets the partitionid and index for a given logical position in the full array, without handling negat...
awkward::IrregularlyPartitionedArray::length
int64_t length() const override
The length of the full array, summed over all partitions.
awkward::IrregularlyPartitionedArray::copy_to
const PartitionedArrayPtr copy_to(kernel::lib ptr_lib) const override
Recursively copies components of the array from main memory to a GPU (if ptr_lib == kernel::lib::cuda...
awkward::IrregularlyPartitionedArray::shallow_copy
const PartitionedArrayPtr shallow_copy() const override
Copies this node without copying any nodes hierarchically nested within it or any array/index/identit...
awkward::IrregularlyPartitionedArray::start
int64_t start(int64_t partitionid) const override
Logical starting index for a given partitionid.
awkward::IrregularlyPartitionedArray::IrregularlyPartitionedArray
IrregularlyPartitionedArray(const ContentPtrVec &partitions, const std::vector< int64_t > stops)
awkward::IrregularlyPartitionedArray::repartition
PartitionedArrayPtr repartition(const std::vector< int64_t > &stops) const override
Returns this array with a specified (irregular) partitioning.
awkward::IrregularlyPartitionedArray::classname
const std::string classname() const override
User-friendly name of this class.
awkward::PartitionedArray
Abstract superclass of all PartitionedArray node types. PartitionedArrays contain a list of Content,...
Definition: PartitionedArray.h:17
LIBAWKWARD_EXPORT_SYMBOL
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
awkward::kernel::lib
lib
Definition: kernel-dispatch.h:20
awkward
Definition: BitMaskedArray.h:15
awkward::ContentPtrVec
std::vector< std::shared_ptr< Content > > ContentPtrVec
Definition: Content.h:16
awkward::PartitionedArrayPtr
std::shared_ptr< PartitionedArray > PartitionedArrayPtr
Definition: PartitionedArray.h:10