Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions src/TiledArray/tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@
#define TILEDARRAY_TENSOR_H__INCLUDED

#include <TiledArray/block_range.h>
#include <TiledArray/tensor/operators.h>
#include <TiledArray/tensor/shift_wrapper.h>

#include <TiledArray/tensor/tensor.h>

#include <TiledArray/tensor/tensor_interface.h>
#include <TiledArray/tensor/tensor_map.h>

#include <TiledArray/tile_op/tile_interface.h>

#include <TiledArray/tensor/operators.h>
#include <TiledArray/tensor/shift_wrapper.h>

namespace TiledArray {

// Template aliases for TensorInterface objects
Expand Down Expand Up @@ -94,15 +99,15 @@ inline std::ostream& operator<<(std::ostream& os, const T& t) {
return os;
}

template<typename T,
typename = std::enable_if_t<detail::is_tensor_of_tensor_v<T>>>
inline std::ostream& operator<<(std::ostream& os, const T& t){
os << t.range() << " {" << std::endl; // Outer tensor's range
for(auto idx : t.range()){ // Loop over inner tensors
template <typename T,
typename = std::enable_if_t<detail::is_tensor_of_tensor_v<T>>>
inline std::ostream& operator<<(std::ostream& os, const T& t) {
os << t.range() << " {" << std::endl; // Outer tensor's range
for (auto idx : t.range()) { // Loop over inner tensors
const auto& inner_t = t(idx);
os << " " << idx << ":" << inner_t << std::endl;
}
os << "}"; // End outer tensor
os << "}"; // End outer tensor
return os;
}

Expand Down