26 #ifndef TILEDARRAY_TENSOR_H__INCLUDED 27 #define TILEDARRAY_TENSOR_H__INCLUDED 57 typename std::enable_if<
60 inline std::ostream&
operator<<(std::ostream& os,
const T& t) {
61 os << t.range() <<
" { ";
62 const auto n = t.range().volume();
63 for(
auto i = 0ul; i < n; ++i)
79 typename std::enable_if<
81 ! detail::is_contiguous_tensor<T>::value>::type* =
nullptr>
82 inline std::ostream&
operator<<(std::ostream& os,
const T& t) {
85 const auto volume = t.range().volume();
87 auto tensor_print_range =
88 [&os,stride] (
typename T::const_pointer MADNESS_RESTRICT
const t_data) {
89 for(decltype(t.range().volume()) i = 0ul; i < stride; ++i)
90 os << t_data[i] <<
" ";
93 os << t.range() <<
" { ";
95 for(decltype(t.range().volume()) i = 0ul; i < volume; i += stride)
96 tensor_print_range(t.data() + t.range().ordinal(i));
105 #endif // TILEDARRAY_SRC_TILEDARRAY_TENSOR_H__INCLUDED
T1::size_type inner_size(const T1 &tensor1, const T2 &)
Get the inner size of two tensors.
Tensor interface for external data.
std::ostream & operator<<(std::ostream &os, const DistArray< Tile, Policy > &a)
Add the tensor to an output stream.
detail::TensorInterface< T, BlockRange > TensorView
Range that references a subblock of another range.
static constexpr bool value