test_user_type.py
Go to the documentation of this file.
1 import user_type
2 
3 rows = 10
4 cols = 20
5 
6 def test(mat):
7  mat.fill(mat.dtype.type(10.))
8  mat_copy = mat.copy()
9  assert (mat == mat_copy).all()
10  assert not (mat != mat_copy).all()
11 
12  mat_op = mat + mat
13  mat_op = mat.copy(order='F') + mat.copy(order='C')
14 
15  mat_op = mat - mat
16  mat_op = mat * mat
17  mat_op = mat.dot(mat.T)
18  mat_op = mat / mat
19 
20  mat_op = -mat;
21 
22  assert (mat >= mat).all()
23  assert (mat <= mat).all()
24  assert not (mat > mat).all()
25  assert not (mat < mat).all()
26 
27 mat = user_type.create_double(rows,cols)
28 test(mat)
29 
30 mat = user_type.create_float(rows,cols)
31 test(mat)


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Sat Apr 17 2021 02:37:59