Skip to content

Commit e075925

Browse files
authored
Merge pull request #51 from repagh/extend-tests-for-td04ad
td04ad: testcase for issue #6
2 parents 2d19788 + b30b0c2 commit e075925

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

slycot/tests/test_td04ad.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,22 @@ def test_toandfrom(self):
129129
n, At, Bt, Ct, Dt = transform.td04ad('R', 2, 2, idxc, den, num)
130130
np.testing.assert_array_almost_equal(D, Dt)
131131
np.testing.assert_array_almost_equal(A, At)
132+
133+
def test_tfm2ss_6(self):
134+
"""Python version of Fortran test program from
135+
-- Bug in TD04AD when ROWCOL='C' #6
136+
This bug was fixed in PR #27"""
137+
m = 1
138+
p = 1
139+
index = np.array([0])
140+
dcoeff = np.array([[0.5]])
141+
ucoeff = np.array([[[32]]])
142+
n, A, B, C, D = transform.td04ad('R', m, p, index, dcoeff, ucoeff)
143+
self.assertEqual(n, 0)
144+
np.testing.assert_array_almost_equal(D, np.array([[64]]))
145+
n, A, B, C, D = transform.td04ad('C', m, p, index, dcoeff, ucoeff)
146+
self.assertEqual(n, 0)
147+
np.testing.assert_array_almost_equal(D, np.array([[64]]))
132148

133149
def suite():
134150
return unittest.TestLoader().loadTestsFromTestCase(TestTF2SS)

0 commit comments

Comments
 (0)