Coder Social home page Coder Social logo

Comments (4)

liujiangang01 avatar liujiangang01 commented on August 21, 2024

测试代码参数调整:
p a360n 7k2jwmu zmunmc
v h3wia8s w yvuh9x 8a
测试代码参数调整成k=9,m=18,并且模拟0, 1, 2, 5, 7, 9, 10, 14, 16列损坏,运行结果(报错)如下:
p m3tlm 9 2k6o0 51v_286

from isa-l.

gbtucker avatar gbtucker commented on August 21, 2024

I don't think this is a bug but you are pushing the limits of a Vandermonde matrix. As described in the header for gf_gen_rs_matrix for k = 9 you are not guaranteed an invertable matrix unless m <= 13. You might consider using a different encoding matrix like a Cauchy-based one the example uses. You can test this will work with:

$ ./ec_simple_example -k 9 -p 9 -e 0 -e 1 -e 2 -e 5 -e 7 -e 9 -e 10 -e 14 -e 16
ec_simple_example:
 encode (m,k,p)=(18,9,9) len=8192
 recover 9 fragments
 check recovery of block { 0 1 2 5 7 9 10 14 16 } done all: Pass

from isa-l.

liujiangang01 avatar liujiangang01 commented on August 21, 2024

Thanks,yesterday I use Cauchy-based matrix, it does work

from isa-l.

jasonkresch avatar jasonkresch commented on August 21, 2024

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

from isa-l.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.