Commit 4a8cfbd6 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Extract only the necessary element from wk in j80 loop

parent d0ff91f2
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -395,15 +395,18 @@ void frfme(string data_file, string output_path) {
	  for (int j80 = jlmf; j80 <= jlml; j80++) {
	    dcomplex *vec_w = new dcomplex[nkv * nkv]();
	    dcomplex **w = new dcomplex*[nkv];
	    dcomplex *wk_local = new dcomplex[nlmmt]();
	    // dcomplex *wk_local = new dcomplex[nlmmt]();
	    for (int wi = 0; wi < nkv; wi++) w[wi] = vec_w + wi * nkv;
	    dcomplex wk_value;
	    int wk_index = 0;
	    int nkvs = nkv * nkv;
	    for (int jy50 = 0; jy50 < nkv; jy50++) {
	      for (int jx50 = 0; jx50 < nkv; jx50++) {
		for (int wi = 0; wi < nlmmt; wi++) wk_local[wi] = tt1->wk[wk_index++];
		w[jx50][jy50] = wk_local[j80 - 1];
		// w[jx50][jy50] = tt1->wk[jy50 * nkvs + jx50 * nkv + j80 - 1];
		// for (int wi = 0; wi < nlmmt; wi++) wk_local[wi] = tt1->wk[wk_index++];
		// w[jx50][jy50] = wk_local[j80 - 1];
		wk_value = tt1->wk[wk_index + j80 - 1];
		wk_index += nlmmt;
		w[jx50][jy50] = wk_value;
	      } // jx50
	    } // jy50 loop
	    int ixyz = 0;
@@ -439,7 +442,7 @@ void frfme(string data_file, string output_path) {
	    } // iz75 loop
	    delete[] vec_w;
	    delete[] w;
	    delete[] wk_local;
	    // delete[] wk_local;
	  } // j80 loop
#ifdef USE_NVTX
	  nvtxRangePop();