3 #ifndef AWKWARD_NUMPYARRAY_H_ 4 #define AWKWARD_NUMPYARRAY_H_ 24 const std::vector<int64_t>& inner_shape,
26 const std::string& format,
29 const std::vector<int64_t>
48 tostring()
const override;
51 tojson(
bool pretty,
bool verbose)
const override;
54 tojson_part(
ToJson& builder,
bool verbose)
const override;
57 tojson_part(
ToJson& builder,
bool verbose,
bool toplevel)
const;
60 shallow_copy()
const override;
63 with_form_key(
const FormKey& form_key)
const override;
66 purelist_parameter(
const std::string&
key)
const override;
69 purelist_isregular()
const override;
72 purelist_depth()
const override;
75 dimension_optiontype()
const override;
77 const std::pair<int64_t, int64_t>
78 minmax_depth()
const override;
80 const std::pair<bool, int64_t>
81 branch_depth()
const override;
84 numfields()
const override;
87 fieldindex(
const std::string& key)
const override;
90 key(int64_t fieldindex)
const override;
93 haskey(
const std::string& key)
const override;
95 const std::vector<std::string>
96 keys()
const override;
99 istuple()
const override;
103 bool check_identities,
104 bool check_parameters,
106 bool compatibility_check)
const override;
109 getitem_field(
const std::string& key)
const override;
112 getitem_fields(
const std::vector<std::string>& keys)
const override;
115 const std::vector<int64_t> inner_shape_;
117 const std::string format_;
177 const std::shared_ptr<void>& ptr,
178 const std::vector<ssize_t>& shape,
179 const std::vector<ssize_t>& strides,
182 const std::string& format,
198 const std::shared_ptr<void>
220 const std::vector<ssize_t>
233 const std::vector<ssize_t>
297 getbyte(ssize_t at)
const;
305 toRegularArray()
const;
309 isscalar()
const override;
313 classname()
const override;
316 setidentities()
override;
325 form(
bool materialize)
const override;
328 kernels()
const override;
331 caches(std::vector<ArrayCachePtr>& out)
const override;
334 tostring_part(
const std::string& indent,
335 const std::string& pre,
336 const std::string& post)
const override;
339 tojson_part(
ToJson& builder,
bool include_beginendlist)
const override;
342 nbytes_part(std::map<size_t, int64_t>& largest)
const override;
345 length()
const override;
348 shallow_copy()
const override;
351 deep_copy(
bool copyarrays,
353 bool copyidentities)
const override;
356 check_for_iteration()
const override;
359 getitem_nothing()
const override;
362 getitem_at(int64_t at)
const override;
365 getitem_at_nowrap(int64_t at)
const override;
368 getitem_range(int64_t start, int64_t stop)
const override;
371 getitem_range_nowrap(int64_t start, int64_t stop)
const override;
374 getitem_field(
const std::string&
key)
const override;
377 getitem_field(
const std::string& key,
378 const Slice& only_fields)
const override;
381 getitem_fields(
const std::vector<std::string>&
keys)
const override;
384 getitem_fields(
const std::vector<std::string>& keys,
385 const Slice& only_fields)
const override;
388 getitem(
const Slice& where)
const override;
393 const Index64& advanced)
const override;
396 carry(
const Index64& carry,
bool allow_lazy)
const override;
399 purelist_depth()
const override;
401 const std::pair<int64_t, int64_t>
402 minmax_depth()
const override;
404 const std::pair<bool, int64_t>
405 branch_depth()
const override;
408 numfields()
const override;
411 fieldindex(
const std::string& key)
const override;
414 key(int64_t fieldindex)
const override;
417 haskey(
const std::string& key)
const override;
419 const std::vector<std::string>
420 keys()
const override;
423 istuple()
const override;
427 validityerror(
const std::string& path)
const override;
433 shallow_simplify()
const override;
436 num(int64_t axis, int64_t depth)
const override;
438 const std::pair<Index64, ContentPtr>
439 offsets_and_flattened(int64_t axis, int64_t depth)
const override;
442 mergeable(
const ContentPtr& other,
bool mergebool)
const override;
445 referentially_equal(
const ContentPtr& other)
const override;
451 asslice()
const override;
457 rpad(int64_t target, int64_t axis, int64_t depth)
const override;
460 rpad_and_clip(int64_t target,
462 int64_t depth)
const override;
465 reduce_next(
const Reducer& reducer,
472 bool keepdims)
const override;
475 sort_next(int64_t negaxis,
480 bool stable)
const override;
483 as_unique_strings(
const Index64& offsets)
const;
486 argsort_next(int64_t negaxis,
492 bool stable)
const override;
495 localindex(int64_t axis, int64_t depth)
const override;
503 int64_t depth)
const override;
518 iscontiguous()
const;
539 getitem_next(
const SliceAt& at,
541 const Index64& advanced)
const override;
548 const Index64& advanced)
const override;
555 const Index64& advanced)
const override;
562 const Index64& advanced)
const override;
569 const Index64& advanced)
const override;
576 const Index64& advanced)
const override;
584 numbers_to_type(
const std::string&
name)
const override;
588 is_unique()
const override;
596 is_subrange_equal(
const Index64& starts,
const Index64& stops)
const override;
606 contiguous_next(
const Index64& bytepos)
const;
618 int64_t length)
const;
625 getitem_bystrides(
const SliceAt& at,
627 int64_t length)
const;
636 int64_t length)
const;
645 int64_t length)
const;
654 int64_t length)
const;
691 getitem_next(
const SliceAt& at,
752 getitem_next_jagged(
const Index64& slicestarts,
755 const Slice& tail)
const override;
758 getitem_next_jagged(
const Index64& slicestarts,
761 const Slice& tail)
const override;
764 getitem_next_jagged(
const Index64& slicestarts,
767 const Slice& tail)
const override;
771 tojson_boolean(
ToJson& builder,
bool include_beginendlist)
const;
774 template <
typename T>
776 tojson_integer(
ToJson& builder,
bool include_beginendlist)
const;
779 template <
typename T>
781 tojson_real(
ToJson& builder,
bool include_beginendlist)
const;
784 template <
typename T>
786 tojson_complex(
ToJson& builder,
bool include_beginendlist)
const;
790 tojson_string(
ToJson& builder,
bool include_beginendlist)
const;
797 const std::shared_ptr<void> index_sort(
const T* data,
807 const std::shared_ptr<void> array_sort(
const T* data,
815 const std::shared_ptr<void> array_unique(
const T* data,
819 int64_t& outlength)
const;
822 const std::shared_ptr<void> string_unique(
const T* data,
826 int64_t& outlength)
const;
829 bool subranges_equal(
const T* data,
835 const std::shared_ptr<void> as_type(
const T* data,
839 template<
typename TO,
typename FROM>
840 const std::shared_ptr<void> cast_to_type(
const FROM* data,
841 int64_t length)
const;
844 sort_data(
bool ascending,
851 std::shared_ptr<void> ptr_;
855 std::vector<ssize_t> shape_;
857 std::vector<ssize_t> strides_;
861 const ssize_t itemsize_;
863 const std::string format_;
870 #endif // AWKWARD_NUMPYARRAY_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
A contiguous, one-dimensional array of integers used to represent data structures, rather than numerical data in the arrays themselves.
Definition: Index.h:16
Represents NumPy's newaxis marker (a.k.a. None), which prompts __getitem__ to insert a length-1 regul...
Definition: Slice.h:197
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
Represents a single string in a slice tuple, indicating that a RecordArray should be replaced by one ...
Definition: Slice.h:340
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.
std::shared_ptr< std::string > FormKey
Definition: Content.h:19
dtype
NumPy dtypes that can be interpreted within Awkward C++ (only the primitive, fixed-width types)...
Definition: util.h:26
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
Represents a rectilinear numerical array that can be converted to and from NumPy without loss of info...
Definition: NumpyArray.h:138
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
Represents a Python Ellipsis object (usual syntax: array[...]).
Definition: Slice.h:169
bool haskey(const RecordLookupPtr &recordlookup, const std::string &key, int64_t numfields)
Returns true if a RecordLookup has a given key; false otherwise.
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