unittest
python
test_user_struct.py
Go to the documentation of this file.
1
import
numpy
as
np
2
from
user_struct
import
MyStruct
3
4
x = np.ones(3)
5
y = np.ones(4)
6
ms = MyStruct(x, y)
7
print
(ms.x)
8
print
(ms.y)
9
10
ms.x[0] = 0.0
11
12
ms.x = x
# ok
13
assert
np.allclose(ms.x, x)
14
15
ms.y[:] = y
16
ms.y = y
# segfault
print
void print(const Eigen::SparseMatrix< Scalar, Options > &mat)
Definition:
sparse_matrix.cpp:50
eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Sat Nov 2 2024 02:14:45