@@ -25,20 +25,23 @@ def test_ispassive():
2525
2626 assert (not passivity .ispassive (sys ))
2727
28+
2829A_d = numpy .array ([[- 2 , 0 ], [0 , 0 ]])
2930A = numpy .array ([[- 3 , 0 ], [0 , - 2 ]])
3031B = numpy .array ([[0 ], [1 ]])
3132C = numpy .array ([[- 1 , 2 ]])
3233D = numpy .array ([[1.5 ]])
34+
35+
3336@cvxoptonly
3437@pytest .mark .parametrize (
35- "test_input,expected" ,
36- [((A ,B , C , D * 0.0 ), True ),
37- ((A_d ,B , C , D ), True ),
38- ((A * 1e12 ,B , C , D * 0 ), True ),
39- ((A ,B * 0 ,C * 0 ,D ), True ),
40- ((A * 0 ,B , C , D ), True ),
41- ((A * 0 ,B * 0 ,C * 0 ,D * 0 ), True )])
38+ "test_input,expected" ,
39+ [((A , B , C , D * 0.0 ), True ),
40+ ((A_d , B , C , D ), True ),
41+ ((A * 1e12 , B , C , D * 0 ), True ),
42+ ((A , B * 0 , C * 0 , D ), True ),
43+ ((A * 0 , B , C , D ), True ),
44+ ((A * 0 , B * 0 , C * 0 , D * 0 ), True )])
4245def test_ispassive_edge_cases (test_input , expected ):
4346
4447 # strictly proper
@@ -47,4 +50,4 @@ def test_ispassive_edge_cases(test_input, expected):
4750 C = test_input [2 ]
4851 D = test_input [3 ]
4952 sys = ss (A , B , C , D )
50- assert (passivity .ispassive (sys )== expected )
53+ assert (passivity .ispassive (sys ) == expected )
0 commit comments