1
- import numpy
2
- cimport numpy as np
3
- np.import_array()
4
-
5
-
6
1
cdef extern from " nebm_geodesic_lib.h" :
7
2
8
3
double compute_distance_geodesic(double * A, double * B, int n_dofs_image,
@@ -24,13 +19,13 @@ cdef extern from "nebm_lib.h":
24
19
)
25
20
26
21
27
- def compute_spring_force (np.ndarray[ double , ndim = 1 , mode = " c " ] spring_force,
28
- np.ndarray[ double , ndim = 1 , mode = " c " ] y,
29
- np.ndarray[ double , ndim = 1 , mode = " c " ] tangents,
22
+ def compute_spring_force (double [: ] spring_force ,
23
+ double [: ] y ,
24
+ double [: ] tangents ,
30
25
k ,
31
26
n_images ,
32
27
n_dofs_image ,
33
- np.ndarray[ int , ndim = 1 , mode = " c " ] material,
28
+ int [: ] material ,
34
29
n_dofs_image_material
35
30
):
36
31
@@ -40,10 +35,10 @@ def compute_spring_force(np.ndarray[double, ndim=1, mode="c"] spring_force,
40
35
& material[0 ], n_dofs_image_material
41
36
)
42
37
43
- def geodesic_distance (np.ndarray[ double , ndim = 1 , mode = " c " ] A,
44
- np.ndarray[ double , ndim = 1 , mode = " c " ] B,
38
+ def geodesic_distance (double [: ] A ,
39
+ double [: ] B ,
45
40
n_dofs_image ,
46
- np.ndarray[ int , ndim = 1 , mode = " c " ] material,
41
+ int [: ] material ,
47
42
n_dofs_image_material
48
43
):
49
44
0 commit comments