Function array_2d_trans_out (o2scl)¶
-
template<class mat_t>
void o2scl::array_2d_trans_out(std::ostream &os, size_t nrows, size_t ncols, mat_t &A)¶ A operator for simple matrix output using
operator
[].The type
mat_t
can be any 2d-array type which allows individual element access using[size_t][size_t]
This outputs all of the matrix elements using output settings specified by
os
. The alignment performed by columnify using columnify::align_dp, i.e. the numbers are aligned by their decimal points. If the numbers have no decimal points, then the decimal point is assumed to be to the right of the last character in the string representation of the number.Todo
Future: If all of the matrix elements are positive integers and scientific mode is not set, then we can avoid printing the extra spaces.
This function outputs the matrix assuming the first index is the column index and the second index is the row index. For the opposite convention, use array_2d_out().