def test_workspace_resize(self):
nodes1 = np.asfortranarray([
[-3.0, 0.0],
[5.0, 0.0],
])
nodes2 = np.asfortranarray([
[-7.0, -9.0],
[9.0, 13.0],
[-7.0, -13.0],
[9.0, 9.0],
])
# NOTE: These curves intersect 3 times, so a workspace of
# 2 is not large enough.
self.reset_workspace(2)
intersections = self._call_function_under_test(nodes1, nodes2)
expected = np.asfortranarray([
[0.5, 0.5],
[0.375, 0.25],
[0.625, 0.75],
])
self.assertEqual(intersections, expected)
# Make sure the workspace was resized.
self.assertEqual(self.workspace_size(), 3)
评论列表
文章目录