1 #ifndef OMEGA_H_ARRAY_OPS_HPP
2 #define OMEGA_H_ARRAY_OPS_HPP
6 #include <Omega_h_comm.hpp>
7 #include <Omega_h_scalar.hpp>
12 bool operator==(Read<T> a, Read<T> b);
15 promoted_t<T> get_sum(Read<T> a);
22 promoted_t<T> get_sum(CommPtr comm, Read<T> a);
24 T get_min(CommPtr comm, Read<T> a);
26 T get_max(CommPtr comm, Read<T> a);
37 bool are_close(
Reals a,
Reals b, Real tol = EPSILON, Real floor = EPSILON);
38 bool are_close_abs(
Reals a,
Reals b, Real tol = EPSILON);
102 template <
typename T>
105 template <
typename T>
106 LO find_last(
Read<T> array, T value);
108 template <
typename T>
111 template <
typename T>
114 template <
typename T>
117 Real repro_sum(
Reals a);
118 Real repro_sum(CommPtr comm,
Reals a);
119 void repro_sum(CommPtr comm,
Reals a, Int ncomps, Real result[]);
124 template <
typename Tout,
typename Tin>
127 #define OMEGA_H_EXPL_INST_DECL(T) \
128 extern template bool operator==(Read<T> a, Read<T> b); \
129 extern template promoted_t<T> get_sum(Read<T> a); \
130 extern template T get_min(Read<T> a); \
131 extern template T get_max(Read<T> a); \
132 extern template promoted_t<T> get_sum(CommPtr comm, Read<T> a); \
133 extern template T get_min(CommPtr comm, Read<T> a); \
134 extern template T get_max(CommPtr comm, Read<T> a); \
135 extern template MinMax<T> get_minmax(CommPtr comm, Read<T> a); \
136 extern template Write<T> multiply_each( \
137 Read<T> a, Read<T> b, std::string const&); \
138 extern template Write<T> divide_each( \
139 Read<T> a, Read<T> b, std::string const&); \
140 extern template Write<T> concat( \
141 Read<T> a, Read<T> b, std::string const&); \
142 extern template Read<T> add_each(Read<T> a, Read<T> b, std::string const&); \
143 extern template Read<T> subtract_each(Read<T> a, Read<T> b); \
144 extern template Read<T> add_to_each(Read<T> a, T b); \
145 extern template Read<T> subtract_from_each(Read<T> a, T b); \
146 extern template Bytes each_geq_to(Read<T> a, T b); \
147 extern template Bytes each_leq_to(Read<T> a, T b); \
148 extern template Bytes each_gt(Read<T> a, T b); \
149 extern template Bytes each_lt(Read<T> a, T b); \
150 extern template Bytes each_neq_to(Read<T> a, T b); \
151 extern template Bytes each_eq(Read<T> a, Read<T> b); \
152 extern template Bytes each_eq_to(Read<T> a, T b); \
153 extern template Read<T> multiply_each_by(Read<T> a, T b); \
154 extern template Read<T> divide_each_by(Read<T> a, T b); \
155 extern template Read<T> min_each(Read<T> a, Read<T> b); \
156 extern template Read<T> max_each(Read<T> a, Read<T> b); \
157 extern template Read<T> ternary_each(Bytes cond, Read<T> a, Read<T> b); \
158 extern template Read<T> each_max_with(Read<T> a, T b); \
159 extern template Bytes gt_each(Read<T> a, Read<T> b); \
160 extern template Bytes lt_each(Read<T> a, Read<T> b); \
161 extern template Bytes eq_each(Read<T> a, Read<T> b); \
162 extern template Bytes neq_each(Read<T> a, Read<T> b); \
163 extern template Read<T> get_component(Read<T> a, Int ncomps, Int comp); \
164 extern template void set_component( \
165 Write<T> out, Read<T> a, Int ncomps, Int comp); \
166 extern template LO find_last(Read<T> array, T value); \
167 extern template bool is_sorted(Read<T> array); \
168 extern template Read<T> interleave(std::vector<Read<T>> arrays); \
169 extern template Read<T> coalesce(std::vector<Read<T>> arrays);
170 OMEGA_H_EXPL_INST_DECL(I8)
171 OMEGA_H_EXPL_INST_DECL(I32)
172 OMEGA_H_EXPL_INST_DECL(I64)
173 OMEGA_H_EXPL_INST_DECL(Real)
174 #undef OMEGA_H_EXPL_INST_DECL
Definition: Omega_h_array.hpp:89
Definition: Omega_h_array.hpp:50
Definition: amr_mpi_test.cpp:6
Definition: Omega_h_array_ops.hpp:29