Skip to content

Commit 0277e72

Browse files
committed
Regression test for gh-199: ab13md should not change its args
1 parent 294eae0 commit 0277e72

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

slycot/tests/test_ab13bd.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import numpy as np
2+
from numpy.testing import assert_array_equal
3+
4+
import pytest
5+
6+
from slycot import ab13bd
7+
8+
def test_no_change_args():
9+
# ab13md must not change its arguments
10+
# regression; see gh-199
11+
a = np.array([[0.0, 1.0],[-0.5, -0.1]])
12+
b = np.array([[0.],[1.]])
13+
c = np.eye(2)
14+
d = np.zeros((2,1))
15+
16+
acopy = a.copy()
17+
bcopy = b.copy()
18+
ccopy = c.copy()
19+
dcopy = d.copy()
20+
21+
dico = 'C'
22+
jobn = 'H'
23+
24+
n, m = b.shape
25+
p = c.shape[0]
26+
27+
ab13bd(dico, jobn, n, m, p, a, b, c, d)
28+
assert_array_equal(a, acopy)
29+
assert_array_equal(b, bcopy)
30+
assert_array_equal(c, ccopy)
31+
assert_array_equal(d, dcopy)

0 commit comments

Comments
 (0)