Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DecoderState ¶ added in v0.2.2
type DecoderState struct {
// contains filtered or unexported fields
}
func NewDecoderState ¶ added in v0.2.2
func NewDecoderState(gf *galoisfield.GF, coeffs, coded Matrix) *DecoderState
func NewDecoderStateWithPieceCount ¶ added in v0.2.2
func NewDecoderStateWithPieceCount(gf *galoisfield.GF, pieceCount uint) *DecoderState
func (*DecoderState) AddPiece ¶ added in v0.2.2
func (d *DecoderState) AddPiece(codedPiece *kodr.CodedPiece)
Adds a new coded piece to decoder state, which will hopefully help in decoding pieces, if linearly independent with other rows i.e. read pieces
func (*DecoderState) CodedPieceMatrix ¶ added in v0.2.2
func (d *DecoderState) CodedPieceMatrix() Matrix
Current state of coded piece matrix, which is updated along side coding coefficient matrix ( during rref )
func (*DecoderState) CoefficientMatrix ¶ added in v0.2.2
func (d *DecoderState) CoefficientMatrix() Matrix
Current state of coding coefficient matrix
func (*DecoderState) GetPiece ¶ added in v0.2.2
func (d *DecoderState) GetPiece(idx uint) (kodr.Piece, error)
Request decoded piece by index ( 0 based, definitely )
If piece not yet decoded/ requested index is >= #-of pieces coded together, returns error message indicating so
Otherwise piece is returned, without any error ¶
Note: This method will copy decoded piece into newly allocated memory when whole decoding hasn't yet happened, to prevent any chance that user mistakenly modifies slice returned ( read piece ) & that affects next round of decoding ( when new piece is received )
func (*DecoderState) Rank ¶ added in v0.2.2
func (d *DecoderState) Rank() uint
Expected to be invoked after RREF-ed, in other words it won't rref matrix first to calculate rank, rather that needs to first invoked
func (*DecoderState) Rref ¶ added in v0.2.2
func (d *DecoderState) Rref()
Calculates Reduced Row Echelon Form of coefficient matrix, while also modifying coded piece matrix First it forward, backward cleans up matrix i.e. cells other than pivots are zeroed, later it checks if some rows of coefficient matrix are linearly dependent or not, if yes it removes those, while respective rows of coded piece matrix is also removed --- considered to be `not useful piece`
Note: All operations are in-place, no more memory allocations are performed
type Matrix ¶
type Matrix [][]byte
func (*Matrix) Cmp ¶
Cell by cell value comparision of two matrices, which returns `true` only if all cells are found to be equal