(self)
| 120 | y = polyval(x, [1., 2., 3.]) |
| 121 | |
| 122 | def test_hermval(self): |
| 123 | #check empty input |
| 124 | assert_equal(herm.hermval([], [1]).size, 0) |
| 125 | |
| 126 | #check normal input) |
| 127 | x = np.linspace(-1, 1) |
| 128 | y = [polyval(x, c) for c in Hlist] |
| 129 | for i in range(10): |
| 130 | msg = f"At i={i}" |
| 131 | tgt = y[i] |
| 132 | res = herm.hermval(x, [0]*i + [1]) |
| 133 | assert_almost_equal(res, tgt, err_msg=msg) |
| 134 | |
| 135 | #check that shape is preserved |
| 136 | for i in range(3): |
| 137 | dims = [2]*i |
| 138 | x = np.zeros(dims) |
| 139 | assert_equal(herm.hermval(x, [1]).shape, dims) |
| 140 | assert_equal(herm.hermval(x, [1, 0]).shape, dims) |
| 141 | assert_equal(herm.hermval(x, [1, 0, 0]).shape, dims) |
| 142 | |
| 143 | def test_hermval2d(self): |
| 144 | x1, x2, x3 = self.x |
nothing calls this directly
no test coverage detected