lincode

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package lincode contains functions and abstractions to work with binary linear codes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func D

func D(a LinearCode) uint

D returns code distance of code

func Encode

func Encode(a LinearCode, v *vector.Vector) *vector.Vector

Encode encodes the message

func Generator

func Generator(a LinearCode) *matrix.Matrix

Generator returns generator matrix of a

func IsEqual

func IsEqual(a, b LinearCode) bool

IsEqual tests if a is equal b or not

func IsSubset

func IsSubset(a, b LinearCode) bool

IsSubset tests if code a is subset of code b

func IterWords

func IterWords(a LinearCode) <-chan *vector.Vector

IterWords iterates over code words of code a

func ParityChecks

func ParityChecks(a LinearCode) *matrix.Matrix

ParityChecks returns parity-check matrix of code a

func Spectrum

func Spectrum(a LinearCode) *map[uint]uint

Spectrum returns weight spectrum of code a

func String

func String(c LinearCode) string

Types

type GenericLinCode

type GenericLinCode struct {
	// contains filtered or unexported fields
}

func (*GenericLinCode) Append

func (c *GenericLinCode) Append(a *GenericLinCode, words []*vector.Vector) *GenericLinCode

func (*GenericLinCode) AppendM

func (*GenericLinCode) GetBasis

func (c *GenericLinCode) GetBasis() []*vector.Vector

func (*GenericLinCode) K

func (c *GenericLinCode) K() uint

func (*GenericLinCode) N

func (c *GenericLinCode) N() uint

func (*GenericLinCode) SetC

func (*GenericLinCode) SetM

func (*GenericLinCode) SetRandom

func (c *GenericLinCode) SetRandom(n, k uint) *GenericLinCode

func (*GenericLinCode) SetV

func (c *GenericLinCode) SetV(words []*vector.Vector) *GenericLinCode

func (*GenericLinCode) SetWholeSpace

func (c *GenericLinCode) SetWholeSpace(n uint) *GenericLinCode

func (*GenericLinCode) SetZero

func (c *GenericLinCode) SetZero(n uint) *GenericLinCode

func (*GenericLinCode) String

func (c *GenericLinCode) String() string

type LinearCode

type LinearCode interface {
	GetBasis() []*vector.Vector
	N() uint
	K() uint
}

LinearCode defines the abstract interface of linear block code

func Dual

func Dual(a LinearCode) LinearCode

Dual returns dual of code a

func HadamardProduct

func HadamardProduct(a, b LinearCode) LinearCode

HadamardProduct returns component-wise (Shur or Hadamard) product of codes a and b

func Hull

func Hull(a LinearCode) LinearCode

Hull returns hull of code a Hull is a intersection of Dual(a) and a

func Intersect

func Intersect(a, b LinearCode) LinearCode

Intersect returns intersection of code a and b

func Puncture

func Puncture(a LinearCode, columns []uint) LinearCode

Puncture evaluates of puncture code. Punctured code is code obtaining by set the positions with indexes from `ncolumns` of every codeword to zero. Punctured code is NOT subcode of original code!

func Sum

func Sum(a, b LinearCode) LinearCode

Sum returns sum of codes a and b: a+b

func Truncate

func Truncate(a LinearCode, columns []uint) LinearCode

Truncate evaluates of truncated code. Truncated code is code obtaining by choose codewords which have coordinates with indexes from `columns` is zero. Unlike the punctured code truncated code is a subcode of original code.

Directories

Path Synopsis
Package rm defines abstraction for Reed-Muller linear codes
Package rm defines abstraction for Reed-Muller linear codes

Jump to

Keyboard shortcuts

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