You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! My name is Jose Luis Cercós Pita, and i will implement your radix sort
implementation in my code.
I'm using 0-2 version.
The problem is associated to _MAXINT defined variable (CLRadixSortParam.hpp).
If the unsigned integer type selected has 32 bits (#define _TOTALBITS 32)
_MAXINT overflows the maximum capability of the unsigned int type (because 2^0
has not taken into account).
In order to solve it, I suggest you 3 changes:
CLRadixSortParam.hpp (line 31):
[-] #define _MAXINT (1 << _TOTALBITS)
[+] #define _MAXINT (1 << (_TOTALBITS-1))
CLRadixSort.cpp (line 225):
[-] int pad[_GROUPS * _ITEMS];
[+] unsigned int pad[_GROUPS * _ITEMS];
CLRadixSort.cpp (line 227):
[-] pad[ii]=_MAXINT - 1;
[+] pad[ii]=_MAXINT - (unsigned int)1;
I tested it, and runs OK!
I hope can help!
Regards,
Jose Luis Cercós Pita
Original issue reported on code.google.com by [email protected] on 19 May 2011 at 8:23
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 19 May 2011 at 8:23The text was updated successfully, but these errors were encountered: