test__curve_helpers.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:bezier 作者: dhermes 项目源码 文件源码
def test_quartic(self):
        expected_l = np.asfortranarray([
            [1.0, 0.0, 0.0, 0.0, 0.0],
            [1.0, 1.0, 0.0, 0.0, 0.0],
            [1.0, 2.0, 1.0, 0.0, 0.0],
            [1.0, 3.0, 3.0, 1.0, 0.0],
            [1.0, 4.0, 6.0, 4.0, 1.0],
        ])
        expected_r = np.asfortranarray([
            [1.0, 4.0, 6.0, 4.0, 1.0],
            [0.0, 1.0, 3.0, 3.0, 1.0],
            [0.0, 0.0, 1.0, 2.0, 1.0],
            [0.0, 0.0, 0.0, 1.0, 1.0],
            [0.0, 0.0, 0.0, 0.0, 1.0],
        ])

        row_scaling = np.asfortranarray([[1.0], [2.0], [4.0], [8.0], [16.0]])
        expected_l /= row_scaling
        expected_r /= row_scaling[::-1, :]

        self._helper(4, expected_l, expected_r)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号