From 329a2953158b0d8a4e275053b6e6800b78782142 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Thu, 27 Feb 2025 16:54:50 +0100 Subject: [PATCH] Fix bug in heapsort on complex data --- base/serial/sort/psb_c_hsort_impl.f90 | 2 ++ base/serial/sort/psb_z_hsort_impl.f90 | 2 ++ 2 files changed, 4 insertions(+) diff --git a/base/serial/sort/psb_c_hsort_impl.f90 b/base/serial/sort/psb_c_hsort_impl.f90 index c68ec73b..2400fcf7 100644 --- a/base/serial/sort/psb_c_hsort_impl.f90 +++ b/base/serial/sort/psb_c_hsort_impl.f90 @@ -899,7 +899,9 @@ subroutine psi_c_idx_heap_get_first(key,index,last,heap,idxs,dir,info) endif key = heap(1) + index = idxs(1) heap(1) = heap(last) + idxs(1) = idxs(last) last = last - 1 select case(dir) diff --git a/base/serial/sort/psb_z_hsort_impl.f90 b/base/serial/sort/psb_z_hsort_impl.f90 index 199f5663..e796f831 100644 --- a/base/serial/sort/psb_z_hsort_impl.f90 +++ b/base/serial/sort/psb_z_hsort_impl.f90 @@ -899,7 +899,9 @@ subroutine psi_z_idx_heap_get_first(key,index,last,heap,idxs,dir,info) endif key = heap(1) + index = idxs(1) heap(1) = heap(last) + idxs(1) = idxs(last) last = last - 1 select case(dir)