1 #ifndef teca_index_reduce_h
2 #define teca_index_reduce_h
4 #include "teca_dataset_fwd.h"
5 #include "teca_index_reduce_fwd.h"
7 #include "teca_threaded_algorithm.h"
8 #include "teca_metadata.h"
44 TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
45 TECA_SET_ALGORITHM_PROPERTIES()
51 TECA_ALGORITHM_PROPERTY(
long, start_index)
52 TECA_ALGORITHM_PROPERTY(
long, end_index)
60 virtual p_teca_dataset reduce(
const const_p_teca_dataset &left,
61 const const_p_teca_dataset &right) = 0;
65 virtual p_teca_dataset finalize(
const const_p_teca_dataset &ds)
67 return std::const_pointer_cast<teca_dataset>(ds);
75 virtual std::vector<teca_metadata> initialize_upstream_request(
76 unsigned int port,
const std::vector<teca_metadata> &input_md,
82 virtual teca_metadata initialize_output_metadata(
unsigned int port,
83 const std::vector<teca_metadata> &input_md) = 0;
92 std::vector<teca_metadata> get_upstream_request(
93 unsigned int port,
const std::vector<teca_metadata> &input_md,
101 const_p_teca_dataset execute(
unsigned int port,
102 const std::vector<const_p_teca_dataset> &input_data,
108 const std::vector<teca_metadata> &input_md)
override;
113 const_p_teca_dataset reduce_local(
114 std::vector<const_p_teca_dataset> local_data);
116 const_p_teca_dataset reduce_remote(const_p_teca_dataset local_data);