diff -Naur PDL-2.4.3/Basic/Primitive/primitive.pd PDL-2.4.3-fix/Basic/Primitive/primitive.pd --- PDL-2.4.3/Basic/Primitive/primitive.pd 2006-07-10 17:46:24.000000000 -0400 +++ PDL-2.4.3-fix/Basic/Primitive/primitive.pd 2006-08-24 19:25:58.109375000 -0400 @@ -808,7 +808,7 @@ my \$uniq = (\$srt != \$srt->rotate(-1)) -> mv(0,-1) -> orover->which; return \$uniq->nelem==0 ? - \$srt->slice(":,(0)") : + \$srt->slice("0,:")->mv(0,-1) : \$srt->dice(\$uniq)->mv(0,-1); } diff -Naur PDL-2.4.3/Basic/Ufunc/ufunc.pd PDL-2.4.3-fix/Basic/Ufunc/ufunc.pd --- PDL-2.4.3/Basic/Ufunc/ufunc.pd 2006-06-21 11:46:51.000000000 -0400 +++ PDL-2.4.3-fix/Basic/Ufunc/ufunc.pd 2006-08-24 19:19:37.234375000 -0400 @@ -483,17 +483,18 @@ void pdl_qsortvec_\$ppsym(\$ctype *xx, int n, int a, int b) { - int i,j; - \$ctype t, *median; + int i,j, median_ind; + + \$ctype t; i = a; j = b; - median = &xx[n*((i+j)/2)]; + median_ind = (i+j)/2; do { - while( pdl_cmpvec_\$ppsym( &(xx[n*i]), median, n ) < 0 ) + while( pdl_cmpvec_\$ppsym( &(xx[n*i]), &(xx[n*median_ind]), n ) < 0 ) i++; - while( pdl_cmpvec_\$ppsym( &(xx[n*j]), median, n ) > 0 ) + while( pdl_cmpvec_\$ppsym( &(xx[n*j]), &(xx[n*median_ind]), n ) > 0 ) j--; if(i<=j) { int k; @@ -505,6 +506,12 @@ *aa = *bb; *bb = z; } + + if (median_ind==i) + median_ind=j; + else if (median_ind==j) + median_ind=i; + i++; j--; }