예제 #1
0
파일: sx.py 프로젝트: kurtgeebelen/casadi
  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)
예제 #2
0
파일: sx.py 프로젝트: kbenne/JModelica
  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)
예제 #3
0
파일: sx.py 프로젝트: tmmsartor/casadi
  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)
예제 #4
0
  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)