コード例 #1
0
 def test_EqualIntegerBoundVectors_ReturnTrue(self):
     bound_vector_1 = BoundVector(
         initial_point=array([0, 0, 0]),
         terminal_point=array([1, 1, 1]),
         initial_point_included=True,
         terminal_point_included=True)
     bound_vector_2 = BoundVector(
         initial_point=array([0, 0, 0]),
         terminal_point=array([1, 1, 1]),
         initial_point_included=True,
         terminal_point_included=True)
     assert bound_vector_1 == bound_vector_2
コード例 #2
0
 def test_NonequalFloatBoundVectors_ReturnTrue(self):
     bound_vector_1 = BoundVector(
         initial_point=array([0.3, 0.3, 0.3]),
         terminal_point=array([1.3, 1.3, 1.3]),
         initial_point_included=True,
         terminal_point_included=True)
     bound_vector_2 = BoundVector(
         initial_point=array([0.3, 0.3, 0.3]),
         terminal_point=array([1.3, 1.3, 2.3]),
         initial_point_included=True,
         terminal_point_included=True)
     assert not bound_vector_1 == bound_vector_2
コード例 #3
0
 def test_CompareAgainstItsRepr_ReturnTrue_1(self):
     bound_vector = BoundVector(
         initial_point=array([0, 0, 0]),
         terminal_point=array([1, 1, 1]),
         initial_point_included=True,
         terminal_point_included=True)
     assert eval(repr(bound_vector)) == bound_vector
コード例 #4
0
 def test_BoundVector_ReturnCorrectFreeVector_1(self):
     bound_vector = BoundVector(
         initial_point=array([-1, 1.5, 1]),
         terminal_point=array([1, 1, 1]))
     assert_allclose(bound_vector.free_vector, array([2, -0.5, 0]))
コード例 #5
0
 def test_IntegerBoundVector_ReturnCorrectFreeVector_0(self):
     bound_vector = BoundVector(
         initial_point=array([0, 0, 0]),
         terminal_point=array([1, 1, 1]))
     assert_allclose(bound_vector.free_vector, array([1, 1, 1]))