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
Guava's code for computing minimum distance of codes over GF(2) or GF(3) is broken when the code's block length is larger than 2**16. This happens because in the C code short type is used in many places (all the C code is in the folder src/ctjhai/). For example, see src/ctjhai/types.h.
I suggest to use unsigned long everywhere (maybe just the MATRIX struct should use unsigned char to save some memory, since only GF(2) and GF(3) are supported). Such replacement would also require appropriate changes in format strings. Moreover, many ints should be replaced too, as I think it's possible that larger codes are also analyzed, i.e. with length greater than 2**32. But I don't know if Guava itself can hold such large codes.
I can make a pull request with type changes if it's agreed.
Also there should be a check somewhere whether the block length is higher than possible to hold in the current architecture's word. Otherwise, an error should be thrown.
I arrived at this bug when using it from SageMath. See the following simple example, where the minimum distance is clearly 2, but Guava returns 0. Similar error happens on almost any other code with large block length.
SageMath version 8.7, Release Date: 2019-03-23 │Using Python 2.7.15
GAP 4.10.0 of 01-Nov-2018
Architecture: x86_64-pc-linux-gnu-default64
GUAVA Version 3.14
The text was updated successfully, but these errors were encountered:
Guava's code for computing minimum distance of codes over GF(2) or GF(3) is broken when the code's block length is larger than 2**16. This happens because in the C code
short
type is used in many places (all the C code is in the folder src/ctjhai/). For example, see src/ctjhai/types.h.I suggest to use
unsigned long
everywhere (maybe just the MATRIX struct should useunsigned char
to save some memory, since only GF(2) and GF(3) are supported). Such replacement would also require appropriate changes in format strings. Moreover, manyint
s should be replaced too, as I think it's possible that larger codes are also analyzed, i.e. with length greater than 2**32. But I don't know if Guava itself can hold such large codes.I can make a pull request with type changes if it's agreed.
Also there should be a check somewhere whether the block length is higher than possible to hold in the current architecture's word. Otherwise, an error should be thrown.
I arrived at this bug when using it from SageMath. See the following simple example, where the minimum distance is clearly 2, but Guava returns 0. Similar error happens on almost any other code with large block length.
For completeness, here are versions that I use:
The text was updated successfully, but these errors were encountered: