Skip to content

Commit

Permalink
Clarified use of print_nd_data utility
Browse files Browse the repository at this point in the history
  • Loading branch information
Beanavil committed Sep 18, 2024
1 parent b9ba1ca commit f0b29b0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Common/example_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,17 @@ void multiply_matrices(T alpha,

/// \brief Prints an {1,2,3}-dimensional array. The last dimension (fastest-index) specified in
/// \p n will be printed horizontally.
///
/// By default a row-major layout of the data is assumed. When printing data in column-major
/// layout, the \p column_major parameter must be set to \p true for a correct interpretation
/// of the dimensions' sizes.
template<class Tdata, class Tsize>
void print_nd_data(const std::vector<Tdata> data,
std::vector<Tsize> np,
const int column_width = 4,
const bool reverse_indexing = false)
const int column_width = 4,
const bool column_major = false)
{
if(reverse_indexing)
if(column_major)
{
std::reverse(np.begin(), np.end());
}
Expand Down

0 comments on commit f0b29b0

Please sign in to comment.