STIR  6.2.0
ArrayFunctionObject_2ArgumentImplementation.h
Go to the documentation of this file.
1 //
2 //
10 /*
11  Copyright (C) 2000- 2009, Hammersmith Imanet Ltd
12  This file is part of STIR.
13 
14  SPDX-License-Identifier: Apache-2.0
15 
16  See STIR/LICENSE.txt for details
17 */
18 
19 #ifndef __stir_ArrayFunctionObject_2ArgumentImplementation_H__
20 #define __stir_ArrayFunctionObject_2ArgumentImplementation_H__
21 
23 #include "stir/Array.h"
24 
25 START_NAMESPACE_STIR
26 
40 template <int num_dimensions, typename elemT>
42 {
43 public:
45  inline void operator()(Array<num_dimensions, elemT>& array) const override
46  {
47  Array<num_dimensions, elemT> copy_array(array);
48  (*this)(array, copy_array);
49  }
50 
51  void operator()(Array<num_dimensions, elemT>& out_array, const Array<num_dimensions, elemT>& in_array) const override
52  {
53  do_it(out_array, in_array);
54  }
55 
56 protected:
57  virtual void do_it(Array<num_dimensions, elemT>& out_array, const Array<num_dimensions, elemT>& in_array) const = 0;
58 };
59 
60 END_NAMESPACE_STIR
61 
62 #endif
A class for operations on n-dimensional Arrays.
Definition: ArrayFunctionObject.h:38
A convenience class for children of ArrayFunctionObject. It implements the in-place operator() in ter...
Definition: ArrayFunctionObject_2ArgumentImplementation.h:41
void operator()(Array< num_dimensions, elemT > &out_array, const Array< num_dimensions, elemT > &in_array) const override
result stored in another array
Definition: ArrayFunctionObject_2ArgumentImplementation.h:51
defines the Array class for multi-dimensional (numeric) arrays
void operator()(Array< num_dimensions, elemT > &array) const override
in-place modification of array, implemented inline
Definition: ArrayFunctionObject_2ArgumentImplementation.h:45
This class defines multi-dimensional (numeric) arrays.
Definition: Array.h:73
Declaration of class stir::ArrayFunctionObject.