# Python numpy.polynomial.polynomial.polymul() Examples

The following are code examples for showing how to use numpy.polynomial.polynomial.polymul(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 2
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 3
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 4
 Project: att   Author: Centre-Alt-Rendiment-Esportiu   File: test_polynomial.py    GNU General Public License v3.0 6 votes
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 5
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 6
 Project: MARRtino-2.0   Author: DaniAffCH   File: test_polynomial.py    GNU General Public License v3.0 6 votes
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 7
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 8
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 9
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 10
```def test_polydiv(self) :
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5) :
for j in range(5) :
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 11
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 12
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 13
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 14
 Project: 3dprinteros-client   Author: panasevychol   File: test_polynomial.py    GNU Affero General Public License v3.0 6 votes
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 15
 Project: 3dprinteros-client   Author: panasevychol   File: test_polynomial.py    GNU Affero General Public License v3.0 6 votes
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 16
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 17
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 18
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 19
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 20
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 21
 Project: facethin   Author: ParkerGod   File: test_polynomial.py    GNU General Public License v3.0 6 votes
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 22
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 23
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 24
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 25
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 26
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 27
 Project: linux-cross-gcc   Author: nmercier   File: test_polynomial.py    BSD 3-Clause "New" or "Revised" License 6 votes
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 28
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 29
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 30
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 31
 Project: honours_project   Author: JFriel   File: test_polynomial.py    GNU General Public License v3.0 6 votes
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 32
 Project: honours_project   Author: JFriel   File: test_polynomial.py    GNU General Public License v3.0 6 votes
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 33
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 34
 Project: PYPIC   Author: max614   File: test_polynomial.py    BSD 2-Clause "Simplified" License 6 votes
```def test_polydiv(self):
# check zero division
assert_raises(ZeroDivisionError, poly.polydiv, [1], [0])

# check scalar division
quo, rem = poly.polydiv([2], [2])
assert_equal((quo, rem), (1, 0))
quo, rem = poly.polydiv([2, 2], [2])
assert_equal((quo, rem), ((1, 1), 0))

# check rest.
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1, 2]
cj = [0]*j + [1, 2]
quo, rem = poly.polydiv(tgt, ci)
assert_equal(res, tgt, err_msg=msg) ```
Example 35
```def test_polymul(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
tgt = np.zeros(i + j + 1)
tgt[i + j] += 1
res = poly.polymul([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 36
```def test_polymul(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
tgt = np.zeros(i + j + 1)
tgt[i + j] += 1
res = poly.polymul([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 37
```def test_polypow(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
c = np.arange(i + 1)
tgt = reduce(poly.polymul, [c]*j, np.array([1]))
res = poly.polypow(c, j)
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 38
```def test_polymul(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
tgt = np.zeros(i + j + 1)
tgt[i + j] += 1
res = poly.polymul([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 39
```def test_polypow(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
c = np.arange(i + 1)
tgt = reduce(poly.polymul, [c]*j, np.array([1]))
res = poly.polypow(c, j)
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 40
 Project: att   Author: Centre-Alt-Rendiment-Esportiu   File: test_polynomial.py    GNU General Public License v3.0 5 votes
```def test_polymul(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
tgt = np.zeros(i + j + 1)
tgt[i + j] += 1
res = poly.polymul([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 41
```def test_polymul(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
tgt = np.zeros(i + j + 1)
tgt[i + j] += 1
res = poly.polymul([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 42
 Project: MARRtino-2.0   Author: DaniAffCH   File: test_polynomial.py    GNU General Public License v3.0 5 votes
```def test_polymul(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
tgt = np.zeros(i + j + 1)
tgt[i + j] += 1
res = poly.polymul([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 43
 Project: MARRtino-2.0   Author: DaniAffCH   File: test_polynomial.py    GNU General Public License v3.0 5 votes
```def test_polypow(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
c = np.arange(i + 1)
tgt = reduce(poly.polymul, [c]*j, np.array([1]))
res = poly.polypow(c, j)
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 44
```def test_polymul(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
tgt = np.zeros(i + j + 1)
tgt[i + j] += 1
res = poly.polymul([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 45
```def test_polymul(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
tgt = np.zeros(i + j + 1)
tgt[i + j] += 1
res = poly.polymul([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 46
```def test_polymul(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
tgt = np.zeros(i + j + 1)
tgt[i + j] += 1
res = poly.polymul([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 47
```def test_polypow(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
c = np.arange(i + 1)
tgt = reduce(poly.polymul, [c]*j, np.array([1]))
res = poly.polypow(c, j)
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 48
```def test_polymul(self) :
for i in range(5) :
for j in range(5) :
msg = "At i=%d, j=%d" % (i, j)
tgt = np.zeros(i + j + 1)
tgt[i + j] += 1
res = poly.polymul([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 49
```def test_polymul(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
tgt = np.zeros(i + j + 1)
tgt[i + j] += 1
res = poly.polymul([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg) ```
Example 50
```def test_polymul(self):