示例#1
0
 def runTest(self):
     xbase = np.array([0.0, 0.0, 0.0])
     g = np.array([-1.0, -1.0, -1.0])
     a = np.array([-2.0, -2.0, -2.0])
     b = np.array([0.9, 0.1, 5.0])
     delta = sqrt(3.0)
     c = -1.0  # may want to max instead
     x = bbtrsbox_geometry(xbase, c, g, a, b, [], delta)
     xtrue = np.array([0.9, 0.1, sqrt(3.0 - 0.81 - 0.01)])
     self.assertTrue(np.max(np.abs(x - xtrue)) < 1e-10, 'Wrong step')
示例#2
0
 def runTest(self):
     xbase = np.array([0.0, 0.0])
     g = np.array([1e-15, -1.0])
     a = np.array([-2.0, -2.0])
     b = np.array([1.0, 2.0])
     delta = 5.0
     c = 0.0
     x = bbtrsbox_geometry(xbase, c, g, a, b, [], delta)
     xtrue = np.array([0.0, 2.0])
     self.assertTrue(np.max(np.abs(x - xtrue)) < 1e-10, 'Wrong step')
示例#3
0
 def runTest(self):
     xbase = np.array([0.0, 0.0]) + 1
     g = np.array([1.0, -1.0])
     a = np.array([-2.0, -2.0]) + 1
     b = np.array([1.0, 2.0]) + 1
     delta = 5.0
     c = 3.0  # may want to max instead
     x = bbtrsbox_geometry(xbase, c, g, a, b, [], delta)
     xtrue = np.array([1.0, -2.0]) + 1
     self.assertTrue(np.max(np.abs(x - xtrue)) < 1e-10, 'Wrong step')