21 template <
typename tensor>
24 for (
size_t i = 0; i < t.local_size(); ++i) {
25 Index idx = t.global_index(i);
26 t[i] = idx[0] + idx[1] * 100 + idx[2] * 10000 + idx[3] * 1000000;
28 t.transpose({3, 1, 0, 2});
32 std::string
filename(
const std::string &prefix,
int proc_size) {
33 std::ostringstream ss;
34 ss << prefix <<
"_mpi";
35 ss << std::setw(4) << std::setfill(
'0') << proc_size;
Tensor class. The main object of mptensor.
Definition: tensor.hpp:54
tensor initialize(size_t n)
Definition: common.hpp:22
std::string filename(const std::string &prefix, int proc_size)
Definition: common.hpp:32
Top header file of mptensor.
Tensor< scalapack::Matrix, double > tensor
Definition: atrg.cc:50
Definition: complex.hpp:34
Index Shape
Definition: tensor.hpp:46