Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
A = np.array([[0, 1, -1], [1, 0, 1], [-1, 1, 0]])
rows = [0, 1]
columns = [0, 1]
self.assertTrue(
np.array_equal(
solve_indifference(A, rows, columns), np.array([0.5, 0.5, 0.0])
)
)
rows = [1, 2]
columns = [0, 1]
self.assertTrue(
all(
np.isclose(
solve_indifference(A, rows, columns),
np.array([1 / 3, 2 / 3, 0.0]),
)
)
)
rows = [0, 2]
columns = [0, 1]
self.assertTrue(
np.array_equal(
solve_indifference(A, rows, columns), np.array([0.0, 1.0, 0.0])
)
)
rows = [0, 1, 2]
columns = [0, 1, 2]
self.assertTrue(
def test_solve_indifference(self):
"""Test solve indifference"""
A = np.array([[0, 1, -1], [1, 0, 1], [-1, 1, 0]])
rows = [0, 1]
columns = [0, 1]
self.assertTrue(
np.array_equal(
solve_indifference(A, rows, columns), np.array([0.5, 0.5, 0.0])
)
)
rows = [1, 2]
columns = [0, 1]
self.assertTrue(
all(
np.isclose(
solve_indifference(A, rows, columns),
np.array([1 / 3, 2 / 3, 0.0]),
)
)
)
rows = [0, 2]
columns = [0, 1]