def test_from_stdvector_double(self): tmp = gpstk.vector_double(5) tmp[0] = 1.23 tmp[1] = 2.34 tmp[2] = 3.45 tmp[3] = 4.56 tmp[4] = 5.67 v = gpstk.vector(tmp) self.assertAlmostEqual(1.23, v[0]) self.assertAlmostEqual(2.34, v[1]) self.assertAlmostEqual(3.45, v[2]) self.assertAlmostEqual(4.56, v[3]) self.assertAlmostEqual(5.67, v[4])
def test_vector(self): v = gpstk.vector_int() v.push_back(5) v.push_back(3) v.push_back(10) self.assertEqual(5, v[0]) self.assertEqual(3, v[1]) self.assertEqual(10, v[2]) v = gpstk.vector_double() v.push_back(1.5) v.push_back(2.5) self.assertEqual(1.5, v[0]) self.assertEqual(2.5, v[1]) self.assertEqual(2, len(v))