20 #include <tensor/io.h>
24 template<
typename elt_t>
26 MatrixForm<elt_t>::display(std::ostream &s)
const
28 if (data.rank() > 2) {
29 std::cerr <<
"MatrixForm can only be used with two-dimensional tensors.\n";
31 }
else if (data.rank() == 2) {
32 index rows = data.rows();
33 index cols = data.columns();
34 for (index i = 0; i < rows; i++) {
39 for (index j = 0; j < cols; j++) {
45 }
else if (data.rank() == 1) {
46 for (index i = 0; i < data.size(); i++) {