コード例 #1
0
ファイル: codes.go プロジェクト: jsgilmore/goerasure
// NewBlaumRothCode returns a type of bitmatrix code with both the
// bitmatrix and schedule initialised.
func NewBlaumRothCode(k, m, w, packetSize int, bufferSize int64) Coder {
	code := &blaumRothCode{bitmatrixCode{code{k, m, w, packetSize, bufferSize}, nil, nil}}
	code.bitmatrix = C.blaum_roth_coding_bitmatrix(C.int(k), C.int(w))
	code.schedule = C.jerasure_smart_bitmatrix_to_schedule(C.int(k), C.int(m), C.int(w), code.bitmatrix)
	code.ValidateCode()
	return code
}
コード例 #2
0
ファイル: codes.go プロジェクト: jsgilmore/goerasure
// NewLiber8tionCode returns a type of bitmatrix code with both the
// bitmatrix and schedule initialised.
func NewLiber8tionCode(k, m, w, packetSize int, bufferSize int64) Coder {
	code := &liber8tionCode{bitmatrixCode{code{k, m, w, packetSize, bufferSize}, nil, nil}}
	code.bitmatrix = C.liber8tion_coding_bitmatrix(C.int(k))
	code.schedule = C.jerasure_smart_bitmatrix_to_schedule(C.int(k), C.int(m), C.int(w), code.bitmatrix)
	code.ValidateCode()
	return code
}
コード例 #3
0
ファイル: codes.go プロジェクト: jsgilmore/goerasure
// NewCaucheGoodCode returns a type of bitmatrix code with both the
// bitmatrix and schedule initialised.
func NewCauchyGoodCode(k, m, w, packetSize int, bufferSize int64) Coder {
	code := &cauchyGoodCode{bitmatrixCode{code{k, m, w, packetSize, bufferSize}, nil, nil}}
	matrix := C.cauchy_good_general_coding_matrix(C.int(k), C.int(m), C.int(w))
	code.bitmatrix = C.jerasure_matrix_to_bitmatrix(C.int(k), C.int(m), C.int(w), matrix)
	code.schedule = C.jerasure_smart_bitmatrix_to_schedule(C.int(k), C.int(m), C.int(w), code.bitmatrix)
	code.ValidateCode()
	return code
}