npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
rescanArray.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_RESCANARRAY_HH_
2 #define NPSTAT_RESCANARRAY_HH_
3 
4 /*!
5 // \file rescanArray.hh
6 //
7 // \brief Fill a multidimensional array using values from another array
8 // with a different shape
9 //
10 // Author: I. Volobouev
11 //
12 // October 2010
13 */
14 
15 #include "npstat/nm/ArrayND.hh"
16 
17 namespace npstat {
18  /**
19  // A utility for filling one array using values of another. The
20  // array shapes do not have to be the same but the ranks have to be.
21  // Roughly, the arrays are treated as values of histogram bins inside
22  // the unit box. The array "to" is filled either with the closest bin
23  // value of the array "from" or with an interpolated value (if
24  // "interpolationDegree" parameter is not 0).
25  //
26  // interpolationDegree parameter must be one of 0, 1, or 3.
27  */
28  template<typename Num1, unsigned Len1, unsigned Dim1,
29  typename Num2, unsigned Len2, unsigned Dim2>
32  unsigned interpolationDegree=0);
33 #ifdef SWIG
34  template<class Arr1, class Arr2>
35  inline void rescanArray2(const Arr1& from, Arr2* to,
36  unsigned interpolationDegree=0)
37  {
38  rescanArray(from, to, interpolationDegree);
39  }
40 #endif // SWIG
41 }
42 
43 #include "npstat/nm/rescanArray.icc"
44 
45 #endif // NPSTAT_RESCANARRAY_HH_
Arbitrary-dimensional array template.
Definition: ArrayND.hh:93
Definition: AbsArrayProjector.hh:14
void rescanArray(const ArrayND< Num1, Len1, Dim1 > &from, ArrayND< Num2, Len2, Dim2 > *to, unsigned interpolationDegree=0)