Skip to content

Commit

Permalink
now an error to qsort{,vec} complex data
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Feb 4, 2025
1 parent a389178 commit 21ee927
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/PDL/Ufunc.pd
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 21ee927

Please sign in to comment.