Example #1
0
// 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
}
Example #2
0
// 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
}
Example #3
0
// 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
}