AFF --- A container for numbers (array) by Friederich and Forbriger.

◆ dump_array_helper()

template<class T >
void aff::anonymous_namespace{dump_array.h}::dump_array_helper ( const aff::ConstArray< T > &  array,
const Tdim i,
const Tdim j,
Strided::TIndexVec index,
std::ostream &  os 
)

recursive usage tests all access functions

Definition at line 67 of file dump_array.h.

References aff::ConstArray< T >::f(), and aff::ConstArray< T >::l().

Referenced by aff::dump_array_values().

71  {
72  if (i>1)
73  {
74  for (index[i]=array.f(i); index[i]<=array.l(i); index[i]++)
75  {
76  os << " dimension ";
77  os << i << ": [" << index[i] << "]";
78  dump_array_helper(array, i-1, j, index, os);
79  }
80  }
81  else if (i>0)
82  {
83  if (i<j) os << endl;
84  os.width(5); os << " ";
85  for (int k=array.f(1); k<=array.l(1); k++)
86  {
87  os.width(6); os << k;
88  }
89  os << endl;
90  for (index[0]=array.f(0); index[0]<=array.l(0); index[0]++)
91  {
92  os.width(5); os << index[0];
93  for (index[1]=array.f(1); index[1]<=array.l(1); index[1]++)
94  {
95  os.width(5);
96  if (j==0)
97  { os << array(index[0]); }
98  else if (j==1)
99  { os << array(index[0], index[1]); }
100  else if (j==2)
101  { os << array(index[0], index[1], index[2]); }
102  else if (j==3)
103  { os << array(index[0], index[1], index[2], index[3]); }
104  else
105  { os << array(index); }
106  os << "#";
107  }
108  os << endl;
109  }
110  }
111  else
112  {
113  for (index[0]=array.f(0); index[0]<=array.l(0); index[0]++)
114  {
115  os.width(5); os << index[0];
116  os.width(5);
117  if (j==0)
118  { os << array(index[0]); }
119  else if (j==1)
120  { os << array(index[0], index[1]); }
121  else if (j==2)
122  { os << array(index[0], index[1], index[2]); }
123  else if (j==3)
124  { os << array(index[0], index[1], index[2], index[3]); }
125  else
126  { os << array(index); }
127  os << "#" << endl;
128  }
129  }
130  }
const Tsubscript & l(const Tsubscript &i) const
return last index of dimension i
Definition: array.h:285
void dump_array_helper(const aff::ConstArray< T > &array, const Tdim &i, const Tdim &j, Strided::TIndexVec &index, std::ostream &os)
recursive usage tests all access functions
Definition: dump_array.h:67
const Tsubscript & f(const Tsubscript &i) const
return first index of dimension i
Definition: array.h:282
Here is the call graph for this function:
Here is the caller graph for this function: