3 #ifndef AWKWARD_UNIONARRAY_H_ 4 #define AWKWARD_UNIONARRAY_H_ 28 const std::vector<FormPtr>& contents);
36 const std::vector<FormPtr>
43 content(int64_t index)
const;
49 tojson_part(
ToJson& builder,
bool verbose)
const override;
52 shallow_copy()
const override;
55 with_form_key(
const FormKey& form_key)
const override;
58 purelist_parameter(
const std::string&
key)
const override;
61 purelist_isregular()
const override;
64 purelist_depth()
const override;
67 dimension_optiontype()
const override;
69 const std::pair<int64_t, int64_t>
70 minmax_depth()
const override;
72 const std::pair<bool, int64_t>
73 branch_depth()
const override;
76 numfields()
const override;
79 fieldindex(
const std::string& key)
const override;
82 key(int64_t fieldindex)
const override;
85 haskey(
const std::string& key)
const override;
87 const std::vector<std::string>
88 keys()
const override;
91 istuple()
const override;
95 bool check_identities,
96 bool check_parameters,
98 bool compatibility_check)
const override;
101 getitem_field(
const std::string& key)
const override;
104 getitem_fields(
const std::vector<std::string>& keys)
const override;
109 const std::vector<FormPtr> contents_;
123 template <
typename T,
typename I>
125 #ifdef AWKWARD_UNIONARRAY_NO_EXTERN_TEMPLATE 132 sparse_index(int64_t
len);
139 static const std::pair<IndexOf<T>,
IndexOf<I>>
140 nested_tags_index(
const Index64& offsets,
141 const std::vector<Index64>& counts);
189 content(int64_t index)
const;
196 project(int64_t index)
const;
211 simplify_uniontype(
bool merge,
bool mergebool)
const;
216 classname()
const override;
219 setidentities()
override;
228 form(
bool materialize)
const override;
231 kernels()
const override;
234 caches(std::vector<ArrayCachePtr>& out)
const override;
237 tostring_part(
const std::string& indent,
238 const std::string& pre,
239 const std::string& post)
const override;
242 tojson_part(
ToJson& builder,
bool include_beginendlist)
const override;
245 nbytes_part(std::map<size_t, int64_t>& largest)
const override;
251 length()
const override;
254 shallow_copy()
const override;
257 deep_copy(
bool copyarrays,
259 bool copyidentities)
const override;
262 check_for_iteration()
const override;
265 getitem_nothing()
const override;
268 getitem_at(int64_t at)
const override;
271 getitem_at_nowrap(int64_t at)
const override;
274 getitem_range(int64_t start, int64_t stop)
const override;
277 getitem_range_nowrap(int64_t start, int64_t stop)
const override;
280 getitem_field(
const std::string&
key)
const override;
283 getitem_field(
const std::string& key,
284 const Slice& only_fields)
const override;
287 getitem_fields(
const std::vector<std::string>&
keys)
const override;
290 getitem_fields(
const std::vector<std::string>& keys,
291 const Slice& only_fields)
const override;
296 const Index64& advanced)
const override;
299 carry(
const Index64& carry,
bool allow_lazy)
const override;
302 purelist_depth()
const override;
304 const std::pair<int64_t, int64_t>
305 minmax_depth()
const override;
307 const std::pair<bool, int64_t>
308 branch_depth()
const override;
311 numfields()
const override;
314 fieldindex(
const std::string& key)
const override;
317 key(int64_t fieldindex)
const override;
320 haskey(
const std::string& key)
const override;
322 const std::vector<std::string>
323 keys()
const override;
326 istuple()
const override;
330 validityerror(
const std::string& path)
const override;
337 shallow_simplify()
const override;
340 num(int64_t axis, int64_t depth)
const override;
342 const std::pair<Index64, ContentPtr>
343 offsets_and_flattened(int64_t axis, int64_t depth)
const override;
346 mergeable(
const ContentPtr& other,
bool mergebool)
const override;
349 referentially_equal(
const ContentPtr& other)
const override;
352 reverse_merge(
const ContentPtr& other)
const override;
354 const std::pair<ContentPtrVec, ContentPtrVec>
355 merging_strategy(
const ContentPtrVec& others)
const override;
361 asslice()
const override;
367 rpad(int64_t target, int64_t axis, int64_t depth)
const override;
370 rpad_and_clip(int64_t target,
372 int64_t depth)
const override;
375 reduce_next(
const Reducer& reducer,
382 bool keepdims)
const override;
385 sort_next(int64_t negaxis,
390 bool stable)
const override;
393 argsort_next(int64_t negaxis,
399 bool stable)
const override;
402 localindex(int64_t axis, int64_t depth)
const override;
410 int64_t depth)
const override;
413 getitem_next(
const SliceAt& at,
415 const Index64& advanced)
const override;
420 const Index64& advanced)
const override;
425 const Index64& advanced)
const override;
430 const Index64& advanced)
const override;
433 getitem_next_jagged(
const Index64& slicestarts,
436 const Slice& tail)
const override;
439 getitem_next_jagged(
const Index64& slicestarts,
442 const Slice& tail)
const override;
445 getitem_next_jagged(
const Index64& slicestarts,
448 const Slice& tail)
const override;
454 numbers_to_type(
const std::string&
name)
const override;
458 is_unique()
const override;
466 is_subrange_equal(
const Index64& start,
const Index64& stop)
const override;
469 template <
typename S>
471 getitem_next_jagged_generic(
const Index64& slicestarts,
473 const S& slicecontent,
474 const Slice& tail)
const;
482 #ifndef AWKWARD_UNIONARRAY_NO_EXTERN_TEMPLATE 493 #endif // AWKWARD_UNIONARRAY_H_ Represents a Python slice object (usual syntax: array[start:stop:step]).
Definition: Slice.h:93
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
const std::string key(const RecordLookupPtr &recordlookup, int64_t fieldindex, int64_t numfields)
Returns the key associated with a field index, given a RecordLookup and a number of fields...
Abstract superclass of all array node types (flat hierarchy). Any Content can be nested within any ot...
Definition: Content.h:276
Definition: BitMaskedArray.h:15
int64_t len(const T &self)
Definition: content.h:46
std::string name(Mapping a, V value)
Definition: datetime_util.h:39
Represents a SliceArrayOf, SliceMissingOf, or SliceJaggedOf with missing values: None (no equivalent ...
Definition: Slice.h:431
Abstract class for all reducer algorithms.
Definition: Reducer.h:20
ERROR combinations(kernel::lib ptr_lib, T *toindex, int64_t n, bool replacement, int64_t singlelen)
const std::vector< std::string > keys(const RecordLookupPtr &recordlookup, int64_t numfields)
Returns a given RecordLookup as keys or generate anonymous ones form a number of fields.
Form
Integer type of an Index, used by ListForm, IndexedForm, etc.
Definition: Index.h:34
std::shared_ptr< std::string > FormKey
Definition: Content.h:19
ERROR unique(kernel::lib ptr_lib, T *toptr, int64_t length, int64_t *tolength)
Represents an array of integers in a slice (possibly converted from an array of booleans).
Definition: Slice.h:225
std::map< std::string, std::string > Parameters
Definition: util.h:165
ERROR copy_to(kernel::lib to_lib, kernel::lib from_lib, void *to_ptr, void *from_ptr, int64_t bytelength)
Internal Function an array buffer from library FROM to library TO, usually between main memory and a ...
std::shared_ptr< Form > FormPtr
Definition: Content.h:18
int64_t fieldindex(const RecordLookupPtr &recordlookup, const std::string &key, int64_t numfields)
Returns the field index associated with a key, given a RecordLookup and a number of fields...
Represents an array of nested lists, where the content may be SliceArrayOf, SliceMissingOf, or SliceJaggedOf (no equivalent in NumPy).
Definition: Slice.h:511
std::vector< std::shared_ptr< Content > > ContentPtrVec
Definition: Content.h:16
Mapping::value_type::value_type value(Mapping a, const std::string &name)
Definition: datetime_util.h:49
A sequence of SliceItem objects representing a tuple passed to Python's __getitem__.
Definition: Slice.h:585
bool haskey(const RecordLookupPtr &recordlookup, const std::string &key, int64_t numfields)
Returns true if a RecordLookup has a given key; false otherwise.
Represents heterogeneous data by interleaving several contents, indicating which is relevant at a giv...
Definition: UnionArray.h:124
std::shared_ptr< Type > TypePtr
Definition: Content.h:23
std::shared_ptr< RecordLookup > RecordLookupPtr
Definition: util.h:130
Represents an integer in a tuple of slices passed to __getitem__ in Python.
Definition: Slice.h:58
std::map< std::string, std::string > TypeStrs
Definition: util.h:215
std::shared_ptr< Identities > IdentitiesPtr
Definition: Identities.h:16
std::shared_ptr< Content > ContentPtr
Definition: ArrayBuilder.h:16
std::shared_ptr< SliceItem > SliceItemPtr
Definition: Slice.h:15
lib
Definition: kernel-dispatch.h:20