示例#1
0
    def test_norm(self):
        shape = (3, 3)
        t = np.arange(9).reshape(shape)
        z = Bicomplex(t, 2 * t)
        assert_array_equal(z.norm(), np.sqrt(5 * t ** 2))

        z = Bicomplex(1, 2)
        assert z.norm() == np.sqrt(5)
示例#2
0
    def test_norm(self):
        shape = (3, 3)
        t = np.arange(9).reshape(shape)
        z = Bicomplex(t, 2 * t)
        np.testing.assert_array_equal(z.norm(), np.sqrt(5*t**2))

        z = Bicomplex(1, 2)
        self.assertEqual(z.norm(), np.sqrt(5))