diff --git a/Changes b/Changes index 79d8c6553..df5a4c459 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ - fix Math function prototypes for GCC 15 (#528) - thanks @jplesnik for report - Basic::rvals to allow Centre as ndarray (#532) - thanks @wlmb +- now an error to qsort{,vec} complex data 2.099 2025-01-23 - fix test that assumed acosh(0)->byte, i.e. nan()->byte, was always 0 (#514) - thanks @eserte for report diff --git a/lib/PDL/Ufunc.pd b/lib/PDL/Ufunc.pd index f57fbb68a..1adeb6369 100644 --- a/lib/PDL/Ufunc.pd +++ b/lib/PDL/Ufunc.pd @@ -1045,7 +1045,7 @@ sub qsort_returnempty { 'if ($PDL(a)->nvals == 0) return PDL_err;' } pp_def('qsort', HandleBad => 1, Inplace => 1, - Pars => 'a(n); [o]b(n);', + Pars => '!complex a(n); !complex [o]b(n);', CHeader => 'PDL_TYPELIST_REAL(PDL_QSORT)', Code => PDL::PP::pp_line_numbers(__LINE__, ' register PDL_Indx nn = PDL_IF_BAD(0,$SIZE(n)); @@ -1083,7 +1083,7 @@ Bad values are moved to the end of the array: pp_def('qsorti', HandleBad => 1, - Pars => 'a(n); indx [o]indx(n);', + Pars => '!complex a(n); indx [o]indx(n);', CHeader => $chdr_qsorti, Code => PDL::PP::pp_line_numbers(__LINE__, ' register PDL_Indx nn = PDL_IF_BAD(0,$SIZE(n)-1), nb = $SIZE(n) - 1; (void)nb; @@ -1120,7 +1120,7 @@ Quicksort a vector and return index of elements in ascending order. pp_def('qsortvec', HandleBad => 1, Inplace => 1, - Pars => 'a(n,m); [o]b(n,m);', + Pars => '!complex a(n,m); !complex [o]b(n,m);', CHeader => $chdr_qsortvec_def . $chdr_qsortvec, Code => ' register PDL_Indx nn = PDL_IF_BAD(0,$SIZE(m)-1); @@ -1195,7 +1195,7 @@ Vectors with bad components are moved to the end of the array: pp_def('qsortveci', HandleBad => 1, - Pars => 'a(n,m); indx [o]indx(m);', + Pars => '!complex a(n,m); indx [o]indx(m);', CHeader => $chdr_qsortvec_def . $chdr_qsortvec_ind, Code => 'register PDL_Indx nn = PDL_IF_BAD(0,$SIZE(m)-1);