///|
/// Allocate independent rows: Array::make(rows, row) would alias mutable data.
fn zero_matrix(rows : Int32, columns : Int32) -> Array[Array[Int32]] {
  let result : Array[Array[Int32]] = []
  for _ in 0.. Array[Array[Int32]] {
  let matrix = zero_matrix(p.ldpc + p.hdpc, p.total)
  let width = p.lt - p.ldpc
  for column in 0..= 0 {
    for row in 0.. Array[Int32] {
  let row = Array::make(p.total, 0)
  for index in encoding_indices(p, id) {
    row[index] = row[index] ^ 1
  }
  row
}

///|
/// Solve A*C=D without exposing partial state. Inputs are scratch matrices.
/// ponytail: dense bounded solver first; sparse inactivation is future work.
fn solve(
  matrix : Array[Array[Int32]],
  data : Array[Array[Int32]],
  columns : Int32,
) -> Result[Array[Array[Int32]]?, RaptorError] {
  let mut rank = 0
  let pivots : Array[Int32] = []
  for column in 0..= 0 {
    for previous in 0.. Bytes {
  let payload = Array::make(symbol_size, 0)
  for index in encoding_indices(p, id) {
    add_scaled(payload, intermediate[index], 1, 0)
  }
  let out = @buffer.Buffer::Buffer()
  for value in payload {
    out.write_byte(value.to_byte())
  }
  out.to_bytes()
}