diff --git a/src/cluster/cluster.cpp b/src/cluster/cluster.cpp index c7a43b35e83a17368978229f1e544b195f969f69..3344e262619917115b4eee0d037a48a03cd21112 100644 --- a/src/cluster/cluster.cpp +++ b/src/cluster/cluster.cpp @@ -501,9 +501,9 @@ void cluster(string config_file, string data_file, string output_path) { double vk_2 = vk; np_int ndit_2 = ndit; dcomplex **am_2 = new dcomplex*[ndit]; - dcomplex am_2[0] = new dcomplex[ndit * ndit](); - for (int ai = 1; ai < ndit; ai++) { - am_2[ai] = (am_2[0] + ai * ndit); + dcomplex *am_vector_2 = new dcomplex[ndit * ndit](); + for (int ai = 0; ai < ndit; ai++) { + am_2[ai] = (am_vector_2 + ai * ndit); } int isq_2 = isq; int ibf_2 = ibf; @@ -586,7 +586,7 @@ void cluster(string config_file, string data_file, string output_path) { delete[] unsmp_2; delete[] upmp_2; delete[] upsmp_2; - delete[] am_2[0]; + delete[] am_vector_2; delete[] am_2; } // jxi488 loop