def test_2_efm_intersection(self):
     V = np.array([[1, 1, 1],
                   [1, 0, 0],
                   [-1, -5, -3],
                   [0, 10, 0]])
     i2r_id = {0: 'r1', 1: 'r2', 2: 'r3', 3: 'r4'}
     r_id2direction = get_2_efm_intersection(get_support(V), 0, 1, i2r_id)
     self.assertDictEqual({'r1': 1, 'r3': -1}, r_id2direction,
                          'Intersection was supposed to be r1, -r3 reactions, got %s' % str(r_id2direction))
 def test_efm_intersection_size(self):
     V = np.array([[1, 1, 1],
                   [1, 0, 0],
                   [-1, -5, -3],
                   [0, 10, 0]])
     i2r_id = {0: 'r1', 1: 'r2', 2: 'r3', 3: 'r4'}
     r_id2direction = get_efm_intersection(get_support(V), i2r_id)
     size = len(r_id2direction)
     self.assertEqual(2, size, 'Intersection was supposed to have 2 reactions, got %d' % size)
Beispiel #3
0
 def get_support_V(self):
     if self.support is not None:
         return self.support
     return get_support(self.V)