226 std::conditional_t<is_same<Scalar, std::complex<char>>
::value ||
227 is_same<Scalar, std::complex<unsigned char>>
::value ||
228 is_same<Scalar, std::complex<numext::int8_t>>
::value ||
229 is_same<Scalar, std::complex<numext::uint8_t>>
::value,
230 std::complex<int>,
const Scalar&>>
233 const IndexType total_size =
array_prod(tensor.dimensions());
235 std::streamsize explicit_precision;
237 explicit_precision = 0;
240 explicit_precision = 0;
245 explicit_precision = fmt.precision;
248 std::streamsize old_precision = 0;
249 if (explicit_precision) old_precision =
s.precision(explicit_precision);
255 for (IndexType
i = 0;
i < total_size;
i++) {
256 std::stringstream sstr;
259 width = std::max<IndexType>(width, IndexType(sstr.str().length()));
263 for (IndexType
i = 0;
i < total_size;
i++) {
264 std::array<bool, rank> is_at_end{};
265 std::array<bool, rank> is_at_begin{};
268 for (std::size_t
k = 0;
k < rank;
k++) {
269 if ((
i + 1) % (std::accumulate(tensor.dimensions().rbegin(), tensor.dimensions().rbegin() +
k, 1,
270 std::multiplies<IndexType>())) ==
277 for (std::size_t
k = 0;
k < rank;
k++) {
278 if (
i % (std::accumulate(tensor.dimensions().rbegin(), tensor.dimensions().rbegin() +
k, 1,
279 std::multiplies<IndexType>())) ==
281 is_at_begin[
k] =
true;
286 bool is_at_begin_after_newline =
false;
287 for (std::size_t
k = 0;
k < rank;
k++) {
288 if (is_at_begin[
k]) {
289 std::size_t separator_index = (
k < fmt.separator.size()) ?
k : fmt.separator.size() - 1;
290 if (fmt.separator[separator_index].find(
'\n') != std::string::npos) {
291 is_at_begin_after_newline =
true;
296 bool is_at_end_before_newline =
false;
297 for (std::size_t
k = 0;
k < rank;
k++) {
299 std::size_t separator_index = (
k < fmt.separator.size()) ?
k : fmt.separator.size() - 1;
300 if (fmt.separator[separator_index].find(
'\n') != std::string::npos) {
301 is_at_end_before_newline =
true;
306 std::stringstream suffix, prefix, separator;
307 for (std::size_t
k = 0;
k < rank;
k++) {
308 std::size_t suffix_index = (
k < fmt.suffix.size()) ?
k : fmt.suffix.size() - 1;
310 suffix << fmt.suffix[suffix_index];
313 for (std::size_t
k = 0;
k < rank;
k++) {
314 std::size_t separator_index = (
k < fmt.separator.size()) ?
k : fmt.separator.size() - 1;
316 (!is_at_end_before_newline || fmt.separator[separator_index].find(
'\n') != std::string::npos)) {
317 separator << fmt.separator[separator_index];
320 for (std::size_t
k = 0;
k < rank;
k++) {
321 std::size_t spacer_index = (
k < fmt.spacer.size()) ?
k : fmt.spacer.size() - 1;
322 if (
i != 0 && is_at_begin_after_newline && (!is_at_begin[
k] ||
k == 0)) {
323 prefix << fmt.spacer[spacer_index];
326 for (
int k = rank - 1;
k >= 0;
k--) {
327 std::size_t prefix_index = (
static_cast<std::size_t
>(
k) < fmt.prefix.size()) ?
k : fmt.prefix.size() - 1;
328 if (is_at_begin[
k]) {
329 prefix << fmt.prefix[prefix_index];
335 std::stringstream sstr;
339 IndexType scalar_width = scalar_str.length();
340 if (width && scalar_width < width) {
342 for (IndexType
j = scalar_width;
j < width; ++
j) {
343 filler.push_back(fmt.fill);
349 if (
i < total_size - 1) {
350 s << separator.str();
354 if (explicit_precision)
s.precision(old_precision);
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define eigen_assert(x)
Definition: Macros.h:910
SCALAR Scalar
Definition: bench_gemm.cpp:45
static constexpr int Layout
Definition: Tensor.h:81
internal::traits< Self >::Index Index
Definition: Tensor.h:74
@ RowMajor
Definition: Constants.h:320
RealScalar s
Definition: level1_cplx_impl.h:130
char char char int int * k
Definition: level2_impl.h:374
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE auto array_prod(const array< T, N > &arr) -> decltype(array_reduce< product_op, T, N >(arr, static_cast< T >(1)))
Definition: MoreMeta.h:497
squared absolute value
Definition: GlobalFunctions.h:87
@ StreamPrecision
Definition: IO.h:20
@ FullPrecision
Definition: IO.h:20
@ DontAlignCols
Definition: IO.h:19
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
@ IsInteger
Definition: NumTraits.h:174
static void run(std::ostream &stream, const Scalar &scalar, const Format &)
Definition: TensorIO.h:198
@ value
Definition: Meta.h:206
static int run()
Definition: IO.h:121
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2