def test_compute_B_star():
    '''
    Tests for expected output

    Taken from example 3.2 in Saltelli et al. (2008) pg 122
    '''

    k = 3
    g = 2

    x_star = np.matrix(np.array([1. / 3, 1. / 3, 0.]))
    J = np.matrix(np.ones((g + 1, k)))
    G = np.matrix('1,0;0,1;0,1')
    D_star = np.matrix('1,0,0;0,-1,0;0,0,1')
    P_star = np.matrix('1,0;0,1')
    delta = 2. / 3
    B = np.matrix(np.tril(np.ones([g + 1, g], dtype=int), -1))

    desired = np.array([[3 / 1., 1, 0], [1, 1, 0], [1, 1. / 3, 2. / 3]])

    output = compute_B_star(J, x_star, delta, B, G, P_star, D_star)
    assert_array_equal(output, desired)
dataset/ETHPy150Open SALib/SALib/SALib/tests/test_morris_util.py/test_compute_B_star/swapped operands of `/`