3#ifndef AWKWARD_PARTITIONEDARRAY_H_
4#define AWKWARD_PARTITIONEDARRAY_H_
9 class PartitionedArray;
40 start(int64_t partitionid)
const = 0;
44 stop(int64_t partitionid)
const = 0;
51 int64_t& index)
const = 0;
58 virtual const std::string
69 virtual const std::string
84 tojson(
bool pretty, int64_t maxdecimals)
const;
104 int64_t buffersize)
const;
Abstract superclass of all PartitionedArray node types. PartitionedArrays contain a list of Content,...
Definition: PartitionedArray.h:17
virtual const PartitionedArrayPtr copy_to(kernel::lib ptr_lib) const =0
Recursively copies components of the array from main memory to a GPU (if ptr_lib == kernel::lib::cuda...
const std::string tojson(bool pretty, int64_t maxdecimals) const
Returns a JSON representation of this array.
virtual int64_t start(int64_t partitionid) const =0
Logical starting index for a given partitionid.
const ContentPtrVec partitions() const
The partitions as a std::vector<std::shared_ptr<Content>>.
const ContentPtr getitem_at(int64_t at) const
Returns the element at a given position in the array, handling negative indexing and bounds-checking ...
int64_t numpartitions() const
The number of partitions in this array.
virtual const std::string tostring() const =0
Returns a string representation of this array (multi-line XML).
const PartitionedArrayPtr getitem_range_nowrap(int64_t start, int64_t stop, int64_t step) const
Subinterval of this array, without handling negative indexing or bounds-checking.
virtual PartitionedArrayPtr repartition(const std::vector< int64_t > &stops) const =0
Returns this array with a specified (irregular) partitioning.
virtual int64_t stop(int64_t partitionid) const =0
Logical stopping index for a given partitionid.
void tojson(FILE *destination, bool pretty, int64_t maxdecimals, int64_t buffersize) const
Writes a JSON representation of this array to a destination file.
const ContentPtrVec partitions_
Definition: PartitionedArray.h:163
virtual const std::string classname() const =0
User-friendly name of this class.
virtual const PartitionedArrayPtr shallow_copy() const =0
Copies this node without copying any nodes hierarchically nested within it or any array/index/identit...
virtual void partitionid_index_at(int64_t at, int64_t &partitionid, int64_t &index) const =0
Gets the partitionid and index for a given logical position in the full array, without handling negat...
virtual ~PartitionedArray()
Virtual destructor acts as a first non-inline virtual function that determines a specific translation...
PartitionedArray(const ContentPtrVec &partitions)
const PartitionedArrayPtr getitem_range(int64_t start, int64_t stop, int64_t step) const
Subinterval of this array, handling negative indexing and bounds-checking like Python.
const ContentPtr getitem_at_nowrap(int64_t at) const
Returns the element at a given position in the array, without handling negative indexing or bounds-ch...
const ContentPtr partition(int64_t partitionid) const
Returns a single partition as a std::shared_ptr<Content>.
virtual int64_t length() const =0
The length of the full array, summed over all partitions.
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
lib
Definition: kernel-dispatch.h:20
Definition: BitMaskedArray.h:15
std::vector< std::shared_ptr< Content > > ContentPtrVec
Definition: Content.h:16
std::shared_ptr< Content > ContentPtr
Definition: Content.h:15
std::shared_ptr< PartitionedArray > PartitionedArrayPtr
Definition: PartitionedArray.h:10