def test_mxnulloutput(self): a = SX(5,0) b = SX.sym("x",2) bm = MX.sym("x",2) f = Function("f", [b],[a]) c = f(bm) self.assertEqual(c.size1(),5) self.assertEqual(c.size2(),0) c = f(b) self.assertEqual(c.size1(),5) self.assertEqual(c.size2(),0) a = SX(0,0) f = Function("f", [b],[a]) c = f(bm) self.assertEqual(c.size1(),0) self.assertEqual(c.size2(),0) c = f(b) self.assertEqual(c.size1(),0) self.assertEqual(c.size2(),0)
def test_mxnulloutput(self): a = SX.sparse(5,0) b = SX.sym("x",2) bm = MX.sym("x",2) f = SXFunction([b],[a]) f.init() c = f.call([bm])[0] self.assertEqual(c.size1(),5) self.assertEqual(c.size2(),0) c = f.call([b])[0] self.assertEqual(c.size1(),5) self.assertEqual(c.size2(),0) a = SX.sparse(0,0) f = SXFunction([b],[a]) f.init() c = f.call([bm])[0] self.assertEqual(c.size1(),0) self.assertEqual(c.size2(),0) c = f.call([b])[0] self.assertEqual(c.size1(),0) self.assertEqual(c.size2(),0)