Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sparse: fix alist format by including padding #3

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

daniestevez
Copy link
Owner

In #2 it was pointed that the alist format used by ldpc-toolbox is incorrect because it does not include zeros for padding of irregular codes, as required by MacKay's original definition.

This fixes the problem in the following way:

  • The SparseMatrix::from_alist function supports reading both the format with zero padding and the format without zero padding.

  • The SparseMatrix::write_alist and SparseMatrix::alist functions now include zero padding. There are variants of these functions called write_alist_no_padding and alist_no_padding which omit the zero padding.

Additionally, the whitespace at the end of each line generated by write_alist has been removed.

@daniestevez
Copy link
Owner Author

@page0egap let me know if this looks good.

@page0egap
Copy link

page0egap commented Oct 4, 2024

In file sparse.rs, in line 315-316, the comments are wrong. alist_no_padding does not include padding.

I review all changes and do not find other errors. For myself, it's able to parse irregular ldpc's alist format file, for example CCSDS(N=128, M=64). I think it solves my problem.

In #2 it was pointed that the alist format used by ldpc-toolbox
is incorrect because it does not include zeros for padding of
irregular codes, as required by MacKay's original definition.

This fixes the problem in the following way:

- The SparseMatrix::from_alist function supports reading both
  the format with zero padding and the format without zero padding.

- The SparseMatrix::write_alist and SparseMatrix::alist functions
  now include zero padding. There are variants of these functions
  called write_alist_no_padding and alist_no_padding which omit the
  zero padding.

Additionally, the whitespace at the end of each line generated by
write_alist has been removed.
@daniestevez
Copy link
Owner Author

In file sparse.rs, in line 315-316, the comments are wrong

Good catch! A copy & paste mistake. I've just fixed this and force-pushed.

@daniestevez daniestevez merged commit d73dbe4 into main Oct 4, 2024
1 check passed
@daniestevez daniestevez deleted the fix-alist-format branch October 4, 2024 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants