(Poly)
| 258 | |
| 259 | |
| 260 | def test_mul(Poly): |
| 261 | c1 = list(random((4,)) + .5) |
| 262 | c2 = list(random((3,)) + .5) |
| 263 | p1 = Poly(c1) |
| 264 | p2 = Poly(c2) |
| 265 | p3 = p1 * p2 |
| 266 | assert_poly_almost_equal(p2 * p1, p3) |
| 267 | assert_poly_almost_equal(p1 * c2, p3) |
| 268 | assert_poly_almost_equal(c2 * p1, p3) |
| 269 | assert_poly_almost_equal(p1 * tuple(c2), p3) |
| 270 | assert_poly_almost_equal(tuple(c2) * p1, p3) |
| 271 | assert_poly_almost_equal(p1 * np.array(c2), p3) |
| 272 | assert_poly_almost_equal(np.array(c2) * p1, p3) |
| 273 | assert_poly_almost_equal(p1 * 2, p1 * Poly([2])) |
| 274 | assert_poly_almost_equal(2 * p1, p1 * Poly([2])) |
| 275 | assert_raises(TypeError, op.mul, p1, Poly([0], domain=Poly.domain + 1)) |
| 276 | assert_raises(TypeError, op.mul, p1, Poly([0], window=Poly.window + 1)) |
| 277 | if Poly is Polynomial: |
| 278 | assert_raises(TypeError, op.mul, p1, Chebyshev([0])) |
| 279 | else: |
| 280 | assert_raises(TypeError, op.mul, p1, Polynomial([0])) |
| 281 | |
| 282 | |
| 283 | def test_floordiv(Poly): |
nothing calls this directly
no test coverage detected
searching dependent graphs…