matrix

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2021 License: CC0-1.0 Imports: 2 Imported by: 0

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

func (m *Matrix) Cmp(m_ Matrix) bool

Cell by cell value comparision of two matrices, which returns `true` only if all cells are found to be equal

func (*Matrix) Cols

func (m *Matrix) Cols() uint

#-of columns in matrix

This isn't expected to change after initialised

func (*Matrix) Multiply

func (m *Matrix) Multiply(field *galoisfield.GF, with Matrix) (Matrix, error)

Multiplies two matrices ( which can be multiplied ) in order `m x with`

func (*Matrix) Rows

func (m *Matrix) Rows() uint

#-of rows in matrix

This may change in runtime, when some rows are removed as they're found to be linearly dependent with some other row, after application of RREF

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL