Example #1
0
def t5():
    input_6 = [0.5, 0.25, 0.3, 0.45]
    m_6 = 14023
    n_6 = 4
    output_6 = chowreconstruct.approximate(input_6, m_6, n_6)
    print(output_6)
    assert(output_6[0] - 0.75 < 0.1)
    assert(output_6[1] - 0.25 < 0.1)
    assert(output_6[1] - 0.25 < 0.1)
    assert(output_6[1] - 0.25 < 0.1)
Example #2
0
def t6():
    input_7 = [0.75, 0.25, 0.25, 0.25]
    epsilon_7 = 0.1
    delta_7 = 0.1
    m_7 = 14023
    n_7 = 4
    output_7 = chowreconstruct.cr1(input_7, epsilon_7, delta_7)
    print(output_7)
    output_8 = chowreconstruct.approximate(output_7, m_7, n_7)
    assert(output_8[0] - input_7[0] < 0.1)
    assert(output_8[1] - input_7[1] < 0.1)
    assert(output_8[2] - input_7[2] < 0.1)
    assert(output_8[3] - input_7[3] < 0.1)