6 from std_vector
import printVectorOfMatrix, printVectorOf3x3, copyStdVector
10 l1 = [np.random.randn(3), np.random.randn(2)]
11 l2 = eigenpy.StdVec_VectorXd(l1)
12 l3 = [np.random.randn(2, 2), np.random.randn(3, 1)]
13 l3.append(np.asfortranarray(np.eye(2)))
15 l4 = [np.random.randn(3, 3).T
for _
in range(3)]
20 assert len(li1) == len(li2)
23 assert np.array_equal(li1[i], li2[i])
30 assert np.allclose(l2[0][:2], 0.0)
40 l4_copy = copyStdVector(l4)
41 assert isinstance(l4_copy, eigenpy.StdVec_MatrixXd)
43 assert "StdVec_Mat3d" in printVectorOf3x3.__doc__
46 l4_copy2 = std_vector.copyStdVec_3x3(l4)
47 assert isinstance(l4_copy2, std_vector.StdVec_Mat3d)
52 assert np.allclose(x, 0.0),
"x = {}".format(x)
55 print(
"Check setZero() works:")
56 std_vector.setZero(l1)
60 print(
"-----------------")
64 std_vector.setZero(l2_py)
67 print(
"-----------------")
69 l3_copy = copyStdVector(l3)
71 std_vector.setZero(l3_copy)
72 pprint.pprint(list(l3_copy))
74 print(
"-----------------")
def checkAllValues(li1, li2)
void printVectorOfMatrix(const std::vector< MatType, Eigen::aligned_allocator< MatType > > &Ms)
void print(const Tensor &tensor)