MCPcopy Index your code
hub / github.com/numpy/numpy / test_mul

Function test_mul

numpy/polynomial/tests/test_classes.py:260–280  ·  view source on GitHub ↗
(Poly)

Source from the content-addressed store, hash-verified

258
259
260def 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
283def test_floordiv(Poly):

Callers

nothing calls this directly

Calls 5

assert_raisesFunction · 0.90
ChebyshevClass · 0.90
PolynomialClass · 0.90
PolyFunction · 0.85
assert_poly_almost_equalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…