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

◆ dump_map_helper()

void aff::anonymous_namespace{dump.cc}::dump_map_helper ( const Strided shape,
const Tdim i,
const Tdim j,
Strided::TIndexVec index,
std::ostream &  os 
)

recursive usage tests all offset functions

Definition at line 80 of file dump.cc.

References aff::Strided::first(), aff::Strided::last(), and aff::Strided::offset().

Referenced by aff::dump_map().

82  {
83  if (i>1)
84  {
85  for (index[i]=shape.first(i); index[i]<=shape.last(i); index[i]++)
86  {
87  os << " dimension ";
88  os << i << ": [" << index[i] << "]";
89  dump_map_helper(shape, i-1, j, index, os);
90  }
91  }
92  else if (i>0)
93  {
94  if (i<j) os << endl;
95  os.width(5); os << " ";
96  for (int k=shape.first(1); k<=shape.last(1); k++)
97  {
98  os.width(6); os << k;
99  }
100  os << endl;
101  for (index[0]=shape.first(0); index[0]<=shape.last(0); index[0]++)
102  {
103  os.width(5); os << index[0];
104  for (index[1]=shape.first(1); index[1]<=shape.last(1); index[1]++)
105  {
106  os.width(5);
107  if (j==0)
108  { os << shape.offset(index[0]); }
109  else if (j==1)
110  { os << shape.offset(index[0], index[1]); }
111  else if (j==2)
112  { os << shape.offset(index[0], index[1], index[2]); }
113  else if (j==3)
114  { os << shape.offset(index[0], index[1], index[2], index[3]); }
115  else
116  { os << shape.offset(index); }
117  os << "#";
118  }
119  os << endl;
120  }
121  }
122  else
123  {
124  for (index[0]=shape.first(0); index[0]<=shape.last(0); index[0]++)
125  {
126  os.width(5); os << index[0];
127  os.width(5);
128  if (j==0)
129  { os << shape.offset(index[0]); }
130  else if (j==1)
131  { os << shape.offset(index[0], index[1]); }
132  else if (j==2)
133  { os << shape.offset(index[0], index[1], index[2]); }
134  else if (j==3)
135  { os << shape.offset(index[0], index[1], index[2], index[3]); }
136  else
137  { os << shape.offset(index); }
138  os << "#" << endl;
139  }
140  }
141  }
void dump_map_helper(const Strided &shape, const Tdim &i, const Tdim &j, Strided::TIndexVec &index, std::ostream &os)
recursive usage tests all offset functions
Definition: dump.cc:80
Here is the call graph for this function:
Here is the caller graph for this function: