Interface CodingLoop

All Known Implementing Classes:
ByteInputOutputExpCodingLoop, ByteInputOutputTableCodingLoop, ByteOutputInputExpCodingLoop, ByteOutputInputTableCodingLoop, CodingLoopBase, InputByteOutputExpCodingLoop, InputByteOutputTableCodingLoop, InputOutputByteExpCodingLoop, InputOutputByteTableCodingLoop, OutputByteInputExpCodingLoop, OutputByteInputTableCodingLoop, OutputInputByteExpCodingLoop, OutputInputByteTableCodingLoop

public interface CodingLoop
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final CodingLoop[]
    All of the available coding loop algorithms.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkSomeShards(byte[][] matrixRows, byte[][] inputs, int inputCount, byte[][] toCheck, int checkCount, int offset, int byteCount, byte[] tempBuffer)
    Multiplies a subset of rows from a coding matrix by a full set of input shards to produce some output shards, and checks that the the data is those shards matches what's expected.
    void
    codeSomeShards(byte[][] matrixRows, byte[][] inputs, int inputCount, byte[][] outputs, int outputCount, int offset, int byteCount)
    Multiplies a subset of rows from a coding matrix by a full set of input shards to produce some output shards.
  • Field Details

    • ALL_CODING_LOOPS

      static final CodingLoop[] ALL_CODING_LOOPS
      All of the available coding loop algorithms. The different choices nest the three loops in different orders, and either use the log/exponents tables, or use the multiplication table. The naming of the three loops is (with number of loops in benchmark): "byte" - Index of byte within shard. (200,000 bytes in each shard) "input" - Which input shard is being read. (17 data shards) "output" - Which output shard is being computed. (3 parity shards) And the naming for multiplication method is: "table" - Use the multiplication table. "exp" - Use the logarithm/exponent table. The ReedSolomonBenchmark class compares the performance of the different loops, which will depend on the specific processor you're running on. This is the inner loop. It needs to be fast. Be careful if you change it. I have tried inlining Galois.multiply(), but it doesn't make things any faster. The JIT compiler is known to inline methods, so it's probably already doing so.
  • Method Details

    • codeSomeShards

      void codeSomeShards(byte[][] matrixRows, byte[][] inputs, int inputCount, byte[][] outputs, int outputCount, int offset, int byteCount)
      Multiplies a subset of rows from a coding matrix by a full set of input shards to produce some output shards.
      Parameters:
      matrixRows - The rows from the matrix to use.
      inputs - An array of byte arrays, each of which is one input shard. The inputs array may have extra buffers after the ones that are used. They will be ignored. The number of inputs used is determined by the length of the each matrix row.
      inputCount - The number of input byte arrays.
      outputs - Byte arrays where the computed shards are stored. The outputs array may also have extra, unused, elements at the end. The number of outputs computed, and the number of matrix rows used, is determined by outputCount.
      outputCount - The number of outputs to compute.
      offset - The index in the inputs and output of the first byte to process.
      byteCount - The number of bytes to process.
    • checkSomeShards

      boolean checkSomeShards(byte[][] matrixRows, byte[][] inputs, int inputCount, byte[][] toCheck, int checkCount, int offset, int byteCount, byte[] tempBuffer)
      Multiplies a subset of rows from a coding matrix by a full set of input shards to produce some output shards, and checks that the the data is those shards matches what's expected.
      Parameters:
      matrixRows - The rows from the matrix to use.
      inputs - An array of byte arrays, each of which is one input shard. The inputs array may have extra buffers after the ones that are used. They will be ignored. The number of inputs used is determined by the length of the each matrix row.
      inputCount - THe number of input byte arrays.
      toCheck - Byte arrays where the computed shards are stored. The outputs array may also have extra, unused, elements at the end. The number of outputs computed, and the number of matrix rows used, is determined by outputCount.
      checkCount - The number of outputs to compute.
      offset - The index in the inputs and output of the first byte to process.
      byteCount - The number of bytes to process.
      tempBuffer - A place to store temporary results. May be null.