Commit a4f3a8e9 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Get wk_value index from loop indices

parent 4a8cfbd6
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -395,22 +395,15 @@ 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]();
	    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];
		wk_value = tt1->wk[wk_index + j80 - 1];
		wk_index += nlmmt;
		wk_value = tt1->wk[jy50 * nkv * nlmmt + jx50 * nlmmt + j80 - 1];
		w[jx50][jy50] = wk_value;
	      } // jx50
	    } // jy50 loop
	    int ixyz = 0;
	    for (int wj = 0; wj < nrvc; wj++) tfrfme->wsum[j80 - 1][wj] = cc0;
	    for (int iz75 = 0; iz75 < nzv; iz75++) {
	      double z = _zv[iz75] + frsh;
	      for (int iy70 = 0; iy70 < nyv; iy70++) {
@@ -442,7 +435,6 @@ void frfme(string data_file, string output_path) {
	    } // iz75 loop
	    delete[] vec_w;
	    delete[] w;
	    // delete[] wk_local;
	  } // j80 loop
#ifdef USE_NVTX
	  nvtxRangePop();