Пример #1
0
 def test_array_algebra(self):
     a = self._check_algebra(
         VectorizedAlgebra(
             self._check_array,
             scalar_to_float=lambda x: x.value()))
     self.assertEqual(type(a), np.ndarray)
     self.assertEqual(a.shape, (2,))
Пример #2
0
 def test_array_algebra(self):
     xv, e_xv = self._check_algebra(
         VectorizedAlgebra(self._check_array,
                           scalar_to_float=lambda x: x.Evaluate()))
     self.assertEqual(xv.shape, (2, ))
     self.assertIsInstance(xv[0], sym.Variable)
     self.assertEqual(e_xv.shape, (2, ))
     self.assertIsInstance(e_xv[0], sym.Expression)
Пример #3
0
 def test_array_algebra(self):
     a = self._check_algebra(VectorizedAlgebra())
     self.assertEqual(type(a), np.ndarray)
     self.assertEqual(a.shape, (2,))
Пример #4
0
 def test_array_algebra(self):
     xv, e_xv = self._check_algebra(VectorizedAlgebra())
     self.assertEqual(xv.shape, (2, ))
     self.assertIsInstance(xv[0], sym.Variable)
     self.assertEqual(e_xv.shape, (2, ))
     self.assertIsInstance(e_xv[0], sym.Expression)