56 #ifndef __stir_ArrayFunction_H__ 57 #define __stir_ArrayFunction_H__ 71 template <
class elemT>
72 inline Array<1, elemT>&
in_place_log(Array<1, elemT>& v);
76 template <
int num_dimensions,
class elemT>
77 inline Array<num_dimensions, elemT>&
in_place_log(Array<num_dimensions, elemT>& v);
81 template <
class elemT>
82 inline Array<1, elemT>&
in_place_exp(Array<1, elemT>& v);
86 template <
int num_dimensions,
class elemT>
87 inline Array<num_dimensions, elemT>&
in_place_exp(Array<num_dimensions, elemT>& v);
93 template <
class elemT>
94 inline Array<1, elemT>&
in_place_abs(Array<1, elemT>& v);
100 template <
int num_dimensions,
class elemT>
101 inline Array<num_dimensions, elemT>&
in_place_abs(Array<num_dimensions, elemT>& v);
113 template <
class T,
class FUNCTION>
144 template <
int num_dim,
typename elemT,
typename FunctionObjectPtr>
156 template <
int num_dim,
typename elemT,
typename FunctionObjectPtr>
173 #if !defined(__GNUC__) && !defined(_MSC_VER) 174 # define ActualFunctionObjectPtrIter VectorWithOffset<shared_ptr<ArrayFunctionObject<1, elemT>>>::const_iterator 183 # define ActualFunctionObjectPtrIter shared_ptr<ArrayFunctionObject<1, elemT>> const* 201 template <
int num_dim,
typename elemT,
typename FunctionObjectPtrIter>
203 FunctionObjectPtrIter start,
204 FunctionObjectPtrIter stop);
207 template <
typename elemT,
typename FunctionObjectPtrIter>
226 template <
int num_dim,
typename elemT,
typename FunctionObjectPtrIter>
228 const Array<num_dim, elemT>& in_array,
229 FunctionObjectPtrIter start,
230 FunctionObjectPtrIter stop);
240 template <
int num_dim,
typename elemT>
242 const Array<num_dim, elemT>& in_array,
243 ActualFunctionObjectPtrIter start,
244 ActualFunctionObjectPtrIter stop);
250 template <
typename elemT>
252 const Array<1, elemT>& in_array,
253 ActualFunctionObjectPtrIter start,
254 ActualFunctionObjectPtrIter stop);
256 template <
typename elemT,
typename FunctionObjectPtrIter>
261 const Array<1, elemT>& in_array,
262 FunctionObjectPtrIter start,
263 FunctionObjectPtrIter stop);
265 template <
int num_dim,
typename elemT>
266 inline void transform_array_to_periodic_indices(Array<num_dim, elemT>& out_array,
const Array<num_dim, elemT>& in_array);
267 template <
int num_dim,
typename elemT>
268 inline void transform_array_from_periodic_indices(Array<num_dim, elemT>& out_array,
const Array<num_dim, elemT>& in_array);
273 #undef ActualFunctionObjectPtrIter Array< num_dimensions, elemT > & in_place_log(Array< num_dimensions, elemT > &v)
apply log to each element of the multi-dimensional array
Definition: ArrayFunction.inl:55
void in_place_apply_array_function_on_1st_index(Array< num_dim, elemT > &array, FunctionObjectPtr f)
Apply a function object on all possible 1d arrays extracted by keeping all indices fixed...
Definition: ArrayFunction.inl:115
T & in_place_apply_function(T &v, FUNCTION f)
apply any function(object) to each element of the multi-dimensional array
Definition: ArrayFunction.inl:101
Array< num_dimensions, elemT > & in_place_exp(Array< num_dimensions, elemT > &v)
apply exp to each element of the multi-dimensional array
Definition: ArrayFunction.inl:73
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
defines the Array class for multi-dimensional (numeric) arrays
void apply_array_function_on_1st_index(Array< num_dim, elemT > &out_array, const Array< num_dim, elemT > &in_array, FunctionObjectPtr f)
apply any function(object) to each element of the multi-dimensional array, storing results in a diffe...
Definition: ArrayFunction.inl:152
Array< num_dimensions, elemT > & in_place_abs(Array< num_dimensions, elemT > &v)
store absolute value of each element of the multi-dimensional array
Definition: ArrayFunction.inl:92
void in_place_apply_array_functions_on_each_index(Array< 1, elemT > &array, FunctionObjectPtrIter start, FunctionObjectPtrIter stop)
1d specialisation of the above.
Definition: ArrayFunction.inl:212
Declaration of class stir::ArrayFunctionObject.
Implementations for ArrayFunction.h.
void apply_array_functions_on_each_index(Array< 1, elemT > &out_array, const Array< 1, elemT > &in_array, FunctionObjectPtrIter start, FunctionObjectPtrIter stop)
1d specialisation for general function objects
Definition: ArrayFunction.inl:301