<?xml version="1.0"?>
<!--
###################################################
# FEC LDPC BIT FLIP DECODER
###################################################
 -->
<block>
    <name>LDPC Bit Flip Decoder Definition</name>
    <key>variable_ldpc_bit_flip_decoder_def</key>
    <import>from gnuradio import fec</import>
    <var_make>
#if int($ndim())==0 #
self.$(id) = $(id) = fec.ldpc_bit_flip_decoder.make(${matrix_object}.get_base_sptr(), $max_iterations)
#else if int($ndim())==1 #
self.$(id) = $(id) = map((lambda a: fec.ldpc_bit_flip_decoder.make(${matrix_object}.get_base_sptr(), $max_iterations)), range(0,$dim1)) #slurp
#else
self.$(id) = $(id) = map((lambda b: map((lambda a: fec.ldpc_bit_flip_decoder.make(${matrix_object}.get_base_sptr(), $max_iterations)), range(0,$dim2))), range(0,$dim1)) #slurp
#end if</var_make>
    <make></make>

    <param>
        <name>Ignore Me</name>
        <key>value</key>
        <value>"ok"</value>
        <type>raw</type>
        <hide>all</hide>
    </param>

    <param>
        <name>Parallelism</name>
        <key>ndim</key>
        <value></value>
        <type>enum</type>
        <option>
            <name>0</name>
            <key>0</key>
        </option>
        <option>
            <name>1</name>
            <key>1</key>
        </option>
        <option>
            <name>2</name>
            <key>2</key>
        </option>
    </param>

    <param>
        <name>Dimension 1</name>
        <key>dim1</key>
        <value>1</value>
        <type>int</type>
        <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide>
    </param>

    <param>
        <name>Dimension 2</name>
        <key>dim2</key>
        <value>1</value>
        <type>int</type>
        <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide>
    </param>

    <param>
        <name>Max Iterations</name>
        <key>max_iterations</key>
        <value>100</value>
        <type>int</type>
    </param>

      <param>
        <name>LDPC FEC Matrix ID</name>
        <key>matrix_object</key>
        <type>raw</type>
    </param>

    <doc>
This block creates a LDPC Bit Flip Decoder Definition variable.

The decoder requires knowledge of the matrix used to create (encode) the codewords. In the LDPC FEC Matrix ID field, input the ID of either a:
  1) LDPC Generator Matrix variable, or
  2) LDPC Parity Check Matrix variable

Max iterations may be increased from 100 for possibly better performance, but significantly higher number of iterations may slow things down.
    </doc>
</block>
