Пример #1
0
    def test_10e(self):
        # int32, complex double
        J = np.array([1, 1, 1], dtype=np.int32)
        x = np.array([1.0, 2.0, 3.0], dtype=np.complex128)

        assert g.test10(J, x) == 1
        assert J[0] == 0
        assert x[0].real == 7.5
Пример #2
0
    def test_10c(self):
        # int32, double
        J = np.array([1, 1, 1], dtype=np.int32)
        x = np.array([1.0, 2.0, 3.0], dtype=np.float64)

        assert g.test10(J, x) == 1
        assert J[0] == 0
        assert x[0] == 7.5
Пример #3
0
    def test_10d(self):
        # int32, complex float
        J = np.array([1, 1, 1], dtype=np.int32)
        x = np.array([1.0, 2.0, 3.0], dtype=np.complex64)

        assert g.test10(J, x) == 1
        assert J[0] == 0
        assert x[0].real == 7.5
Пример #4
0
    def test_10b(self):
        # bool, float32
        J = np.array([1, 1, 1], dtype=np.bool)
        x = np.array([1.0, 2.0, 3.0], dtype=np.float32)

        assert g.test10(J, x) == 1
        assert J[0] == 0
        assert x[0] == 7.5