4 #ifndef tools_histo_axes
5 #define tools_histo_axes
15 template <
class TC,
class TO>
19 typename std::vector< axis<TC,TO> >::size_type dimension = a_axes.size();
20 for(
int iaxis=
int(dimension)-1;iaxis>=0;iaxis--) {
21 index = int(offset/a_axes[iaxis].m_offset);
22 if(index==0)
return true;
23 if(index==(
int(a_axes[iaxis].m_number_of_bins)+1))
return true;
24 offset -= index * a_axes[iaxis].m_offset;
29 template <
class TC,
class TO>
32 typename std::vector< axis<TC,TO> >::size_type dimension = a_axes.size();
33 {
for(
int iaxis=
int(dimension)-1;iaxis>=0;iaxis--) {
34 a_is[iaxis] = int(offset/a_axes[iaxis].m_offset);
35 offset -= a_is[iaxis] * a_axes[iaxis].m_offset;
37 typedef unsigned int dim_t;
38 for(dim_t iaxis=0;iaxis<dimension;iaxis++) {
41 }
else if(a_is[iaxis]==
int(a_axes[iaxis].m_number_of_bins)+1) {
49 template <
class TC,
class TO>
56 if(a_axes.empty())
return false;
57 typename std::vector< axis<TC,TO> >::size_type dimension = a_axes.size();
59 typedef unsigned int dim_t;
60 for(dim_t iaxis=0;iaxis<dimension;iaxis++) {
61 if(!a_axes[iaxis].in_range_to_absolute_index(a_is[iaxis],ibin)) {
65 a_offset += ibin * a_axes[iaxis].
m_offset;