1 #ifndef STK_UTIL_UTIL_FArrayPrint_h 2 #define STK_UTIL_UTIL_FArrayPrint_h 14 template<
unsigned N>
struct ArrayVerbosePrint ;
17 struct ArrayVerbosePrint<0>
20 static std::ostream &
dump(std::ostream &os,
const unsigned *
const,
const T *,
const unsigned *
const)
27 struct ArrayVerbosePrint<1>
30 static std::ostream &
dump(std::ostream &os,
const unsigned *
const dim,
31 const T *a_ptr,
const unsigned *
const a_inc)
33 const unsigned inc = *a_inc ;
34 const T * ptr = a_ptr;
35 const T *
const end = ptr + *dim * inc ;
37 while ( ptr != end ) {
50 struct ArrayVerbosePrint<2>
54 static std::ostream &
dump(std::ostream &os,
const unsigned *
const dim,
55 const T *a_ptr,
const unsigned *
const a_inc)
58 const unsigned inc = a_inc[1] ;
59 const T * r_ptr = a_ptr;
60 const T *
const end = r_ptr + dim[1] * inc ;
62 while ( r_ptr != end ) {
64 const unsigned inner_inc = *a_inc ;
65 const T *
c_ptr = r_ptr;
66 const T *
const inner_end = c_ptr + dim[0] * inner_inc ;
68 while ( c_ptr != inner_end ) {
82 const unsigned inc = a_inc[1] ;
83 const T * ptr = a_ptr;
84 const T *
const end = ptr + dim[1] * inc ;
85 while ( ptr != end ) {
97 struct ArrayVerbosePrint<3>
101 static std::ostream &
dump(std::ostream &os,
const unsigned *
const dim,
102 const T *a_ptr,
const unsigned *
const a_inc)
120 const unsigned ia = a_inc[2] ;
122 const T *
const a_end = a_ptr + a_inc[3];
123 while ( a_end != a_ptr ) {
125 for (
unsigned i = 0; i < 2; ++i)
126 os <<
"0:" << dim[i] - 1 <<
", ";
127 os << index <<
")" << std::endl;
129 os << std::endl << std::endl;
140 struct ArrayVerbosePrint
144 static std::ostream &
dump(std::ostream &os,
const unsigned *
const dim,
145 const T *a_ptr,
const unsigned *
const a_inc)
147 const unsigned ia = a_inc[N - 1] ;
149 const T *
const a_end = a_ptr + a_inc[N];
150 while ( a_end != a_ptr ) {
152 for (
unsigned i = 0; i < N - 1; ++i)
153 os <<
"0:" << dim[i] - 1 <<
", ";
154 os << index <<
")" << std::endl;
156 os << std::endl << std::endl;
167 template<
class ElementType,
190 template<
class ElementType,
213 template<
class ElementType,
int Dimension>
228 template<
class ElementType,
int Dimension>
244 #endif // STK_UTIL_UTIL_FArrayPrint_h
Writer & dump(Writer &dout, const std::vector< T > &t)
Template dump prints the object contained within a std::vector object to the diagnostic writer...
Extend Array with deep copy assignment and resize operations.
Multidimensional array of contiguous memory. The memory is not owned by the array, but container access semantics are enforced, i.e. const Array<> elements cannot be assigned to.
Extend FArray with deep copy assignment and resize operations.
c_ptr_< T > c_ptr(const T *t)
const unsigned * dimension() const
Multidimensional array view of contiguous memory.
std::ostream & operator<<(std::ostream &s, const Bucket &k)
Print the part names for which this bucket is a subset.