method

package
v0.0.0-...-2bcc667 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Galois_GF_15 = Galois_GF{
	// contains filtered or unexported fields
}
View Source
var Galois_GF_256 = Galois_GF{
	// contains filtered or unexported fields
}
View Source
var Galois_GF_EXP_16 = []int{
	1, 2, 4, 8, 3, 6, 12, 11, 5, 10, 7, 14, 15, 13, 9, 1,
}
View Source
var Galois_GF_EXP_256 = []int{}/* 256 elements not displayed */

都是通过上述方法执行生成的

View Source
var Galois_GF_LOG_16 = []int{
	0, 15, 1, 4, 2, 8, 5, 10, 3, 14, 9, 7, 6, 13, 11, 12,
}
View Source
var Galois_GF_LOG_256 = []int{}/* 256 elements not displayed */

Functions

func AllPermutations

func AllPermutations(list []int) [][]int

func AverageColor

func AverageColor(list []img.RGBA) img.RGBA

func BCH_Check_Format

func BCH_Check_Format(fmt int) int

func BCH_Decode_Format

func BCH_Decode_Format(format int) (int, int)

func BCH_Hamming_Weight

func BCH_Hamming_Weight(x int) int

func BinaryToInt

func BinaryToInt(list []int) int

func CheckAllIsNum

func CheckAllIsNum(list []int, num int) bool

func ColorListToRGBA

func ColorListToRGBA(colorList []int) img.RGBA

func ConcatArray

func ConcatArray(arr1 []int, arr2 []int) []int

func Galois_DIV

func Galois_DIV(x, y int, table Galois_GF) int

除法,使用速查表

func Galois_INVERSE

func Galois_INVERSE(x int, table Galois_GF) int

逆,使用速查表,求 1/x = Galois_DIV(1,x)

func Galois_MUL

func Galois_MUL(x, y int, table Galois_GF) int

乘,使用速查表

func Galois_MUL_NO_TABLE

func Galois_MUL_NO_TABLE(x, y, prim int) int

乘,不使用速查表

func Galois_POLY_ADD

func Galois_POLY_ADD(p []int, q []int) []int

多项式,加 多项式,返回新的多项式

func Galois_POLY_DIV

func Galois_POLY_DIV(dividend, divisor []int, table Galois_GF) ([]int, []int)

多项式,除法

func Galois_POLY_EVAL

func Galois_POLY_EVAL(p []int, x int, table Galois_GF) int

多项式,计算多项式在特定x的值

func Galois_POLY_MUL

func Galois_POLY_MUL(p []int, q []int, table Galois_GF) []int

多项式,乘 多项式,返回新的多项式

func Galois_POLY_SCALE

func Galois_POLY_SCALE(p []int, x int, table Galois_GF) []int

多项式,乘以标量,返回新的多项式

func Galois_POW

func Galois_POW(x, power int, table Galois_GF) int

幂,使用速查表

func Galois_SUB

func Galois_SUB(x, y int) int

func Galois_Table

func Galois_Table()

func IntListToString

func IntListToString(numList []int) string

func IntToBinary

func IntToBinary(num int, minLength int) []int

func IntToIntList

func IntToIntList(num int) []int

123 => [1,2,3]

func IsSameColor

func IsSameColor(pointA img.RGBA, pointB img.RGBA) bool

func IterateRGBA

func IterateRGBA(point img.RGBA) []int

func LineIntesect

func LineIntesect(lineA LineInfo, lineB LineInfo) (bool, core.ValuePosition)

两条线段是否有交点,以及交点位置

func ManhattanDistance

func ManhattanDistance(pointA img.RGBA, pointB img.RGBA) float64

func OutputToImg

func OutputToImg(target string, width int, height int, pixels []img.RGBA)

func Permutations

func Permutations(list []int, m int) [][]int

func PerspectiveMap

func PerspectiveMap(posis *[]core.ValuePosition, targetWidth float64, targetHeight float64) []float64

func PerspectiveTransform

func PerspectiveTransform(matrix *[]float64, targetU float64, targetV float64) core.ValuePosition

func PerspectiveTransformBack

func PerspectiveTransformBack(matrix *[]float64, posi core.ValuePosition) core.ValuePosition

func PointDistance

func PointDistance(x1, y1, x2, y2 float64) float64

func PointDistanceInt

func PointDistanceInt(x1, y1, x2, y2 int) int

func RGBAToGrey

func RGBAToGrey(rgba img.RGBA) int

func RS_Calc_Syndromes

func RS_Calc_Syndromes(msg []int, errCorrectSize int, table Galois_GF) []int

证候多项式的计算,如果被扫描消息未损坏,结果应为零

func RS_Correct_Errata

func RS_Correct_Errata(msg []int, synd []int, err_pos []int, table Galois_GF) ([]int, error)

func RS_Encode

func RS_Encode(msg []int, errCorrectSize int, table Galois_GF) []int

func RS_Error_Correct

func RS_Error_Correct(msg []int, nsym int, erase_pos []int, table Galois_GF) ([]int, error)

错误纠正

func RS_Find_Errata_Locator

func RS_Find_Errata_Locator(e_pos []int, table Galois_GF) []int

func RS_Find_Error_Evaluator

func RS_Find_Error_Evaluator(synd []int, err_loc []int, nsym int, table Galois_GF) []int

func RS_Find_Error_Locator

func RS_Find_Error_Locator(synd []int, nsym int, erase_count int, table Galois_GF) []int

使用 Berlekamp-Massey 计算错误定位器多项式

func RS_Find_Errors

func RS_Find_Errors(err_loc []int, msgLength int, table Galois_GF) []int

func RS_Forney_Syndromes

func RS_Forney_Syndromes(synd []int, erase_pos []int, msgSize int, table Galois_GF) []int

计算Forney症状

func RS_Generator_Poly

func RS_Generator_Poly(errorCorrectionSize int, table Galois_GF) []int

根据纠错符号数量,生成多项式

func ReverseArray

func ReverseArray(arr []int) []int

func XOR

func XOR(list []int, list2 []int) []int

Types

type Canopy

type Canopy struct {
	AllPoints []img.RGBA
	Canopies  []*CanopyPoint
	T1        float64
	T2        float64
}

func (*Canopy) Result

func (c *Canopy) Result(size int) []img.RGBA

func (*Canopy) Run

func (c *Canopy) Run()

type CanopyPoint

type CanopyPoint struct {
	Center img.RGBA
	Points []img.RGBA
}

func (*CanopyPoint) Add

func (c *CanopyPoint) Add(point img.RGBA)

type Galois_GF

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

type KMeans

type KMeans struct {
	AllPoints []img.RGBA
	Center    []img.RGBA
	K         int
	// contains filtered or unexported fields
}

func (*KMeans) GetResult

func (k *KMeans) GetResult() []img.RGBA

func (*KMeans) Run

func (k *KMeans) Run()

type LineInfo

type LineInfo struct {
	K   float64
	B   float64
	IsX bool
	X   float64
}

func PointsToLine

func PointsToLine(aX, aY, bX, bY float64) LineInfo

两点求线段,返回 k 和 b 以及是否为横线(即 y = kx + b) 或 x = num

Jump to

Keyboard shortcuts

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