Commit 3eabce46 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Fix indexes in Transition Matrix HDF5 output

parent ee8ca023
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -235,8 +235,8 @@ void TransitionMatrix::write_hdf5(string file_name) {
    double *ptr_elements = new double[shape[0] * 2 * shape[1]]();
    for (int ei = 0; ei < shape[0]; ei++) {
      for (int ej = 0; ej < shape[1]; ej++) {
	ptr_elements[ei * (2 * ej)] = elements[shape[1] * ei + ej].real();
	ptr_elements[ei * (2 * ej) + 1] = elements[shape[1] * ei  + ej].imag();
	ptr_elements[shape[1] * ei + 2 * ej] = elements[shape[1] * ei + ej].real();
	ptr_elements[shape[1] * ei + 2 * ej + 1] = elements[shape[1] * ei  + ej].imag();
      }
    }
    rec_ptr_list.append(ptr_elements);