def test_matrices_with_C_F_orders():
 P_C = np.array([[0.5, 0.5], [0, 1]], order='C')
 P_F = np.array([[0.5, 0.5], [0, 1]], order='F')
 stationary_dist = [0.0, 1.0]
 computed_C_and_F = gth_solve(np.array([[1]]))
 assert_array_equal(computed_C_and_F, [1])
 computed_C = gth_solve(P_C)
 computed_F = gth_solve(P_F)
 assert_array_equal(computed_C, stationary_dist)
 assert_array_equal(computed_F, stationary_dist)

def test_matrices_with_C_F_orders ( ) : P_C = np . array ( [ [ 0.5 , 0.5 ] , [ 0 , 1 ] ] , order = 'C' ) P_F = np . array ( [ [ 0.5 , 0.5 ] , [ 0 , 1 ] ] , order = 'F' ) stationary_dist = [ 0.0 , 1.0 ] computed_C_and_F = gth_solve ( np . array ( [ [ 1 ] ] ) ) assert_array_equal ( computed_C_and_F , [ 1 ] ) computed_C = gth_solve ( P_C ) computed_F = gth_solve ( P_F ) assert_array_equal ( computed_C , stationary_dist ) assert_array_equal ( computed_F , stationary_dist )
test matrices with c- and f-contiguous orders see the issue and fix on numba: github .