Awkward Array: include/awkward/array/IndexedArray.h Source File

Loading...
Searching...
No Matches
IndexedArray.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_INDEXEDARRAY_H_
4#define AWKWARD_INDEXEDARRAY_H_
5
6#include <string>
7#include <memory>
8#include <vector>
9
10#include "awkward/common.h"
11#include "awkward/Slice.h"
12#include "awkward/Index.h"
13#include "awkward/Content.h"
14
15namespace awkward {
19 class LIBAWKWARD_EXPORT_SYMBOL IndexedForm: public Form {
20 public:
23 IndexedForm(bool has_identities,
24 const util::Parameters& parameters,
25 const FormKey& form_key,
26 Index::Form index,
27 const FormPtr& content);
28
29 Index::Form
30 index() const;
31
32 const FormPtr
33 content() const;
34
35 const TypePtr
36 type(const util::TypeStrs& typestrs) const override;
37
38 void
39 tojson_part(ToJson& builder, bool verbose) const override;
40
41 const FormPtr
42 shallow_copy() const override;
43
44 const FormPtr
45 with_form_key(const FormKey& form_key) const override;
46
47 const std::string
48 purelist_parameter(const std::string& key) const override;
49
50 bool
51 purelist_isregular() const override;
52
53 int64_t
54 purelist_depth() const override;
55
56 bool
57 dimension_optiontype() const override;
58
59 const std::pair<int64_t, int64_t>
60 minmax_depth() const override;
61
62 const std::pair<bool, int64_t>
63 branch_depth() const override;
64
65 int64_t
66 numfields() const override;
67
68 int64_t
69 fieldindex(const std::string& key) const override;
70
71 const std::string
72 key(int64_t fieldindex) const override;
73
74 bool
75 haskey(const std::string& key) const override;
76
77 const std::vector<std::string>
78 keys() const override;
79
80 bool
81 istuple() const override;
82
83 bool
84 equal(const FormPtr& other,
85 bool check_identities,
86 bool check_parameters,
87 bool check_form_key,
88 bool compatibility_check) const override;
89
90 const FormPtr
91 getitem_field(const std::string& key) const override;
92
93 const FormPtr
94 getitem_fields(const std::vector<std::string>& keys) const override;
95
96 const FormPtr
97 simplify_optiontype() const;
98
99 private:
100 Index::Form index_;
101 const FormPtr content_;
102 };
103
107 class LIBAWKWARD_EXPORT_SYMBOL IndexedOptionForm: public Form {
108 public:
110 IndexedOptionForm(bool has_identities,
111 const util::Parameters& parameters,
112 const FormKey& form_key,
113 Index::Form index,
114 const FormPtr& content);
115
116 Index::Form index() const;
117
118 const FormPtr content() const;
119
120 const TypePtr
121 type(const util::TypeStrs& typestrs) const override;
122
123 void
124 tojson_part(ToJson& builder, bool verbose) const override;
125
126 const FormPtr
127 shallow_copy() const override;
128
129 const FormPtr
130 with_form_key(const FormKey& form_key) const override;
131
132 const std::string
133 purelist_parameter(const std::string& key) const override;
134
135 bool
136 purelist_isregular() const override;
137
138 int64_t
139 purelist_depth() const override;
140
141 bool
142 dimension_optiontype() const override;
143
144 const std::pair<int64_t, int64_t>
145 minmax_depth() const override;
146
147 const std::pair<bool, int64_t>
148 branch_depth() const override;
149
150 int64_t
151 numfields() const override;
152
153 int64_t
154 fieldindex(const std::string& key) const override;
155
156 const std::string
157 key(int64_t fieldindex) const override;
158
159 bool
160 haskey(const std::string& key) const override;
161
162 const std::vector<std::string>
163 keys() const override;
164
165 bool
166 istuple() const override;
167
168 bool
169 equal(const FormPtr& other,
170 bool check_identities,
171 bool check_parameters,
172 bool check_form_key,
173 bool compatibility_check) const override;
174
175 const FormPtr
176 getitem_field(const std::string& key) const override;
177
178 const FormPtr
179 getitem_fields(const std::vector<std::string>& keys) const override;
180
181 const FormPtr
182 simplify_optiontype() const;
183
184 private:
185 Index::Form index_;
186 const FormPtr content_;
187 };
188
199 template <typename T, bool ISOPTION>
200 class
201#ifdef AWKWARD_INDEXEDARRAY_NO_EXTERN_TEMPLATE
202 LIBAWKWARD_EXPORT_SYMBOL
203#endif
204 IndexedArrayOf: public Content {
205 public:
221 IndexedArrayOf<T, ISOPTION>(const IdentitiesPtr& identities,
222 const util::Parameters& parameters,
223 const IndexOf<T>& index,
224 const ContentPtr& content);
225
232 const IndexOf<T>
233 index() const;
234
239 const ContentPtr
240 content() const;
241
244 bool
245 isoption() const;
246
249 const ContentPtr
250 project() const;
251
256 const ContentPtr
257 project(const Index8& mask) const;
258
262 const Index8
263 bytemask() const;
264
271 const ContentPtr
272 simplify_optiontype() const;
273
275 T
276 index_at_nowrap(int64_t at) const;
277
281 const std::string
282 classname() const override;
283
284 void
285 setidentities() override;
286
287 void
288 setidentities(const IdentitiesPtr& identities) override;
289
290 const TypePtr
291 type(const util::TypeStrs& typestrs) const override;
292
293 const FormPtr
294 form(bool materialize) const override;
295
296 kernel::lib
297 kernels() const override;
298
299 void
300 caches(std::vector<ArrayCachePtr>& out) const override;
301
302 const std::string
303 tostring_part(const std::string& indent,
304 const std::string& pre,
305 const std::string& post) const override;
306
307 void
308 tojson_part(ToJson& builder, bool include_beginendlist) const override;
309
310 void
311 nbytes_part(std::map<size_t, int64_t>& largest) const override;
312
316 int64_t
317 length() const override;
318
319 const ContentPtr
320 shallow_copy() const override;
321
322 const ContentPtr
323 deep_copy(bool copyarrays,
324 bool copyindexes,
325 bool copyidentities) const override;
326
327 void
328 check_for_iteration() const override;
329
330 const ContentPtr
331 getitem_nothing() const override;
332
333 const ContentPtr
334 getitem_at(int64_t at) const override;
335
336 const ContentPtr
337 getitem_at_nowrap(int64_t at) const override;
338
339 const ContentPtr
340 getitem_range(int64_t start, int64_t stop) const override;
341
342 const ContentPtr
343 getitem_range_nowrap(int64_t start, int64_t stop) const override;
344
345 const ContentPtr
346 getitem_field(const std::string& key) const override;
347
348 const ContentPtr
349 getitem_field(const std::string& key,
350 const Slice& only_fields) const override;
351
352 const ContentPtr
353 getitem_fields(const std::vector<std::string>& keys) const override;
354
355 const ContentPtr
356 getitem_fields(const std::vector<std::string>& keys,
357 const Slice& only_fields) const override;
358
359 const ContentPtr
360 getitem_next(const SliceItemPtr& head,
361 const Slice& tail,
362 const Index64& advanced) const override;
363
364 const ContentPtr
365 carry(const Index64& carry, bool allow_lazy) const override;
366
367 int64_t
368 purelist_depth() const override;
369
370 const std::pair<int64_t, int64_t>
371 minmax_depth() const override;
372
373 const std::pair<bool, int64_t>
374 branch_depth() const override;
375
376 int64_t
377 numfields() const override;
378
379 int64_t
380 fieldindex(const std::string& key) const override;
381
382 const std::string
383 key(int64_t fieldindex) const override;
384
385 bool
386 haskey(const std::string& key) const override;
387
388 const std::vector<std::string>
389 keys() const override;
390
391 bool
392 istuple() const override;
393
394 // operations
395 const std::string
396 validityerror(const std::string& path) const override;
397
403 const ContentPtr
404 shallow_simplify() const override;
405
406 const ContentPtr
407 num(int64_t axis, int64_t depth) const override;
408
409 const std::pair<Index64, ContentPtr>
410 offsets_and_flattened(int64_t axis, int64_t depth) const override;
411
412 bool
413 mergeable(const ContentPtr& other, bool mergebool) const override;
414
415 bool
416 referentially_equal(const ContentPtr& other) const override;
417
418 const ContentPtr
419 reverse_merge(const ContentPtr& other) const override;
420
421 const std::pair<ContentPtrVec, ContentPtrVec>
422 merging_strategy(const ContentPtrVec& others) const override;
423
424 const ContentPtr
425 mergemany(const ContentPtrVec& others) const override;
426
427 const SliceItemPtr
428 asslice() const override;
429
430 const ContentPtr
431 fillna(const ContentPtr& value) const override;
432
433 const ContentPtr
434 rpad(int64_t target, int64_t axis, int64_t depth) const override;
435
436 const ContentPtr
437 rpad_and_clip(int64_t target,
438 int64_t axis,
439 int64_t depth) const override;
440
441 const ContentPtr
442 reduce_next(const Reducer& reducer,
443 int64_t negaxis,
444 const Index64& starts,
445 const Index64& shifts,
446 const Index64& parents,
447 int64_t outlength,
448 bool mask,
449 bool keepdims) const override;
450
451 const ContentPtr
452 sort_next(int64_t negaxis,
453 const Index64& starts,
454 const Index64& parents,
455 int64_t outlength,
456 bool ascending,
457 bool stable) const override;
458
459 const ContentPtr
460 argsort_next(int64_t negaxis,
461 const Index64& starts,
462 const Index64& shifts,
463 const Index64& parents,
464 int64_t outlength,
465 bool ascending,
466 bool stable) const override;
467
468 const ContentPtr
469 localindex(int64_t axis, int64_t depth) const override;
470
471 const ContentPtr
472 combinations(int64_t n,
473 bool replacement,
474 const util::RecordLookupPtr& recordlookup,
475 const util::Parameters& parameters,
476 int64_t axis,
477 int64_t depth) const override;
478
479 const ContentPtr
480 getitem_next(const SliceAt& at,
481 const Slice& tail,
482 const Index64& advanced) const override;
483
484 const ContentPtr
485 getitem_next(const SliceRange& range,
486 const Slice& tail,
487 const Index64& advanced) const override;
488
489 const ContentPtr
490 getitem_next(const SliceArray64& array,
491 const Slice& tail,
492 const Index64& advanced) const override;
493
494 const ContentPtr
495 getitem_next(const SliceJagged64& jagged,
496 const Slice& tail,
497 const Index64& advanced) const override;
498
499 const ContentPtr
500 getitem_next_jagged(const Index64& slicestarts,
501 const Index64& slicestops,
502 const SliceArray64& slicecontent,
503 const Slice& tail) const override;
504
505 const ContentPtr
506 getitem_next_jagged(const Index64& slicestarts,
507 const Index64& slicestops,
508 const SliceMissing64& slicecontent,
509 const Slice& tail) const override;
510
511 const ContentPtr
512 getitem_next_jagged(const Index64& slicestarts,
513 const Index64& slicestops,
514 const SliceJagged64& slicecontent,
515 const Slice& tail) const override;
516
517 const ContentPtr
518 copy_to(kernel::lib ptr_lib) const override;
519
520 const ContentPtr
521 numbers_to_type(const std::string& name) const override;
522
524 bool
525 is_unique() const override;
526
528 const ContentPtr
529 unique() const override;
530
532 bool
533 is_subrange_equal(const Index64& start, const Index64& stop) const override;
534
535 protected:
536 template <typename S>
537 const ContentPtr
538 getitem_next_jagged_generic(const Index64& slicestarts,
539 const Index64& slicestops,
540 const S& slicecontent,
541 const Slice& tail) const;
542
543 const std::pair<Index64, IndexOf<T>>
544 nextcarry_outindex(int64_t& numnull) const;
545
546 private:
548 const IndexOf<T> index_;
550 const ContentPtr content_;
551 };
552
553#ifndef AWKWARD_INDEXEDARRAY_NO_EXTERN_TEMPLATE
554 extern template class IndexedArrayOf<int32_t, false>;
555 extern template class IndexedArrayOf<uint32_t, false>;
556 extern template class IndexedArrayOf<int64_t, false>;
557 extern template class IndexedArrayOf<int32_t, true>;
558 extern template class IndexedArrayOf<int64_t, true>;
559#endif
560
561 using IndexedArray32 = IndexedArrayOf<int32_t, false>;
562 using IndexedArrayU32 = IndexedArrayOf<uint32_t, false>;
563 using IndexedArray64 = IndexedArrayOf<int64_t, false>;
564 using IndexedOptionArray32 = IndexedArrayOf<int32_t, true>;
565 using IndexedOptionArray64 = IndexedArrayOf<int64_t, true>;
566}
567
568#endif // AWKWARD_INDEXEDARRAY_H_
Content.h
Index.h
Slice.h
awkward::Content
Abstract superclass of all array node types (flat hierarchy). Any Content can be nested within any ot...
Definition: Content.h:276
awkward::Form
Abstract superclass of all array node forms, which expresses the nesting structure without any large ...
Definition: Content.h:39
awkward::IndexOf
A contiguous, one-dimensional array of integers used to represent data structures,...
Definition: Index.h:82
awkward::Index::Form
Form
Integer type of an Index, used by ListForm, IndexedForm, etc.
Definition: Index.h:34
awkward::IndexedArrayOf
Filters, rearranges, and/or duplicates items in its content through an index, which has the same effe...
Definition: IndexedArray.h:204
awkward::IndexedArrayOf::purelist_depth
int64_t purelist_depth() const override
The list-depth of this array, not counting any contained within a RecordArray.
awkward::IndexedArrayOf::argsort_next
const ContentPtr argsort_next(int64_t negaxis, const Index64 &starts, const Index64 &shifts, const Index64 &parents, int64_t outlength, bool ascending, bool stable) const override
This array sorted indices.
awkward::IndexedArrayOf::bytemask
const Index8 bytemask() const
Returns an Index8 in which each byte represents missing values with 1 and non-missing values with 0....
awkward::IndexedArrayOf::caches
void caches(std::vector< ArrayCachePtr > &out) const override
Accumulates all the unique #ArrayCache objects from nested #VirtualArray nodes. (Uniqueness is determ...
awkward::IndexedArrayOf::getitem_fields
const ContentPtr getitem_fields(const std::vector< std::string > &keys) const override
This array with the first nested RecordArray replaced by a RecordArray of a given subset of keys.
awkward::IndexedArrayOf::getitem_next_jagged
const ContentPtr getitem_next_jagged(const Index64 &slicestarts, const Index64 &slicestops, const SliceArray64 &slicecontent, const Slice &tail) const override
Internal function that propagates a jagged array (array with irregular-length dimensions) slice throu...
awkward::IndexedArrayOf::getitem_at
const ContentPtr getitem_at(int64_t at) const override
Returns the element at a given position in the array, handling negative indexing and bounds-checking ...
awkward::IndexedArrayOf::setidentities
void setidentities() override
Assign a surrogate index of Identities to this array (in-place).
awkward::IndexedArrayOf::index
const IndexOf< T > index() const
Item positions to be filtered, rearranged, duplicated, or masked as None.
awkward::IndexedArrayOf::merging_strategy
const std::pair< ContentPtrVec, ContentPtrVec > merging_strategy(const ContentPtrVec &others) const override
Partitions this array plus a list of others into a head sequence and a tail sequence:
awkward::IndexedArrayOf::getitem_field
const ContentPtr getitem_field(const std::string &key, const Slice &only_fields) const override
awkward::IndexedArrayOf::isoption
bool isoption() const
Returns true if this array is an IndexedOptionArray32 or IndexedOptionArray64.
awkward::IndexedArrayOf::getitem_next
const ContentPtr getitem_next(const SliceArray64 &array, const Slice &tail, const Index64 &advanced) const override
Internal function that propagates a generic getitem request through one axis (including advanced inde...
awkward::IndexedArrayOf::unique
const ContentPtr unique() const override
Returns an array where all components are unique.
awkward::IndexedArrayOf::sort_next
const ContentPtr sort_next(int64_t negaxis, const Index64 &starts, const Index64 &parents, int64_t outlength, bool ascending, bool stable) const override
This array sorted.
awkward::IndexedArrayOf::reverse_merge
const ContentPtr reverse_merge(const ContentPtr &other) const override
Merges a single other with this array in reverse order: other first, this last.
awkward::IndexedArrayOf::project
const ContentPtr project() const
Eagerly applies the index as a carry, removing None elements if an IndexedOptionArray.
awkward::IndexedArrayOf::tojson_part
void tojson_part(ToJson &builder, bool include_beginendlist) const override
Internal function to produce a JSON representation one node at a time.
awkward::IndexedArrayOf::getitem_fields
const ContentPtr getitem_fields(const std::vector< std::string > &keys, const Slice &only_fields) const override
awkward::IndexedArrayOf::length
int64_t length() const override
The number of elements in the array.
awkward::IndexedArrayOf::deep_copy
const ContentPtr deep_copy(bool copyarrays, bool copyindexes, bool copyidentities) const override
Copies this node and all nodes hierarchically nested within it, optionally copying the associated arr...
awkward::IndexedArrayOf::validityerror
const std::string validityerror(const std::string &path) const override
Returns an error message if this array is invalid; otherwise, returns an empty string.
awkward::IndexedArrayOf::getitem_next
const ContentPtr getitem_next(const SliceAt &at, const Slice &tail, const Index64 &advanced) const override
Internal function that propagates a generic getitem request through one axis (including advanced inde...
awkward::IndexedArrayOf::istuple
bool istuple() const override
Returns true if the outermost RecordArray is a tuple.
awkward::IndexedArrayOf::getitem_nothing
const ContentPtr getitem_nothing() const override
Internal function to get an empty slice (with the correct type).
awkward::IndexedArrayOf::kernels
kernel::lib kernels() const override
Returns the kernel library enum for all nested ptr_lib within the array's tree structure....
awkward::IndexedArrayOf::carry
const ContentPtr carry(const Index64 &carry, bool allow_lazy) const override
Returns an array of the same type with elements filtered, rearranged, and possibly duplicated by the ...
awkward::IndexedArrayOf::combinations
const ContentPtr combinations(int64_t n, bool replacement, const util::RecordLookupPtr &recordlookup, const util::Parameters &parameters, int64_t axis, int64_t depth) const override
Tuples or records of all n-tuple combinations of list items at some axis depth.
awkward::IndexedArrayOf::setidentities
void setidentities(const IdentitiesPtr &identities) override
Assign a specified set of Identities to this array (in-place).
awkward::IndexedArrayOf::localindex
const ContentPtr localindex(int64_t axis, int64_t depth) const override
A (possibly nested) array of integers indicating the positions of elements within each nested list.
awkward::IndexedArrayOf::getitem_range_nowrap
const ContentPtr getitem_range_nowrap(int64_t start, int64_t stop) const override
Subinterval of this array, without handling negative indexing or bounds-checking.
awkward::IndexedArrayOf::offsets_and_flattened
const std::pair< Index64, ContentPtr > offsets_and_flattened(int64_t axis, int64_t depth) const override
Returns (a) an offsets Index and (b) a flattened version of the array at some axis depth.
awkward::IndexedArrayOf::fieldindex
int64_t fieldindex(const std::string &key) const override
The position of a tuple or record key name if this array contains a RecordArray.
awkward::IndexedArrayOf::check_for_iteration
void check_for_iteration() const override
Performs up-front validity checks on an array so that they don't have to be checked in getitem_at_now...
awkward::IndexedArrayOf::keys
const std::vector< std::string > keys() const override
A list of RecordArray keys or an empty list if this array does not contain a RecordArray.
awkward::IndexedArrayOf::getitem_next_jagged_generic
const ContentPtr getitem_next_jagged_generic(const Index64 &slicestarts, const Index64 &slicestops, const S &slicecontent, const Slice &tail) const
awkward::IndexedArrayOf::getitem_field
const ContentPtr getitem_field(const std::string &key) const override
This array with the first nested RecordArray replaced by the field at key.
awkward::IndexedArrayOf::nextcarry_outindex
const std::pair< Index64, IndexOf< T > > nextcarry_outindex(int64_t &numnull) const
awkward::IndexedArrayOf::branch_depth
const std::pair< bool, int64_t > branch_depth() const override
Returns (a) whether the list-depth of this array "branches," or differs when followed through differe...
awkward::IndexedArrayOf::rpad
const ContentPtr rpad(int64_t target, int64_t axis, int64_t depth) const override
If axis = 0, returns a view of this array padded on the right with None values to have a minimum leng...
awkward::IndexedArrayOf::getitem_next
const ContentPtr getitem_next(const SliceItemPtr &head, const Slice &tail, const Index64 &advanced) const override
Internal function that propagates a generic getitem request through one axis (including advanced inde...
awkward::IndexedArrayOf::getitem_at_nowrap
const ContentPtr getitem_at_nowrap(int64_t at) const override
Returns the element at a given position in the array, without handling negative indexing or bounds-ch...
awkward::IndexedArrayOf::nbytes_part
void nbytes_part(std::map< size_t, int64_t > &largest) const override
Internal function used to calculate nbytes.
awkward::IndexedArrayOf::mergemany
const ContentPtr mergemany(const ContentPtrVec &others) const override
Returns an array with this and the others concatenated (in order, this first, others last).
awkward::IndexedArrayOf::key
const std::string key(int64_t fieldindex) const override
The record name associated with a given field index or the tuple index as a string (e....
awkward::IndexedArrayOf::index_at_nowrap
T index_at_nowrap(int64_t at) const
Returns the value of index at a given position.
awkward::IndexedArrayOf::shallow_copy
const ContentPtr shallow_copy() const override
Copies this node without copying any nodes hierarchically nested within it or any array/index/identit...
awkward::IndexedArrayOf::minmax_depth
const std::pair< int64_t, int64_t > minmax_depth() const override
Returns (a) the minimum list-depth and (b) the maximum list-depth of the array, which can differ if t...
awkward::IndexedArrayOf::is_unique
bool is_unique() const override
Returns 'true' if all components of the array are unique.
awkward::IndexedArrayOf::form
const FormPtr form(bool materialize) const override
Low-level Form describing all the features of this array except the actual data buffers (Index,...
awkward::IndexedArrayOf::asslice
const SliceItemPtr asslice() const override
Converts this array into a SliceItem that can be used in getitem.
awkward::IndexedArrayOf::tostring_part
const std::string tostring_part(const std::string &indent, const std::string &pre, const std::string &post) const override
Internal function to build an output string for tostring.
awkward::IndexedArrayOf::rpad_and_clip
const ContentPtr rpad_and_clip(int64_t target, int64_t axis, int64_t depth) const override
If axis = 0, returns a view of this array padded on the right.
awkward::IndexedArrayOf::getitem_next
const ContentPtr getitem_next(const SliceJagged64 &jagged, const Slice &tail, const Index64 &advanced) const override
Internal function that propagates a generic getitem request through one axis (including advanced inde...
awkward::IndexedArrayOf::getitem_range
const ContentPtr getitem_range(int64_t start, int64_t stop) const override
Subinterval of this array, handling negative indexing and bounds-checking like Python.
awkward::IndexedArrayOf::is_subrange_equal
bool is_subrange_equal(const Index64 &start, const Index64 &stop) const override
Returns 'true' if subranges are equal.
awkward::IndexedArrayOf::fillna
const ContentPtr fillna(const ContentPtr &value) const override
Returns this array with None values replaced by a given value.
awkward::IndexedArrayOf::numfields
int64_t numfields() const override
The number of fields in the first nested tuple or records or -1 if this array does not contain a Reco...
awkward::IndexedArrayOf::referentially_equal
bool referentially_equal(const ContentPtr &other) const override
Returns true if this array has all the same buffers and parameters as other; false otherwise.
awkward::IndexedArrayOf::type
const TypePtr type(const util::TypeStrs &typestrs) const override
High-level Type describing this array.
awkward::IndexedArrayOf::num
const ContentPtr num(int64_t axis, int64_t depth) const override
The length of this array (as a NumpyArray scalar) if axis = 0 or the lengths of subarrays (as an arra...
awkward::IndexedArrayOf::project
const ContentPtr project(const Index8 &mask) const
Performs a set-union of a given mask with the missing values (if an IndexedOptionArray) and calls pro...
awkward::IndexedArrayOf::simplify_optiontype
const ContentPtr simplify_optiontype() const
If this is an IndexedOptionArray and the content also has OptionType, combine the two indicators of m...
awkward::IndexedArrayOf::mergeable
bool mergeable(const ContentPtr &other, bool mergebool) const override
Returns true if this array can be merged with the other; false otherwise.
awkward::IndexedArrayOf::haskey
bool haskey(const std::string &key) const override
Returns true if the array contains a RecordArray with the specified key; false otherwise.
awkward::IndexedArrayOf::getitem_next_jagged
const ContentPtr getitem_next_jagged(const Index64 &slicestarts, const Index64 &slicestops, const SliceJagged64 &slicecontent, const Slice &tail) const override
Internal function that propagates a jagged array (array with irregular-length dimensions) slice throu...
awkward::IndexedArrayOf::getitem_next_jagged
const ContentPtr getitem_next_jagged(const Index64 &slicestarts, const Index64 &slicestops, const SliceMissing64 &slicecontent, const Slice &tail) const override
Internal function that propagates a jagged array (array with irregular-length dimensions) slice throu...
awkward::IndexedArrayOf::getitem_next
const ContentPtr getitem_next(const SliceRange &range, const Slice &tail, const Index64 &advanced) const override
Internal function that propagates a generic getitem request through one axis (including advanced inde...
awkward::IndexedArrayOf::shallow_simplify
const ContentPtr shallow_simplify() const override
Returns an equivalent array simplified at one level only using simplify_optiontype if an option-type ...
awkward::IndexedArrayOf::content
const ContentPtr content() const
Data to be filtered, rearranged, and/or duplicated.
awkward::IndexedArrayOf::reduce_next
const ContentPtr reduce_next(const Reducer &reducer, int64_t negaxis, const Index64 &starts, const Index64 &shifts, const Index64 &parents, int64_t outlength, bool mask, bool keepdims) const override
This array with one axis removed by applying a Reducer (e.g. "sum", "max", "any", "all).
awkward::IndexedArrayOf::numbers_to_type
const ContentPtr numbers_to_type(const std::string &name) const override
Change the leaf types to 'totype'.
awkward::IndexedArrayOf::classname
const std::string classname() const override
User-friendly name of this class: "IndexedArray32", "IndexedArrayU32", "IndexedArray64",...
awkward::IndexedArrayOf::copy_to
const ContentPtr 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::IndexedForm
Form describing IndexedArray (with OPTION = false).
Definition: IndexedArray.h:19
awkward::IndexedForm::purelist_depth
int64_t purelist_depth() const override
The list-depth of this array, not counting any contained within a RecordForm.
awkward::IndexedForm::with_form_key
const FormPtr with_form_key(const FormKey &form_key) const override
Copies this node, adding or replacing a form_key.
awkward::IndexedForm::IndexedForm
IndexedForm(bool has_identities, const util::Parameters &parameters, const FormKey &form_key, Index::Form index, const FormPtr &content)
Creates a IndexedForm. See IndexedArray for documentation.
awkward::IndexedForm::equal
bool equal(const FormPtr &other, bool check_identities, bool check_parameters, bool check_form_key, bool compatibility_check) const override
Returns true if this Form is equal to the other Form; false otherwise.
awkward::IndexedForm::simplify_optiontype
const FormPtr simplify_optiontype() const
awkward::IndexedForm::istuple
bool istuple() const override
Returns true if the outermost RecordArray is a tuple.
awkward::IndexedForm::shallow_copy
const FormPtr shallow_copy() const override
Copies this node without copying any nodes hierarchically nested within it.
awkward::IndexedForm::tojson_part
void tojson_part(ToJson &builder, bool verbose) const override
Internal function to produce a JSON representation one node at a time.
awkward::IndexedForm::getitem_fields
const FormPtr getitem_fields(const std::vector< std::string > &keys) const override
Returns the Form that would result from a fields-slice.
awkward::IndexedForm::fieldindex
int64_t fieldindex(const std::string &key) const override
The position of a tuple or record key name if this array contains a RecordForm.
awkward::IndexedForm::keys
const std::vector< std::string > keys() const override
A list of RecordArray keys or an empty list if this array does not contain a RecordArray.
awkward::IndexedForm::branch_depth
const std::pair< bool, int64_t > branch_depth() const override
Returns (a) whether the list-depth of this array "branches," or differs when followed through differe...
awkward::IndexedForm::key
const std::string key(int64_t fieldindex) const override
The record name associated with a given field index or the tuple index as a string (e....
awkward::IndexedForm::minmax_depth
const std::pair< int64_t, int64_t > minmax_depth() const override
Returns (a) the minimum list-depth and (b) the maximum list-depth of the array, which can differ if t...
awkward::IndexedForm::content
const FormPtr content() const
awkward::IndexedForm::getitem_field
const FormPtr getitem_field(const std::string &key) const override
Returns the Form that would result from a field-slice.
awkward::IndexedForm::index
Index::Form index() const
awkward::IndexedForm::numfields
int64_t numfields() const override
The number of fields in the first nested tuple or records or -1 if this array does not contain a Reco...
awkward::IndexedForm::type
const TypePtr type(const util::TypeStrs &typestrs) const override
High-level Type describing this Form.
awkward::IndexedForm::purelist_parameter
const std::string purelist_parameter(const std::string &key) const override
The parameter associated with key at the first level that has a non-null value, descending only as de...
awkward::IndexedForm::haskey
bool haskey(const std::string &key) const override
Returns true if the array contains a RecordForm with the specified key; false otherwise.
awkward::IndexedForm::purelist_isregular
bool purelist_isregular() const override
Returns true if all nested lists down to the first RecordForm are RegularForm nodes; false otherwise.
awkward::IndexedForm::dimension_optiontype
bool dimension_optiontype() const override
Returns true if this dimension has option-type; false otherwise.
awkward::IndexedOptionForm
Form describing IndexedOptionArray.
Definition: IndexedArray.h:107
awkward::IndexedOptionForm::purelist_depth
int64_t purelist_depth() const override
The list-depth of this array, not counting any contained within a RecordForm.
awkward::IndexedOptionForm::with_form_key
const FormPtr with_form_key(const FormKey &form_key) const override
Copies this node, adding or replacing a form_key.
awkward::IndexedOptionForm::equal
bool equal(const FormPtr &other, bool check_identities, bool check_parameters, bool check_form_key, bool compatibility_check) const override
Returns true if this Form is equal to the other Form; false otherwise.
awkward::IndexedOptionForm::simplify_optiontype
const FormPtr simplify_optiontype() const
awkward::IndexedOptionForm::istuple
bool istuple() const override
Returns true if the outermost RecordArray is a tuple.
awkward::IndexedOptionForm::shallow_copy
const FormPtr shallow_copy() const override
Copies this node without copying any nodes hierarchically nested within it.
awkward::IndexedOptionForm::tojson_part
void tojson_part(ToJson &builder, bool verbose) const override
Internal function to produce a JSON representation one node at a time.
awkward::IndexedOptionForm::getitem_fields
const FormPtr getitem_fields(const std::vector< std::string > &keys) const override
Returns the Form that would result from a fields-slice.
awkward::IndexedOptionForm::fieldindex
int64_t fieldindex(const std::string &key) const override
The position of a tuple or record key name if this array contains a RecordForm.
awkward::IndexedOptionForm::keys
const std::vector< std::string > keys() const override
A list of RecordArray keys or an empty list if this array does not contain a RecordArray.
awkward::IndexedOptionForm::branch_depth
const std::pair< bool, int64_t > branch_depth() const override
Returns (a) whether the list-depth of this array "branches," or differs when followed through differe...
awkward::IndexedOptionForm::key
const std::string key(int64_t fieldindex) const override
The record name associated with a given field index or the tuple index as a string (e....
awkward::IndexedOptionForm::minmax_depth
const std::pair< int64_t, int64_t > minmax_depth() const override
Returns (a) the minimum list-depth and (b) the maximum list-depth of the array, which can differ if t...
awkward::IndexedOptionForm::IndexedOptionForm
IndexedOptionForm(bool has_identities, const util::Parameters &parameters, const FormKey &form_key, Index::Form index, const FormPtr &content)
Creates a IndexedOptionForm. See IndexedArray for documentation.
awkward::IndexedOptionForm::content
const FormPtr content() const
awkward::IndexedOptionForm::getitem_field
const FormPtr getitem_field(const std::string &key) const override
Returns the Form that would result from a field-slice.
awkward::IndexedOptionForm::index
Index::Form index() const
awkward::IndexedOptionForm::numfields
int64_t numfields() const override
The number of fields in the first nested tuple or records or -1 if this array does not contain a Reco...
awkward::IndexedOptionForm::type
const TypePtr type(const util::TypeStrs &typestrs) const override
High-level Type describing this Form.
awkward::IndexedOptionForm::purelist_parameter
const std::string purelist_parameter(const std::string &key) const override
The parameter associated with key at the first level that has a non-null value, descending only as de...
awkward::IndexedOptionForm::haskey
bool haskey(const std::string &key) const override
Returns true if the array contains a RecordForm with the specified key; false otherwise.
awkward::IndexedOptionForm::purelist_isregular
bool purelist_isregular() const override
Returns true if all nested lists down to the first RecordForm are RegularForm nodes; false otherwise.
awkward::IndexedOptionForm::dimension_optiontype
bool dimension_optiontype() const override
Returns true if this dimension has option-type; false otherwise.
awkward::Reducer
Abstract class for all reducer algorithms.
Definition: Reducer.h:20
awkward::SliceArrayOf
Represents an array of integers in a slice (possibly converted from an array of booleans).
Definition: Slice.h:229
awkward::SliceAt
Represents an integer in a tuple of slices passed to __getitem__ in Python.
Definition: Slice.h:58
awkward::SliceJaggedOf
Represents an array of nested lists, where the content may be SliceArrayOf, SliceMissingOf,...
Definition: Slice.h:515
awkward::SliceMissingOf
Represents a SliceArrayOf, SliceMissingOf, or SliceJaggedOf with missing values: None (no equivalent ...
Definition: Slice.h:435
awkward::SliceRange
Represents a Python slice object (usual syntax: array[start:stop:step]).
Definition: Slice.h:93
awkward::Slice
A sequence of SliceItem objects representing a tuple passed to Python's __getitem__.
Definition: Slice.h:585
awkward::ToJson
Definition: json.h:21
common.h
LIBAWKWARD_EXPORT_SYMBOL
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
awkward::kernel::lib
lib
Definition: kernel-dispatch.h:20
awkward::util::Parameters
std::map< std::string, std::string > Parameters
Definition: util.h:165
awkward::util::RecordLookupPtr
std::shared_ptr< RecordLookup > RecordLookupPtr
Definition: util.h:130
awkward::util::TypeStrs
std::map< std::string, std::string > TypeStrs
Definition: util.h:215
awkward
Definition: BitMaskedArray.h:15
awkward::FormKey
std::shared_ptr< std::string > FormKey
Definition: Content.h:19
awkward::ContentPtrVec
std::vector< std::shared_ptr< Content > > ContentPtrVec
Definition: Content.h:16
awkward::state::index
@ index
awkward::SliceItemPtr
std::shared_ptr< SliceItem > SliceItemPtr
Definition: Slice.h:15
awkward::ContentPtr
std::shared_ptr< Content > ContentPtr
Definition: Content.h:15
awkward::FormPtr
std::shared_ptr< Form > FormPtr
Definition: Content.h:18
awkward::TypePtr
std::shared_ptr< Type > TypePtr
Definition: Content.h:23
awkward::IdentitiesPtr
std::shared_ptr< Identities > IdentitiesPtr
Definition: Identities.h:16