From cd3bbc51884b1afe7e1e657e8ff68ccaabbc927d Mon Sep 17 00:00:00 2001 From: Ardavan Oskooi Date: Thu, 17 Aug 2023 14:14:35 +0000 Subject: [PATCH] remove reinterpret_cast of complex numbers in fields::process_incoming_chunk_data --- src/step.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/step.cpp b/src/step.cpp index 773861755..ce70dedb9 100644 --- a/src/step.cpp +++ b/src/step.cpp @@ -179,15 +179,15 @@ void fields::process_incoming_chunk_data(field_type ft, const chunk_pair &comm_p const comms_key key = {ft, CONNECT_PHASE, comm_pair}; size_t num_transfers = get_comm_size(key) / 2; // Two realnums per complex if (num_transfers) { - const std::complex *pair_comm_block_complex = - reinterpret_cast *>(pair_comm_block); const std::vector &incoming_connection = chunks[this_chunk_idx]->connections_in.at(key); const std::vector > &connection_phase_for_ft = chunks[this_chunk_idx]->connection_phases[key]; for (size_t n = 0; n < num_transfers; ++n) { - std::complex temp = connection_phase_for_ft[n] * pair_comm_block_complex[n]; + std::complex temp = + connection_phase_for_ft[n] * + std::complex(pair_comm_block[2 * n], pair_comm_block[2 * n + 1]); *(incoming_connection[2 * n]) = temp.real(); *(incoming_connection[2 * n + 1]) = temp.imag(); }