11#ifndef NDARRAY_formatting_h_INCLUDED
12#define NDARRAY_formatting_h_INCLUDED
27template <
typename Derived,
int N = Derived::ND::value>
class Formatter;
38 std::ios_base::fmtflags _flags;
39 std::string _delimiter;
48 std::ios_base::fmtflags flags = std::ios_base::fmtflags(0),
49 std::string
const & delimiter =
", ",
50 std::string
const & open =
"[",
51 std::string
const & close =
"]"
54 _precision(precision),
56 _delimiter(delimiter),
62 template <
typename Derived>
71template <
typename Derived>
74 options.
apply(os,expr);
81inline std::ostream &
operator<<(std::ostream &os, std::int8_t value) {
82 return os << static_cast<int>(value);
86inline std::ostream &
operator<<(std::ostream &os, std::uint8_t value) {
87 return os << static_cast<int>(value);
94template <
typename Derived,
int N>
108 for (++iter; iter != end; ++iter) {
109 os << options._delimiter;
110 os << std::endl << std::string(level,
' ');
114 os << options._close;
122template <
typename Derived>
135 int precision = os.precision(options._precision);
136 int width = os.width(options._width);
137 std::ios_base::fmtflags flags = os.setf(options._flags,std::ios_base::floatfield);
139 for (++iter; iter != end; ++iter) {
140 os << options._delimiter << (*iter);
142 os.precision(precision);
146 os << options._close;
Definitions for ExpressionBase.
CRTP base class for all multidimensional expressions.
Definition ExpressionBase.h:40
Iterator end() const
Return an Iterator to one past the end of the expression.
Definition ExpressionBase.h:70
Iterator begin() const
Return an Iterator to the beginning of the expression.
Definition ExpressionBase.h:67
bool empty() const
Return true if the first dimension has no elements.
Definition ExpressionBase.h:96
ExpressionTraits< Derived >::Iterator Iterator
Nested expression or element iterator.
Definition ExpressionBase.h:47