Reducer.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_REDUCER_H_
4 #define AWKWARD_REDUCER_H_
5 
6 #include <complex>
7 #include <memory>
8 
9 #include "awkward/common.h"
10 #include "awkward/Index.h"
11 
12 namespace awkward {
21  public:
23  virtual const std::string
24  name() const = 0;
25 
28  virtual util::dtype
29  preferred_dtype() const = 0;
30 
32  virtual util::dtype
33  return_dtype(util::dtype given_dtype) const;
34 
36  virtual bool
37  returns_positions() const;
38 
46  virtual const std::shared_ptr<void>
47  apply_bool(const bool* data,
48  const Index64& parents,
49  int64_t outlength) const = 0;
50 
59  virtual const std::shared_ptr<void>
60  apply_int8(const int8_t* data,
61  const Index64& parents,
62  int64_t outlength) const = 0;
63 
72  virtual const std::shared_ptr<void>
73  apply_uint8(const uint8_t* data,
74  const Index64& parents,
75  int64_t outlength) const = 0;
76 
85  virtual const std::shared_ptr<void>
86  apply_int16(const int16_t* data,
87  const Index64& parents,
88  int64_t outlength) const = 0;
89 
98  virtual const std::shared_ptr<void>
99  apply_uint16(const uint16_t* data,
100  const Index64& parents,
101  int64_t outlength) const = 0;
102 
111  virtual const std::shared_ptr<void>
112  apply_int32(const int32_t* data,
113  const Index64& parents,
114  int64_t outlength) const = 0;
115 
124  virtual const std::shared_ptr<void>
125  apply_uint32(const uint32_t* data,
126  const Index64& parents,
127  int64_t outlength) const = 0;
128 
137  virtual const std::shared_ptr<void>
138  apply_int64(const int64_t* data,
139  const Index64& parents,
140  int64_t outlength) const = 0;
141 
150  virtual const std::shared_ptr<void>
151  apply_uint64(const uint64_t* data,
152  const Index64& parents,
153  int64_t outlength) const = 0;
154 
163  virtual const std::shared_ptr<void>
164  apply_float32(const float* data,
165  const Index64& parents,
166  int64_t outlength) const = 0;
167 
176  virtual const std::shared_ptr<void>
177  apply_float64(const double* data,
178  const Index64& parents,
179  int64_t outlength) const = 0;
180 
189  virtual const std::shared_ptr<void>
190  apply_complex64(const std::complex<float>* data,
191  const Index64& parents,
192  int64_t outlength) const = 0;
193 
202  virtual const std::shared_ptr<void>
203  apply_complex128(const std::complex<double>* data,
204  const Index64& parents,
205  int64_t outlength) const = 0;
206 
215  virtual const std::shared_ptr<void>
216  apply_datetime(const int64_t* data,
217  const Index64& parents,
218  int64_t outlength) const = 0;
219 
228  virtual const std::shared_ptr<void>
229  apply_timedelta(const int64_t* data,
230  const Index64& parents,
231  int64_t outlength) const = 0;
232 
233  };
234 
243  public:
245  const std::string
246  name() const override;
247 
252  preferred_dtype() const override;
253 
258  return_dtype(util::dtype given_dtype) const override;
259 
260  const std::shared_ptr<void>
261  apply_bool(const bool* data,
262  const Index64& parents,
263  int64_t outlength) const override;
264 
265  const std::shared_ptr<void>
266  apply_int8(const int8_t* data,
267  const Index64& parents,
268  int64_t outlength) const override;
269 
270  const std::shared_ptr<void>
271  apply_uint8(const uint8_t* data,
272  const Index64& parents,
273  int64_t outlength) const override;
274 
275  const std::shared_ptr<void>
276  apply_int16(const int16_t* data,
277  const Index64& parents,
278  int64_t outlength) const override;
279 
280  const std::shared_ptr<void>
281  apply_uint16(const uint16_t* data,
282  const Index64& parents,
283  int64_t outlength) const override;
284 
285  const std::shared_ptr<void>
286  apply_int32(const int32_t* data,
287  const Index64& parents,
288  int64_t outlength) const override;
289 
290  const std::shared_ptr<void>
291  apply_uint32(const uint32_t* data,
292  const Index64& parents,
293  int64_t outlength) const override;
294 
295  const std::shared_ptr<void>
296  apply_int64(const int64_t* data,
297  const Index64& parents,
298  int64_t outlength) const override;
299 
300  const std::shared_ptr<void>
301  apply_uint64(const uint64_t* data,
302  const Index64& parents,
303  int64_t outlength) const override;
304 
305  const std::shared_ptr<void>
306  apply_float32(const float* data,
307  const Index64& parents,
308  int64_t outlength) const override;
309 
310  const std::shared_ptr<void>
311  apply_float64(const double* data,
312  const Index64& parents,
313  int64_t outlength) const override;
314 
315  const std::shared_ptr<void>
316  apply_complex64(const std::complex<float>* data,
317  const Index64& parents,
318  int64_t outlength) const override;
319 
320  const std::shared_ptr<void>
321  apply_complex128(const std::complex<double>* data,
322  const Index64& parents,
323  int64_t outlength) const override;
324 
325  const std::shared_ptr<void>
326  apply_datetime(const int64_t* data,
327  const Index64& parents,
328  int64_t outlength) const override;
329 
330  const std::shared_ptr<void>
331  apply_timedelta(const int64_t* data,
332  const Index64& parents,
333  int64_t outlength) const override;
334  };
335 
344  public:
346  const std::string
347  name() const override;
348 
353  preferred_dtype() const override;
354 
359  return_dtype(util::dtype given_dtype) const override;
360 
361  const std::shared_ptr<void>
362  apply_bool(const bool* data,
363  const Index64& parents,
364  int64_t outlength) const override;
365 
366  const std::shared_ptr<void>
367  apply_int8(const int8_t* data,
368  const Index64& parents,
369  int64_t outlength) const override;
370 
371  const std::shared_ptr<void>
372  apply_uint8(const uint8_t* data,
373  const Index64& parents,
374  int64_t outlength) const override;
375 
376  const std::shared_ptr<void>
377  apply_int16(const int16_t* data,
378  const Index64& parents,
379  int64_t outlength) const override;
380 
381  const std::shared_ptr<void>
382  apply_uint16(const uint16_t* data,
383  const Index64& parents,
384  int64_t outlength) const override;
385 
386  const std::shared_ptr<void>
387  apply_int32(const int32_t* data,
388  const Index64& parents,
389  int64_t outlength) const override;
390 
391  const std::shared_ptr<void>
392  apply_uint32(const uint32_t* data,
393  const Index64& parents,
394  int64_t outlength) const override;
395 
396  const std::shared_ptr<void>
397  apply_int64(const int64_t* data,
398  const Index64& parents,
399  int64_t outlength) const override;
400 
401  const std::shared_ptr<void>
402  apply_uint64(const uint64_t* data,
403  const Index64& parents,
404  int64_t outlength) const override;
405 
406  const std::shared_ptr<void>
407  apply_float32(const float* data,
408  const Index64& parents,
409  int64_t outlength) const override;
410 
411  const std::shared_ptr<void>
412  apply_float64(const double* data,
413  const Index64& parents,
414  int64_t outlength) const override;
415 
416  const std::shared_ptr<void>
417  apply_complex64(const std::complex<float>* data,
418  const Index64& parents,
419  int64_t outlength) const override;
420 
421  const std::shared_ptr<void>
422  apply_complex128(const std::complex<double>* data,
423  const Index64& parents,
424  int64_t outlength) const override;
425 
426  const std::shared_ptr<void>
427  apply_datetime(const int64_t* data,
428  const Index64& parents,
429  int64_t outlength) const override;
430 
431  const std::shared_ptr<void>
432  apply_timedelta(const int64_t* data,
433  const Index64& parents,
434  int64_t outlength) const override;
435  };
436 
445  public:
447  const std::string
448  name() const override;
449 
454  preferred_dtype() const override;
455 
461  return_dtype(util::dtype given_dtype) const override;
462 
463  const std::shared_ptr<void>
464  apply_bool(const bool* data,
465  const Index64& parents,
466  int64_t outlength) const override;
467 
468  const std::shared_ptr<void>
469  apply_int8(const int8_t* data,
470  const Index64& parents,
471  int64_t outlength) const override;
472 
473  const std::shared_ptr<void>
474  apply_uint8(const uint8_t* data,
475  const Index64& parents,
476  int64_t outlength) const override;
477 
478  const std::shared_ptr<void>
479  apply_int16(const int16_t* data,
480  const Index64& parents,
481  int64_t outlength) const override;
482 
483  const std::shared_ptr<void>
484  apply_uint16(const uint16_t* data,
485  const Index64& parents,
486  int64_t outlength) const override;
487 
488  const std::shared_ptr<void>
489  apply_int32(const int32_t* data,
490  const Index64& parents,
491  int64_t outlength) const override;
492 
493  const std::shared_ptr<void>
494  apply_uint32(const uint32_t* data,
495  const Index64& parents,
496  int64_t outlength) const override;
497 
498  const std::shared_ptr<void>
499  apply_int64(const int64_t* data,
500  const Index64& parents,
501  int64_t outlength) const override;
502 
503  const std::shared_ptr<void>
504  apply_uint64(const uint64_t* data,
505  const Index64& parents,
506  int64_t outlength) const override;
507 
508  const std::shared_ptr<void>
509  apply_float32(const float* data,
510  const Index64& parents,
511  int64_t outlength) const override;
512 
513  const std::shared_ptr<void>
514  apply_float64(const double* data,
515  const Index64& parents,
516  int64_t outlength) const override;
517 
518  const std::shared_ptr<void>
519  apply_complex64(const std::complex<float>* data,
520  const Index64& parents,
521  int64_t outlength) const override;
522 
523  const std::shared_ptr<void>
524  apply_complex128(const std::complex<double>* data,
525  const Index64& parents,
526  int64_t outlength) const override;
527 
528  const std::shared_ptr<void>
529  apply_datetime(const int64_t* data,
530  const Index64& parents,
531  int64_t outlength) const override;
532 
533  const std::shared_ptr<void>
534  apply_timedelta(const int64_t* data,
535  const Index64& parents,
536  int64_t outlength) const override;
537  };
538 
547  public:
549  const std::string
550  name() const override;
551 
556  preferred_dtype() const override;
557 
563  return_dtype(util::dtype given_dtype) const override;
564 
565  const std::shared_ptr<void>
566  apply_bool(const bool* data,
567  const Index64& parents,
568  int64_t outlength) const override;
569 
570  const std::shared_ptr<void>
571  apply_int8(const int8_t* data,
572  const Index64& parents,
573  int64_t outlength) const override;
574 
575  const std::shared_ptr<void>
576  apply_uint8(const uint8_t* data,
577  const Index64& parents,
578  int64_t outlength) const override;
579 
580  const std::shared_ptr<void>
581  apply_int16(const int16_t* data,
582  const Index64& parents,
583  int64_t outlength) const override;
584 
585  const std::shared_ptr<void>
586  apply_uint16(const uint16_t* data,
587  const Index64& parents,
588  int64_t outlength) const override;
589 
590  const std::shared_ptr<void>
591  apply_int32(const int32_t* data,
592  const Index64& parents,
593  int64_t outlength) const override;
594 
595  const std::shared_ptr<void>
596  apply_uint32(const uint32_t* data,
597  const Index64& parents,
598  int64_t outlength) const override;
599 
600  const std::shared_ptr<void>
601  apply_int64(const int64_t* data,
602  const Index64& parents,
603  int64_t outlength) const override;
604 
605  const std::shared_ptr<void>
606  apply_uint64(const uint64_t* data,
607  const Index64& parents,
608  int64_t outlength) const override;
609 
610  const std::shared_ptr<void>
611  apply_float32(const float* data,
612  const Index64& parents,
613  int64_t outlength) const override;
614 
615  const std::shared_ptr<void>
616  apply_float64(const double* data,
617  const Index64& parents,
618  int64_t outlength) const override;
619 
620  const std::shared_ptr<void>
621  apply_complex64(const std::complex<float>* data,
622  const Index64& parents,
623  int64_t outlength) const override;
624 
625  const std::shared_ptr<void>
626  apply_complex128(const std::complex<double>* data,
627  const Index64& parents,
628  int64_t outlength) const override;
629 
630  const std::shared_ptr<void>
631  apply_datetime(const int64_t* data,
632  const Index64& parents,
633  int64_t outlength) const override;
634 
635  const std::shared_ptr<void>
636  apply_timedelta(const int64_t* data,
637  const Index64& parents,
638  int64_t outlength) const override;
639  };
640 
650  public:
652  const std::string
653  name() const override;
654 
659  preferred_dtype() const override;
660 
665  return_dtype(util::dtype given_dtype) const override;
666 
667  const std::shared_ptr<void>
668  apply_bool(const bool* data,
669  const Index64& parents,
670  int64_t outlength) const override;
671 
672  const std::shared_ptr<void>
673  apply_int8(const int8_t* data,
674  const Index64& parents,
675  int64_t outlength) const override;
676 
677  const std::shared_ptr<void>
678  apply_uint8(const uint8_t* data,
679  const Index64& parents,
680  int64_t outlength) const override;
681 
682  const std::shared_ptr<void>
683  apply_int16(const int16_t* data,
684  const Index64& parents,
685  int64_t outlength) const override;
686 
687  const std::shared_ptr<void>
688  apply_uint16(const uint16_t* data,
689  const Index64& parents,
690  int64_t outlength) const override;
691 
692  const std::shared_ptr<void>
693  apply_int32(const int32_t* data,
694  const Index64& parents,
695  int64_t outlength) const override;
696 
697  const std::shared_ptr<void>
698  apply_uint32(const uint32_t* data,
699  const Index64& parents,
700  int64_t outlength) const override;
701 
702  const std::shared_ptr<void>
703  apply_int64(const int64_t* data,
704  const Index64& parents,
705  int64_t outlength) const override;
706 
707  const std::shared_ptr<void>
708  apply_uint64(const uint64_t* data,
709  const Index64& parents,
710  int64_t outlength) const override;
711 
712  const std::shared_ptr<void>
713  apply_float32(const float* data,
714  const Index64& parents,
715  int64_t outlength) const override;
716 
717  const std::shared_ptr<void>
718  apply_float64(const double* data,
719  const Index64& parents,
720  int64_t outlength) const override;
721 
722  const std::shared_ptr<void>
723  apply_complex64(const std::complex<float>* data,
724  const Index64& parents,
725  int64_t outlength) const override;
726 
727  const std::shared_ptr<void>
728  apply_complex128(const std::complex<double>* data,
729  const Index64& parents,
730  int64_t outlength) const override;
731 
732  const std::shared_ptr<void>
733  apply_datetime(const int64_t* data,
734  const Index64& parents,
735  int64_t outlength) const override;
736 
737  const std::shared_ptr<void>
738  apply_timedelta(const int64_t* data,
739  const Index64& parents,
740  int64_t outlength) const override;
741  };
742 
752  public:
754  const std::string
755  name() const override;
756 
761  preferred_dtype() const override;
762 
767  return_dtype(util::dtype given_dtype) const override;
768 
769  const std::shared_ptr<void>
770  apply_bool(const bool* data,
771  const Index64& parents,
772  int64_t outlength) const override;
773 
774  const std::shared_ptr<void>
775  apply_int8(const int8_t* data,
776  const Index64& parents,
777  int64_t outlength) const override;
778 
779  const std::shared_ptr<void>
780  apply_uint8(const uint8_t* data,
781  const Index64& parents,
782  int64_t outlength) const override;
783 
784  const std::shared_ptr<void>
785  apply_int16(const int16_t* data,
786  const Index64& parents,
787  int64_t outlength) const override;
788 
789  const std::shared_ptr<void>
790  apply_uint16(const uint16_t* data,
791  const Index64& parents,
792  int64_t outlength) const override;
793 
794  const std::shared_ptr<void>
795  apply_int32(const int32_t* data,
796  const Index64& parents,
797  int64_t outlength) const override;
798 
799  const std::shared_ptr<void>
800  apply_uint32(const uint32_t* data,
801  const Index64& parents,
802  int64_t outlength) const override;
803 
804  const std::shared_ptr<void>
805  apply_int64(const int64_t* data,
806  const Index64& parents,
807  int64_t outlength) const override;
808 
809  const std::shared_ptr<void>
810  apply_uint64(const uint64_t* data,
811  const Index64& parents,
812  int64_t outlength) const override;
813 
814  const std::shared_ptr<void>
815  apply_float32(const float* data,
816  const Index64& parents,
817  int64_t outlength) const override;
818 
819  const std::shared_ptr<void>
820  apply_float64(const double* data,
821  const Index64& parents,
822  int64_t outlength) const override;
823 
824  const std::shared_ptr<void>
825  apply_complex64(const std::complex<float>* data,
826  const Index64& parents,
827  int64_t outlength) const override;
828 
829  const std::shared_ptr<void>
830  apply_complex128(const std::complex<double>* data,
831  const Index64& parents,
832  int64_t outlength) const override;
833 
834  const std::shared_ptr<void>
835  apply_datetime(const int64_t* data,
836  const Index64& parents,
837  int64_t outlength) const override;
838 
839  const std::shared_ptr<void>
840  apply_timedelta(const int64_t* data,
841  const Index64& parents,
842  int64_t outlength) const override;
843  };
844 
862  public:
863  ReducerMin(double initial_f64, uint64_t initial_u64, int64_t initial_i64);
864  ReducerMin();
865 
867  const std::string
868  name() const override;
869 
874  preferred_dtype() const override;
875 
876  const std::shared_ptr<void>
877  apply_bool(const bool* data,
878  const Index64& parents,
879  int64_t outlength) const override;
880 
881  const std::shared_ptr<void>
882  apply_int8(const int8_t* data,
883  const Index64& parents,
884  int64_t outlength) const override;
885 
886  const std::shared_ptr<void>
887  apply_uint8(const uint8_t* data,
888  const Index64& parents,
889  int64_t outlength) const override;
890 
891  const std::shared_ptr<void>
892  apply_int16(const int16_t* data,
893  const Index64& parents,
894  int64_t outlength) const override;
895 
896  const std::shared_ptr<void>
897  apply_uint16(const uint16_t* data,
898  const Index64& parents,
899  int64_t outlength) const override;
900 
901  const std::shared_ptr<void>
902  apply_int32(const int32_t* data,
903  const Index64& parents,
904  int64_t outlength) const override;
905 
906  const std::shared_ptr<void>
907  apply_uint32(const uint32_t* data,
908  const Index64& parents,
909  int64_t outlength) const override;
910 
911  const std::shared_ptr<void>
912  apply_int64(const int64_t* data,
913  const Index64& parents,
914  int64_t outlength) const override;
915 
916  const std::shared_ptr<void>
917  apply_uint64(const uint64_t* data,
918  const Index64& parents,
919  int64_t outlength) const override;
920 
921  const std::shared_ptr<void>
922  apply_float32(const float* data,
923  const Index64& parents,
924  int64_t outlength) const override;
925 
926  const std::shared_ptr<void>
927  apply_float64(const double* data,
928  const Index64& parents,
929  int64_t outlength) const override;
930 
931  const std::shared_ptr<void>
932  apply_complex64(const std::complex<float>* data,
933  const Index64& parents,
934  int64_t outlength) const override;
935 
936  const std::shared_ptr<void>
937  apply_complex128(const std::complex<double>* data,
938  const Index64& parents,
939  int64_t outlength) const override;
940 
941  const std::shared_ptr<void>
942  apply_datetime(const int64_t* data,
943  const Index64& parents,
944  int64_t outlength) const override;
945 
946  const std::shared_ptr<void>
947  apply_timedelta(const int64_t* data,
948  const Index64& parents,
949  int64_t outlength) const override;
950  private:
951  double initial_f64_;
952  uint64_t initial_u64_;
953  int64_t initial_i64_;
954  bool has_initial_;
955  };
956 
974  public:
975  ReducerMax(double initial_f64_, uint64_t initial_u64_, int64_t initial_i64_);
976  ReducerMax();
977 
979  const std::string
980  name() const override;
981 
986  preferred_dtype() const override;
987 
988  const std::shared_ptr<void>
989  apply_bool(const bool* data,
990  const Index64& parents,
991  int64_t outlength) const override;
992 
993  const std::shared_ptr<void>
994  apply_int8(const int8_t* data,
995  const Index64& parents,
996  int64_t outlength) const override;
997 
998  const std::shared_ptr<void>
999  apply_uint8(const uint8_t* data,
1000  const Index64& parents,
1001  int64_t outlength) const override;
1002 
1003  const std::shared_ptr<void>
1004  apply_int16(const int16_t* data,
1005  const Index64& parents,
1006  int64_t outlength) const override;
1007 
1008  const std::shared_ptr<void>
1009  apply_uint16(const uint16_t* data,
1010  const Index64& parents,
1011  int64_t outlength) const override;
1012 
1013  const std::shared_ptr<void>
1014  apply_int32(const int32_t* data,
1015  const Index64& parents,
1016  int64_t outlength) const override;
1017 
1018  const std::shared_ptr<void>
1019  apply_uint32(const uint32_t* data,
1020  const Index64& parents,
1021  int64_t outlength) const override;
1022 
1023  const std::shared_ptr<void>
1024  apply_int64(const int64_t* data,
1025  const Index64& parents,
1026  int64_t outlength) const override;
1027 
1028  const std::shared_ptr<void>
1029  apply_uint64(const uint64_t* data,
1030  const Index64& parents,
1031  int64_t outlength) const override;
1032 
1033  const std::shared_ptr<void>
1034  apply_float32(const float* data,
1035  const Index64& parents,
1036  int64_t outlength) const override;
1037 
1038  const std::shared_ptr<void>
1039  apply_float64(const double* data,
1040  const Index64& parents,
1041  int64_t outlength) const override;
1042 
1043  const std::shared_ptr<void>
1044  apply_complex64(const std::complex<float>* data,
1045  const Index64& parents,
1046  int64_t outlength) const override;
1047 
1048  const std::shared_ptr<void>
1049  apply_complex128(const std::complex<double>* data,
1050  const Index64& parents,
1051  int64_t outlength) const override;
1052 
1053  const std::shared_ptr<void>
1054  apply_datetime(const int64_t* data,
1055  const Index64& parents,
1056  int64_t outlength) const override;
1057 
1058  const std::shared_ptr<void>
1059  apply_timedelta(const int64_t* data,
1060  const Index64& parents,
1061  int64_t outlength) const override;
1062  private:
1063  double initial_f64_;
1064  uint64_t initial_u64_;
1065  int64_t initial_i64_;
1066  bool has_initial_;
1067  };
1068 
1082  public:
1084  const std::string
1085  name() const override;
1086 
1090  util::dtype
1091  preferred_dtype() const override;
1092 
1096  util::dtype
1097  return_dtype(util::dtype given_dtype) const override;
1098 
1102  virtual bool
1103  returns_positions() const override;
1104 
1105  const std::shared_ptr<void>
1106  apply_bool(const bool* data,
1107  const Index64& parents,
1108  int64_t outlength) const override;
1109 
1110  const std::shared_ptr<void>
1111  apply_int8(const int8_t* data,
1112  const Index64& parents,
1113  int64_t outlength) const override;
1114 
1115  const std::shared_ptr<void>
1116  apply_uint8(const uint8_t* data,
1117  const Index64& parents,
1118  int64_t outlength) const override;
1119 
1120  const std::shared_ptr<void>
1121  apply_int16(const int16_t* data,
1122  const Index64& parents,
1123  int64_t outlength) const override;
1124 
1125  const std::shared_ptr<void>
1126  apply_uint16(const uint16_t* data,
1127  const Index64& parents,
1128  int64_t outlength) const override;
1129 
1130  const std::shared_ptr<void>
1131  apply_int32(const int32_t* data,
1132  const Index64& parents,
1133  int64_t outlength) const override;
1134 
1135  const std::shared_ptr<void>
1136  apply_uint32(const uint32_t* data,
1137  const Index64& parents,
1138  int64_t outlength) const override;
1139 
1140  const std::shared_ptr<void>
1141  apply_int64(const int64_t* data,
1142  const Index64& parents,
1143  int64_t outlength) const override;
1144 
1145  const std::shared_ptr<void>
1146  apply_uint64(const uint64_t* data,
1147  const Index64& parents,
1148  int64_t outlength) const override;
1149 
1150  const std::shared_ptr<void>
1151  apply_float32(const float* data,
1152  const Index64& parents,
1153  int64_t outlength) const override;
1154 
1155  const std::shared_ptr<void>
1156  apply_float64(const double* data,
1157  const Index64& parents,
1158  int64_t outlength) const override;
1159 
1160  const std::shared_ptr<void>
1161  apply_complex64(const std::complex<float>* data,
1162  const Index64& parents,
1163  int64_t outlength) const override;
1164 
1165  const std::shared_ptr<void>
1166  apply_complex128(const std::complex<double>* data,
1167  const Index64& parents,
1168  int64_t outlength) const override;
1169 
1170  const std::shared_ptr<void>
1171  apply_datetime(const int64_t* data,
1172  const Index64& parents,
1173  int64_t outlength) const override;
1174 
1175  const std::shared_ptr<void>
1176  apply_timedelta(const int64_t* data,
1177  const Index64& parents,
1178  int64_t outlength) const override;
1179  };
1180 
1194  public:
1196  const std::string
1197  name() const override;
1198 
1202  util::dtype
1203  preferred_dtype() const override;
1204 
1208  util::dtype
1209  return_dtype(util::dtype given_dtype) const override;
1210 
1214  virtual bool
1215  returns_positions() const override;
1216 
1217  const std::shared_ptr<void>
1218  apply_bool(const bool* data,
1219  const Index64& parents,
1220  int64_t outlength) const override;
1221 
1222  const std::shared_ptr<void>
1223  apply_int8(const int8_t* data,
1224  const Index64& parents,
1225  int64_t outlength) const override;
1226 
1227  const std::shared_ptr<void>
1228  apply_uint8(const uint8_t* data,
1229  const Index64& parents,
1230  int64_t outlength) const override;
1231 
1232  const std::shared_ptr<void>
1233  apply_int16(const int16_t* data,
1234  const Index64& parents,
1235  int64_t outlength) const override;
1236 
1237  const std::shared_ptr<void>
1238  apply_uint16(const uint16_t* data,
1239  const Index64& parents,
1240  int64_t outlength) const override;
1241 
1242  const std::shared_ptr<void>
1243  apply_int32(const int32_t* data,
1244  const Index64& parents,
1245  int64_t outlength) const override;
1246 
1247  const std::shared_ptr<void>
1248  apply_uint32(const uint32_t* data,
1249  const Index64& parents,
1250  int64_t outlength) const override;
1251 
1252  const std::shared_ptr<void>
1253  apply_int64(const int64_t* data,
1254  const Index64& parents,
1255  int64_t outlength) const override;
1256 
1257  const std::shared_ptr<void>
1258  apply_uint64(const uint64_t* data,
1259  const Index64& parents,
1260  int64_t outlength) const override;
1261 
1262  const std::shared_ptr<void>
1263  apply_float32(const float* data,
1264  const Index64& parents,
1265  int64_t outlength) const override;
1266 
1267  const std::shared_ptr<void>
1268  apply_float64(const double* data,
1269  const Index64& parents,
1270  int64_t outlength) const override;
1271 
1272  const std::shared_ptr<void>
1273  apply_complex64(const std::complex<float>* data,
1274  const Index64& parents,
1275  int64_t outlength) const override;
1276 
1277  const std::shared_ptr<void>
1278  apply_complex128(const std::complex<double>* data,
1279  const Index64& parents,
1280  int64_t outlength) const override;
1281 
1282  const std::shared_ptr<void>
1283  apply_datetime(const int64_t* data,
1284  const Index64& parents,
1285  int64_t outlength) const override;
1286 
1287  const std::shared_ptr<void>
1288  apply_timedelta(const int64_t* data,
1289  const Index64& parents,
1290  int64_t outlength) const override;
1291  };
1292 
1293 }
1294 
1295 #endif // AWKWARD_REDUCER_H_
Reducer algorithm that counts non-zero items. The identity is 0.
Definition: Reducer.h:343
Reducer algorithm that simply counts items. The identity is 0.
Definition: Reducer.h:242
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
Reducer algorithm that multiplies items. The identity is 1.
Definition: Reducer.h:546
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
std::string name(Mapping a, V value)
Definition: datetime_util.h:39
Reducer algorithm that returns true if all values are true, false otherwise. The identity is true...
Definition: Reducer.h:751
Reducer algorithm that returns the maximum value. The identity is minus infinity or the smallest poss...
Definition: Reducer.h:973
Abstract class for all reducer algorithms.
Definition: Reducer.h:20
dtype
NumPy dtypes that can be interpreted within Awkward C++ (only the primitive, fixed-width types)...
Definition: util.h:26
Reducer algorithm that returns true if any values are true, false otherwise. The identity is false...
Definition: Reducer.h:649
Reducer algorithm that returns the position of the maximum value. The identity is meaningless and sho...
Definition: Reducer.h:1193
Reducer algorithm that returns the minimum value. The identity is infinity or the largest possible va...
Definition: Reducer.h:861
Reducer algorithm that adds up items. The identity is 0.
Definition: Reducer.h:444
Reducer algorithm that returns the position of the minimum value. The identity is meaningless and sho...
Definition: Reducer.h:1081