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

Clarify gf_gen_rs_matrix documentation #26

Closed
asomers opened this issue Oct 15, 2017 · 3 comments
Closed

Clarify gf_gen_rs_matrix documentation #26

asomers opened this issue Oct 15, 2017 · 3 comments

Comments

@asomers
Copy link

asomers commented Oct 15, 2017

In the PDF documentation for gf_gen_rs_matrix, there is a list of inequalities which will guarantee that every submatrix of the result will be invertible. However, the inequalities are rendered in such a way that they all kind of run together. Maybe there are some missing commas? Or maybe the inequalities come in pairs? It's really unclear. Could you please clarify it?

@asomers asomers changed the title Clarify gf_gen_rs_matrix documentation Clarify gf_gen_rs_matrix documentation Oct 15, 2017
@gbtucker
Copy link
Contributor

There is a test function included called gen_rs_matrix_limits that is intended to help explore the bounties where sub-matrices are invertible for gf_gen_rs_matrix up to some max. It should make it more clear as it prints for each k the highest m found up to max search. Note that the encoding generator functions gf_gen_rs_matrix() and gf_gen_cauchy1_matrix() are only two examples of how to pick an encoder and the function ec_encode_data() will work for any encoding matrix.

@gbtucker
Copy link
Contributor

Sorry, I realize what you mean now about the pdf version. Doxygen was collapsing newlines and running them together. We pushed a fix in latest.

@jasonkresch
Copy link

There is a way to generate a systematic encoding matrix that is guaranteed to be invertible in any case. It works as follows:

Step 1. Generate a K by K+M Vandermonde matrix
Step 2. Generate a K by K Vandermonde matrix
Step 3. Invert the K by K Vandermonde matrix generated in step 2
Step 4. Multiply the matrix generated step 1 by the inverse Vandermonde matrix created in step 3

The matrix resulting from step 4 can serve as an encoding matrix. The first K x K rows will correspond to the identity matrix. The remaining bottom M rows can serve the purposes of encoding redundancy.

For reference, this is how the matrix is generated in other Reed-Solomon libraries, such as zfec:
https://github.com/tahoe-lafs/zfec/blob/master/zfec/fec.c#L420

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

No branches or pull requests

3 participants