Skip to content

Commit

Permalink
Add primitive binary BCH codes
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed Jun 11, 2021
1 parent af54a87 commit 1ecbd56
Show file tree
Hide file tree
Showing 11 changed files with 1,420 additions and 1 deletion.
12 changes: 12 additions & 0 deletions docs/pages/galois.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ Linear Sequences

berlekamp_massey

Forward Error Correcting Codes
------------------------------
.. rubric::
.. autosummary::
:template: class.rst
:toctree:

BCH
bch_valid_codes
bch_generator_poly
bch_generator_matrix

Finite Groups
-------------
.. rubric::
Expand Down
1 change: 1 addition & 0 deletions galois/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .version import __version__

# Subpackages
from .code import *
from .group import *
from .field import *

Expand Down
3 changes: 3 additions & 0 deletions galois/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): # pylint: disable=
raise NotImplementedError(f"The numpy ufunc '{ufunc.__name__}' is not supported on {type(self).name} arrays. If you believe this ufunc should be supported, please submit a GitHub issue at https://github.com/mhostetter/galois/issues.")

else:
if ufunc in [np.bitwise_and, np.bitwise_or, np.bitwise_xor] and method not in ["reduce", "accumulate", "at", "reduceat"]:
kwargs["casting"] = "unsafe"

inputs, kwargs = type(self)._view_inputs_as_ndarray(inputs, kwargs)
output = super().__array_ufunc__(ufunc, method, *inputs, **kwargs) # pylint: disable=no-member

Expand Down
5 changes: 5 additions & 0 deletions galois/code/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
A subpackage containing forward error correction codes.
"""
from .bch import *
from .bch_functions import *
Loading

0 comments on commit 1ecbd56

Please sign in to comment.