multipers 2.0.0__cp310-cp310-macosx_13_0_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of multipers might be problematic. Click here for more details.
- multipers/.dylibs/libc++.1.0.dylib +0 -0
- multipers/.dylibs/libtbb.12.12.dylib +0 -0
- multipers/.dylibs/libtbbmalloc.2.12.dylib +0 -0
- multipers/__init__.py +11 -0
- multipers/_signed_measure_meta.py +268 -0
- multipers/_slicer_meta.py +171 -0
- multipers/data/MOL2.py +350 -0
- multipers/data/UCR.py +18 -0
- multipers/data/__init__.py +1 -0
- multipers/data/graphs.py +466 -0
- multipers/data/immuno_regions.py +27 -0
- multipers/data/minimal_presentation_to_st_bf.py +0 -0
- multipers/data/pytorch2simplextree.py +91 -0
- multipers/data/shape3d.py +101 -0
- multipers/data/synthetic.py +68 -0
- multipers/distances.py +198 -0
- multipers/euler_characteristic.pyx +132 -0
- multipers/filtration_conversions.pxd +229 -0
- multipers/filtrations.pxd +225 -0
- multipers/function_rips.cpython-310-darwin.so +0 -0
- multipers/function_rips.pyx +105 -0
- multipers/grids.cpython-310-darwin.so +0 -0
- multipers/grids.pyx +281 -0
- multipers/hilbert_function.pyi +46 -0
- multipers/hilbert_function.pyx +153 -0
- multipers/io.cpython-310-darwin.so +0 -0
- multipers/io.pyx +571 -0
- multipers/ml/__init__.py +0 -0
- multipers/ml/accuracies.py +90 -0
- multipers/ml/convolutions.py +532 -0
- multipers/ml/invariants_with_persistable.py +79 -0
- multipers/ml/kernels.py +176 -0
- multipers/ml/mma.py +659 -0
- multipers/ml/one.py +472 -0
- multipers/ml/point_clouds.py +238 -0
- multipers/ml/signed_betti.py +50 -0
- multipers/ml/signed_measures.py +1542 -0
- multipers/ml/sliced_wasserstein.py +461 -0
- multipers/ml/tools.py +113 -0
- multipers/mma_structures.cpython-310-darwin.so +0 -0
- multipers/mma_structures.pxd +127 -0
- multipers/mma_structures.pyx +2433 -0
- multipers/multiparameter_edge_collapse.py +41 -0
- multipers/multiparameter_module_approximation.cpython-310-darwin.so +0 -0
- multipers/multiparameter_module_approximation.pyx +211 -0
- multipers/pickle.py +53 -0
- multipers/plots.py +326 -0
- multipers/point_measure_integration.cpython-310-darwin.so +0 -0
- multipers/point_measure_integration.pyx +139 -0
- multipers/rank_invariant.cpython-310-darwin.so +0 -0
- multipers/rank_invariant.pyx +229 -0
- multipers/simplex_tree_multi.cpython-310-darwin.so +0 -0
- multipers/simplex_tree_multi.pxd +129 -0
- multipers/simplex_tree_multi.pyi +715 -0
- multipers/simplex_tree_multi.pyx +4655 -0
- multipers/slicer.cpython-310-darwin.so +0 -0
- multipers/slicer.pxd +781 -0
- multipers/slicer.pyx +3393 -0
- multipers/tensor.pxd +13 -0
- multipers/test.pyx +44 -0
- multipers/tests/__init__.py +40 -0
- multipers/tests/old_test_rank_invariant.py +91 -0
- multipers/tests/test_diff_helper.py +74 -0
- multipers/tests/test_hilbert_function.py +82 -0
- multipers/tests/test_mma.py +51 -0
- multipers/tests/test_point_clouds.py +59 -0
- multipers/tests/test_python-cpp_conversion.py +82 -0
- multipers/tests/test_signed_betti.py +181 -0
- multipers/tests/test_simplextreemulti.py +98 -0
- multipers/tests/test_slicer.py +63 -0
- multipers/torch/__init__.py +1 -0
- multipers/torch/diff_grids.py +217 -0
- multipers/torch/rips_density.py +257 -0
- multipers-2.0.0.dist-info/LICENSE +21 -0
- multipers-2.0.0.dist-info/METADATA +29 -0
- multipers-2.0.0.dist-info/RECORD +78 -0
- multipers-2.0.0.dist-info/WHEEL +5 -0
- multipers-2.0.0.dist-info/top_level.txt +1 -0
multipers/slicer.pxd
ADDED
|
@@ -0,0 +1,781 @@
|
|
|
1
|
+
# WARNING: Do not edit this file directly.
|
|
2
|
+
# It is automatically generated from 'multipers/slicer.pxd.tp'.
|
|
3
|
+
# Changes must be made there.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
cimport numpy as cnp
|
|
7
|
+
|
|
8
|
+
# SequentialDataset and its two concrete subclasses are (optionally randomized)
|
|
9
|
+
# iterators over the rows of a matrix X and corresponding target values y.
|
|
10
|
+
|
|
11
|
+
from libcpp.utility cimport pair
|
|
12
|
+
from libcpp cimport bool, int, float
|
|
13
|
+
from libcpp.vector cimport vector
|
|
14
|
+
from libcpp cimport tuple
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
from libc.stdint cimport intptr_t, uint16_t, uint32_t, int32_t, uint64_t, int64_t
|
|
18
|
+
from cython cimport uint
|
|
19
|
+
|
|
20
|
+
import numpy as np
|
|
21
|
+
python_value_type=np.float32
|
|
22
|
+
|
|
23
|
+
from libcpp.string cimport string
|
|
24
|
+
|
|
25
|
+
cdef extern from "Simplex_tree_multi_interface.h" namespace "Gudhi::multiparameter::python_interface":
|
|
26
|
+
cdef cppclass Simplex_tree_multi_interface[F=*, value_type=*]:
|
|
27
|
+
pass
|
|
28
|
+
|
|
29
|
+
from multipers.filtrations cimport *
|
|
30
|
+
ctypedef vector[uint] cycle_type ## its the cycle type of matrix
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#------------------------------------------------------------------------------
|
|
34
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
35
|
+
cdef cppclass GeneralVineClementTruc "GeneralVineClementTruc<>":
|
|
36
|
+
ctypedef float value_type
|
|
37
|
+
|
|
38
|
+
GeneralVineClementTruc()
|
|
39
|
+
|
|
40
|
+
GeneralVineClementTruc(const vector[vector[unsigned int]]&, const vector[int]&, const vector[Finitely_critical_multi_filtration[float]]&)
|
|
41
|
+
|
|
42
|
+
GeneralVineClementTruc& operator=(const GeneralVineClementTruc&)
|
|
43
|
+
vector[vector[pair[float, float]]] get_barcode() nogil
|
|
44
|
+
void push_to(const Line[float]&) nogil
|
|
45
|
+
void set_one_filtration(const vector[float]&) nogil
|
|
46
|
+
|
|
47
|
+
vector[float] get_one_filtration()
|
|
48
|
+
void compute_persistence() nogil
|
|
49
|
+
uint32_t num_generators() nogil
|
|
50
|
+
uint32_t num_parameters() nogil
|
|
51
|
+
string to_str() nogil
|
|
52
|
+
pair[Finitely_critical_multi_filtration[float], Finitely_critical_multi_filtration[float]] get_bounding_box() except + nogil
|
|
53
|
+
vector[Finitely_critical_multi_filtration[float]] get_filtration_values() nogil
|
|
54
|
+
vector[int] get_dimensions() nogil
|
|
55
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
56
|
+
void coarsen_on_grid_inplace(vector[vector[float]], bool) nogil
|
|
57
|
+
vector[Finitely_critical_multi_filtration[float]]& get_filtrations() nogil
|
|
58
|
+
void vineyard_update() nogil
|
|
59
|
+
vector[cycle_type] get_representative_cycles(bool) nogil
|
|
60
|
+
vector[size_t] get_current_order() nogil
|
|
61
|
+
|
|
62
|
+
#------------------------------------------------------------------------------
|
|
63
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
64
|
+
cdef cppclass SimplicialVineGraphTruc "SimplicialVineGraphTruc":
|
|
65
|
+
ctypedef float value_type
|
|
66
|
+
|
|
67
|
+
SimplicialVineGraphTruc()
|
|
68
|
+
|
|
69
|
+
SimplicialVineGraphTruc(Simplex_tree_multi_interface[Finitely_critical_multi_filtration[float], float]*)
|
|
70
|
+
|
|
71
|
+
SimplicialVineGraphTruc& operator=(const SimplicialVineGraphTruc&)
|
|
72
|
+
vector[vector[pair[float, float]]] get_barcode() nogil
|
|
73
|
+
void push_to(const Line[float]&) nogil
|
|
74
|
+
void set_one_filtration(const vector[float]&) nogil
|
|
75
|
+
|
|
76
|
+
vector[float] get_one_filtration()
|
|
77
|
+
void compute_persistence() nogil
|
|
78
|
+
uint32_t num_generators() nogil
|
|
79
|
+
uint32_t num_parameters() nogil
|
|
80
|
+
string to_str() nogil
|
|
81
|
+
pair[Finitely_critical_multi_filtration[float], Finitely_critical_multi_filtration[float]] get_bounding_box() except + nogil
|
|
82
|
+
vector[Finitely_critical_multi_filtration[float]] get_filtration_values() nogil
|
|
83
|
+
vector[int] get_dimensions() nogil
|
|
84
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
85
|
+
void coarsen_on_grid_inplace(vector[vector[float]], bool) nogil
|
|
86
|
+
vector[Finitely_critical_multi_filtration[float]]& get_filtrations() nogil
|
|
87
|
+
void vineyard_update() nogil
|
|
88
|
+
vector[cycle_type] get_representative_cycles(bool) nogil
|
|
89
|
+
vector[size_t] get_current_order() nogil
|
|
90
|
+
|
|
91
|
+
#------------------------------------------------------------------------------
|
|
92
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
93
|
+
cdef cppclass SimplicialVineMatrixTruc "SimplicialVineMatrixTruc<>":
|
|
94
|
+
ctypedef float value_type
|
|
95
|
+
|
|
96
|
+
SimplicialVineMatrixTruc()
|
|
97
|
+
|
|
98
|
+
SimplicialVineMatrixTruc(Simplex_tree_multi_interface[Finitely_critical_multi_filtration[float], float]*)
|
|
99
|
+
|
|
100
|
+
SimplicialVineMatrixTruc& operator=(const SimplicialVineMatrixTruc&)
|
|
101
|
+
vector[vector[pair[float, float]]] get_barcode() nogil
|
|
102
|
+
void push_to(const Line[float]&) nogil
|
|
103
|
+
void set_one_filtration(const vector[float]&) nogil
|
|
104
|
+
|
|
105
|
+
vector[float] get_one_filtration()
|
|
106
|
+
void compute_persistence() nogil
|
|
107
|
+
uint32_t num_generators() nogil
|
|
108
|
+
uint32_t num_parameters() nogil
|
|
109
|
+
string to_str() nogil
|
|
110
|
+
pair[Finitely_critical_multi_filtration[float], Finitely_critical_multi_filtration[float]] get_bounding_box() except + nogil
|
|
111
|
+
vector[Finitely_critical_multi_filtration[float]] get_filtration_values() nogil
|
|
112
|
+
vector[int] get_dimensions() nogil
|
|
113
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
114
|
+
void coarsen_on_grid_inplace(vector[vector[float]], bool) nogil
|
|
115
|
+
vector[Finitely_critical_multi_filtration[float]]& get_filtrations() nogil
|
|
116
|
+
void vineyard_update() nogil
|
|
117
|
+
vector[cycle_type] get_representative_cycles(bool) nogil
|
|
118
|
+
vector[size_t] get_current_order() nogil
|
|
119
|
+
|
|
120
|
+
#------------------------------------------------------------------------------
|
|
121
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
122
|
+
cdef cppclass SimplicialNoVineMatrixTruc "SimplicialNoVineMatrixTruc<>":
|
|
123
|
+
ctypedef float value_type
|
|
124
|
+
|
|
125
|
+
SimplicialNoVineMatrixTruc()
|
|
126
|
+
|
|
127
|
+
SimplicialNoVineMatrixTruc(Simplex_tree_multi_interface[Finitely_critical_multi_filtration[float], float]*)
|
|
128
|
+
|
|
129
|
+
SimplicialNoVineMatrixTruc& operator=(const SimplicialNoVineMatrixTruc&)
|
|
130
|
+
vector[vector[pair[float, float]]] get_barcode() nogil
|
|
131
|
+
void push_to(const Line[float]&) nogil
|
|
132
|
+
void set_one_filtration(const vector[float]&) nogil
|
|
133
|
+
|
|
134
|
+
vector[float] get_one_filtration()
|
|
135
|
+
void compute_persistence() nogil
|
|
136
|
+
uint32_t num_generators() nogil
|
|
137
|
+
uint32_t num_parameters() nogil
|
|
138
|
+
string to_str() nogil
|
|
139
|
+
pair[Finitely_critical_multi_filtration[float], Finitely_critical_multi_filtration[float]] get_bounding_box() except + nogil
|
|
140
|
+
vector[Finitely_critical_multi_filtration[float]] get_filtration_values() nogil
|
|
141
|
+
vector[int] get_dimensions() nogil
|
|
142
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
143
|
+
void coarsen_on_grid_inplace(vector[vector[float]], bool) nogil
|
|
144
|
+
vector[Finitely_critical_multi_filtration[float]]& get_filtrations() nogil
|
|
145
|
+
|
|
146
|
+
#------------------------------------------------------------------------------
|
|
147
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
148
|
+
cdef cppclass C_KSlicer0_vine_i32 "MatrixTrucPythonInterface<true,true,int32_t,Available_columns::INTRUSIVE_SET>":
|
|
149
|
+
ctypedef int32_t value_type
|
|
150
|
+
|
|
151
|
+
C_KSlicer0_vine_i32()
|
|
152
|
+
|
|
153
|
+
C_KSlicer0_vine_i32(const vector[vector[unsigned int]]&, const vector[int]&, const vector[KCriticalFiltration[int32_t]]&)
|
|
154
|
+
|
|
155
|
+
C_KSlicer0_vine_i32& operator=(const C_KSlicer0_vine_i32&)
|
|
156
|
+
vector[vector[pair[int32_t, int32_t]]] get_barcode() nogil
|
|
157
|
+
void push_to(const Line[int32_t]&) nogil
|
|
158
|
+
void set_one_filtration(const vector[int32_t]&) nogil
|
|
159
|
+
|
|
160
|
+
vector[int32_t] get_one_filtration()
|
|
161
|
+
void compute_persistence() nogil
|
|
162
|
+
uint32_t num_generators() nogil
|
|
163
|
+
uint32_t num_parameters() nogil
|
|
164
|
+
string to_str() nogil
|
|
165
|
+
pair[Finitely_critical_multi_filtration[int32_t], Finitely_critical_multi_filtration[int32_t]] get_bounding_box() except + nogil
|
|
166
|
+
vector[Finitely_critical_multi_filtration[int32_t]] get_filtration_values() nogil
|
|
167
|
+
vector[int] get_dimensions() nogil
|
|
168
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
169
|
+
void coarsen_on_grid_inplace(vector[vector[int32_t]], bool) nogil
|
|
170
|
+
vector[KCriticalFiltration[int32_t]]& get_filtrations() nogil
|
|
171
|
+
C_KSlicer0_vine_i32 coarsen_on_grid(vector[vector[int32_t]]) nogil
|
|
172
|
+
void vineyard_update() nogil
|
|
173
|
+
vector[cycle_type] get_representative_cycles(bool) nogil
|
|
174
|
+
vector[size_t] get_current_order() nogil
|
|
175
|
+
void add_point(const Finitely_critical_multi_filtration[int32_t] &) nogil
|
|
176
|
+
|
|
177
|
+
#------------------------------------------------------------------------------
|
|
178
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
179
|
+
cdef cppclass C_KSlicer0_vine_f32 "MatrixTrucPythonInterface<true,true,float,Available_columns::INTRUSIVE_SET>":
|
|
180
|
+
ctypedef float value_type
|
|
181
|
+
|
|
182
|
+
C_KSlicer0_vine_f32()
|
|
183
|
+
|
|
184
|
+
C_KSlicer0_vine_f32(const vector[vector[unsigned int]]&, const vector[int]&, const vector[KCriticalFiltration[float]]&)
|
|
185
|
+
|
|
186
|
+
C_KSlicer0_vine_f32& operator=(const C_KSlicer0_vine_f32&)
|
|
187
|
+
vector[vector[pair[float, float]]] get_barcode() nogil
|
|
188
|
+
void push_to(const Line[float]&) nogil
|
|
189
|
+
void set_one_filtration(const vector[float]&) nogil
|
|
190
|
+
|
|
191
|
+
vector[float] get_one_filtration()
|
|
192
|
+
void compute_persistence() nogil
|
|
193
|
+
uint32_t num_generators() nogil
|
|
194
|
+
uint32_t num_parameters() nogil
|
|
195
|
+
string to_str() nogil
|
|
196
|
+
pair[Finitely_critical_multi_filtration[float], Finitely_critical_multi_filtration[float]] get_bounding_box() except + nogil
|
|
197
|
+
vector[Finitely_critical_multi_filtration[float]] get_filtration_values() nogil
|
|
198
|
+
vector[int] get_dimensions() nogil
|
|
199
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
200
|
+
void coarsen_on_grid_inplace(vector[vector[float]], bool) nogil
|
|
201
|
+
vector[KCriticalFiltration[float]]& get_filtrations() nogil
|
|
202
|
+
C_KSlicer0_vine_i32 coarsen_on_grid(vector[vector[float]]) nogil
|
|
203
|
+
void vineyard_update() nogil
|
|
204
|
+
vector[cycle_type] get_representative_cycles(bool) nogil
|
|
205
|
+
vector[size_t] get_current_order() nogil
|
|
206
|
+
void add_point(const Finitely_critical_multi_filtration[float] &) nogil
|
|
207
|
+
|
|
208
|
+
#------------------------------------------------------------------------------
|
|
209
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
210
|
+
cdef cppclass C_KSlicer0_vine_f64 "MatrixTrucPythonInterface<true,true,double,Available_columns::INTRUSIVE_SET>":
|
|
211
|
+
ctypedef double value_type
|
|
212
|
+
|
|
213
|
+
C_KSlicer0_vine_f64()
|
|
214
|
+
|
|
215
|
+
C_KSlicer0_vine_f64(const vector[vector[unsigned int]]&, const vector[int]&, const vector[KCriticalFiltration[double]]&)
|
|
216
|
+
|
|
217
|
+
C_KSlicer0_vine_f64& operator=(const C_KSlicer0_vine_f64&)
|
|
218
|
+
vector[vector[pair[double, double]]] get_barcode() nogil
|
|
219
|
+
void push_to(const Line[double]&) nogil
|
|
220
|
+
void set_one_filtration(const vector[double]&) nogil
|
|
221
|
+
|
|
222
|
+
vector[double] get_one_filtration()
|
|
223
|
+
void compute_persistence() nogil
|
|
224
|
+
uint32_t num_generators() nogil
|
|
225
|
+
uint32_t num_parameters() nogil
|
|
226
|
+
string to_str() nogil
|
|
227
|
+
pair[Finitely_critical_multi_filtration[double], Finitely_critical_multi_filtration[double]] get_bounding_box() except + nogil
|
|
228
|
+
vector[Finitely_critical_multi_filtration[double]] get_filtration_values() nogil
|
|
229
|
+
vector[int] get_dimensions() nogil
|
|
230
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
231
|
+
void coarsen_on_grid_inplace(vector[vector[double]], bool) nogil
|
|
232
|
+
vector[KCriticalFiltration[double]]& get_filtrations() nogil
|
|
233
|
+
C_KSlicer0_vine_i32 coarsen_on_grid(vector[vector[double]]) nogil
|
|
234
|
+
void vineyard_update() nogil
|
|
235
|
+
vector[cycle_type] get_representative_cycles(bool) nogil
|
|
236
|
+
vector[size_t] get_current_order() nogil
|
|
237
|
+
void add_point(const Finitely_critical_multi_filtration[double] &) nogil
|
|
238
|
+
|
|
239
|
+
#------------------------------------------------------------------------------
|
|
240
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
241
|
+
cdef cppclass C_Slicer0_vine_i32 "MatrixTrucPythonInterface<true,false,int32_t,Available_columns::INTRUSIVE_SET>":
|
|
242
|
+
ctypedef int32_t value_type
|
|
243
|
+
|
|
244
|
+
C_Slicer0_vine_i32()
|
|
245
|
+
|
|
246
|
+
C_Slicer0_vine_i32(const vector[vector[unsigned int]]&, const vector[int]&, const vector[Finitely_critical_multi_filtration[int32_t]]&)
|
|
247
|
+
|
|
248
|
+
C_Slicer0_vine_i32& operator=(const C_Slicer0_vine_i32&)
|
|
249
|
+
vector[vector[pair[int32_t, int32_t]]] get_barcode() nogil
|
|
250
|
+
void push_to(const Line[int32_t]&) nogil
|
|
251
|
+
void set_one_filtration(const vector[int32_t]&) nogil
|
|
252
|
+
|
|
253
|
+
vector[int32_t] get_one_filtration()
|
|
254
|
+
void compute_persistence() nogil
|
|
255
|
+
uint32_t num_generators() nogil
|
|
256
|
+
uint32_t num_parameters() nogil
|
|
257
|
+
string to_str() nogil
|
|
258
|
+
pair[Finitely_critical_multi_filtration[int32_t], Finitely_critical_multi_filtration[int32_t]] get_bounding_box() except + nogil
|
|
259
|
+
vector[Finitely_critical_multi_filtration[int32_t]] get_filtration_values() nogil
|
|
260
|
+
vector[int] get_dimensions() nogil
|
|
261
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
262
|
+
void coarsen_on_grid_inplace(vector[vector[int32_t]], bool) nogil
|
|
263
|
+
vector[Finitely_critical_multi_filtration[int32_t]]& get_filtrations() nogil
|
|
264
|
+
C_Slicer0_vine_i32 coarsen_on_grid(vector[vector[int32_t]]) nogil
|
|
265
|
+
void vineyard_update() nogil
|
|
266
|
+
vector[cycle_type] get_representative_cycles(bool) nogil
|
|
267
|
+
vector[size_t] get_current_order() nogil
|
|
268
|
+
|
|
269
|
+
#------------------------------------------------------------------------------
|
|
270
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
271
|
+
cdef cppclass C_Slicer0_vine_f32 "MatrixTrucPythonInterface<true,false,float,Available_columns::INTRUSIVE_SET>":
|
|
272
|
+
ctypedef float value_type
|
|
273
|
+
|
|
274
|
+
C_Slicer0_vine_f32()
|
|
275
|
+
|
|
276
|
+
C_Slicer0_vine_f32(const vector[vector[unsigned int]]&, const vector[int]&, const vector[Finitely_critical_multi_filtration[float]]&)
|
|
277
|
+
|
|
278
|
+
C_Slicer0_vine_f32& operator=(const C_Slicer0_vine_f32&)
|
|
279
|
+
vector[vector[pair[float, float]]] get_barcode() nogil
|
|
280
|
+
void push_to(const Line[float]&) nogil
|
|
281
|
+
void set_one_filtration(const vector[float]&) nogil
|
|
282
|
+
|
|
283
|
+
vector[float] get_one_filtration()
|
|
284
|
+
void compute_persistence() nogil
|
|
285
|
+
uint32_t num_generators() nogil
|
|
286
|
+
uint32_t num_parameters() nogil
|
|
287
|
+
string to_str() nogil
|
|
288
|
+
pair[Finitely_critical_multi_filtration[float], Finitely_critical_multi_filtration[float]] get_bounding_box() except + nogil
|
|
289
|
+
vector[Finitely_critical_multi_filtration[float]] get_filtration_values() nogil
|
|
290
|
+
vector[int] get_dimensions() nogil
|
|
291
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
292
|
+
void coarsen_on_grid_inplace(vector[vector[float]], bool) nogil
|
|
293
|
+
vector[Finitely_critical_multi_filtration[float]]& get_filtrations() nogil
|
|
294
|
+
C_Slicer0_vine_i32 coarsen_on_grid(vector[vector[float]]) nogil
|
|
295
|
+
void vineyard_update() nogil
|
|
296
|
+
vector[cycle_type] get_representative_cycles(bool) nogil
|
|
297
|
+
vector[size_t] get_current_order() nogil
|
|
298
|
+
|
|
299
|
+
#------------------------------------------------------------------------------
|
|
300
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
301
|
+
cdef cppclass C_Slicer0_vine_f64 "MatrixTrucPythonInterface<true,false,double,Available_columns::INTRUSIVE_SET>":
|
|
302
|
+
ctypedef double value_type
|
|
303
|
+
|
|
304
|
+
C_Slicer0_vine_f64()
|
|
305
|
+
|
|
306
|
+
C_Slicer0_vine_f64(const vector[vector[unsigned int]]&, const vector[int]&, const vector[Finitely_critical_multi_filtration[double]]&)
|
|
307
|
+
|
|
308
|
+
C_Slicer0_vine_f64& operator=(const C_Slicer0_vine_f64&)
|
|
309
|
+
vector[vector[pair[double, double]]] get_barcode() nogil
|
|
310
|
+
void push_to(const Line[double]&) nogil
|
|
311
|
+
void set_one_filtration(const vector[double]&) nogil
|
|
312
|
+
|
|
313
|
+
vector[double] get_one_filtration()
|
|
314
|
+
void compute_persistence() nogil
|
|
315
|
+
uint32_t num_generators() nogil
|
|
316
|
+
uint32_t num_parameters() nogil
|
|
317
|
+
string to_str() nogil
|
|
318
|
+
pair[Finitely_critical_multi_filtration[double], Finitely_critical_multi_filtration[double]] get_bounding_box() except + nogil
|
|
319
|
+
vector[Finitely_critical_multi_filtration[double]] get_filtration_values() nogil
|
|
320
|
+
vector[int] get_dimensions() nogil
|
|
321
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
322
|
+
void coarsen_on_grid_inplace(vector[vector[double]], bool) nogil
|
|
323
|
+
vector[Finitely_critical_multi_filtration[double]]& get_filtrations() nogil
|
|
324
|
+
C_Slicer0_vine_i32 coarsen_on_grid(vector[vector[double]]) nogil
|
|
325
|
+
void vineyard_update() nogil
|
|
326
|
+
vector[cycle_type] get_representative_cycles(bool) nogil
|
|
327
|
+
vector[size_t] get_current_order() nogil
|
|
328
|
+
|
|
329
|
+
#------------------------------------------------------------------------------
|
|
330
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
331
|
+
cdef cppclass C_KSlicer0_i32 "MatrixTrucPythonInterface<false,true,int32_t,Available_columns::INTRUSIVE_SET>":
|
|
332
|
+
ctypedef int32_t value_type
|
|
333
|
+
|
|
334
|
+
C_KSlicer0_i32()
|
|
335
|
+
|
|
336
|
+
C_KSlicer0_i32(const vector[vector[unsigned int]]&, const vector[int]&, const vector[KCriticalFiltration[int32_t]]&)
|
|
337
|
+
|
|
338
|
+
C_KSlicer0_i32& operator=(const C_KSlicer0_i32&)
|
|
339
|
+
vector[vector[pair[int32_t, int32_t]]] get_barcode() nogil
|
|
340
|
+
void push_to(const Line[int32_t]&) nogil
|
|
341
|
+
void set_one_filtration(const vector[int32_t]&) nogil
|
|
342
|
+
|
|
343
|
+
vector[int32_t] get_one_filtration()
|
|
344
|
+
void compute_persistence() nogil
|
|
345
|
+
uint32_t num_generators() nogil
|
|
346
|
+
uint32_t num_parameters() nogil
|
|
347
|
+
string to_str() nogil
|
|
348
|
+
pair[Finitely_critical_multi_filtration[int32_t], Finitely_critical_multi_filtration[int32_t]] get_bounding_box() except + nogil
|
|
349
|
+
vector[Finitely_critical_multi_filtration[int32_t]] get_filtration_values() nogil
|
|
350
|
+
vector[int] get_dimensions() nogil
|
|
351
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
352
|
+
void coarsen_on_grid_inplace(vector[vector[int32_t]], bool) nogil
|
|
353
|
+
vector[KCriticalFiltration[int32_t]]& get_filtrations() nogil
|
|
354
|
+
C_KSlicer0_i32 coarsen_on_grid(vector[vector[int32_t]]) nogil
|
|
355
|
+
void add_point(const Finitely_critical_multi_filtration[int32_t] &) nogil
|
|
356
|
+
|
|
357
|
+
#------------------------------------------------------------------------------
|
|
358
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
359
|
+
cdef cppclass C_KSlicer0_f32 "MatrixTrucPythonInterface<false,true,float,Available_columns::INTRUSIVE_SET>":
|
|
360
|
+
ctypedef float value_type
|
|
361
|
+
|
|
362
|
+
C_KSlicer0_f32()
|
|
363
|
+
|
|
364
|
+
C_KSlicer0_f32(const vector[vector[unsigned int]]&, const vector[int]&, const vector[KCriticalFiltration[float]]&)
|
|
365
|
+
|
|
366
|
+
C_KSlicer0_f32& operator=(const C_KSlicer0_f32&)
|
|
367
|
+
vector[vector[pair[float, float]]] get_barcode() nogil
|
|
368
|
+
void push_to(const Line[float]&) nogil
|
|
369
|
+
void set_one_filtration(const vector[float]&) nogil
|
|
370
|
+
|
|
371
|
+
vector[float] get_one_filtration()
|
|
372
|
+
void compute_persistence() nogil
|
|
373
|
+
uint32_t num_generators() nogil
|
|
374
|
+
uint32_t num_parameters() nogil
|
|
375
|
+
string to_str() nogil
|
|
376
|
+
pair[Finitely_critical_multi_filtration[float], Finitely_critical_multi_filtration[float]] get_bounding_box() except + nogil
|
|
377
|
+
vector[Finitely_critical_multi_filtration[float]] get_filtration_values() nogil
|
|
378
|
+
vector[int] get_dimensions() nogil
|
|
379
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
380
|
+
void coarsen_on_grid_inplace(vector[vector[float]], bool) nogil
|
|
381
|
+
vector[KCriticalFiltration[float]]& get_filtrations() nogil
|
|
382
|
+
C_KSlicer0_i32 coarsen_on_grid(vector[vector[float]]) nogil
|
|
383
|
+
void add_point(const Finitely_critical_multi_filtration[float] &) nogil
|
|
384
|
+
|
|
385
|
+
#------------------------------------------------------------------------------
|
|
386
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
387
|
+
cdef cppclass C_KSlicer0_f64 "MatrixTrucPythonInterface<false,true,double,Available_columns::INTRUSIVE_SET>":
|
|
388
|
+
ctypedef double value_type
|
|
389
|
+
|
|
390
|
+
C_KSlicer0_f64()
|
|
391
|
+
|
|
392
|
+
C_KSlicer0_f64(const vector[vector[unsigned int]]&, const vector[int]&, const vector[KCriticalFiltration[double]]&)
|
|
393
|
+
|
|
394
|
+
C_KSlicer0_f64& operator=(const C_KSlicer0_f64&)
|
|
395
|
+
vector[vector[pair[double, double]]] get_barcode() nogil
|
|
396
|
+
void push_to(const Line[double]&) nogil
|
|
397
|
+
void set_one_filtration(const vector[double]&) nogil
|
|
398
|
+
|
|
399
|
+
vector[double] get_one_filtration()
|
|
400
|
+
void compute_persistence() nogil
|
|
401
|
+
uint32_t num_generators() nogil
|
|
402
|
+
uint32_t num_parameters() nogil
|
|
403
|
+
string to_str() nogil
|
|
404
|
+
pair[Finitely_critical_multi_filtration[double], Finitely_critical_multi_filtration[double]] get_bounding_box() except + nogil
|
|
405
|
+
vector[Finitely_critical_multi_filtration[double]] get_filtration_values() nogil
|
|
406
|
+
vector[int] get_dimensions() nogil
|
|
407
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
408
|
+
void coarsen_on_grid_inplace(vector[vector[double]], bool) nogil
|
|
409
|
+
vector[KCriticalFiltration[double]]& get_filtrations() nogil
|
|
410
|
+
C_KSlicer0_i32 coarsen_on_grid(vector[vector[double]]) nogil
|
|
411
|
+
void add_point(const Finitely_critical_multi_filtration[double] &) nogil
|
|
412
|
+
|
|
413
|
+
#------------------------------------------------------------------------------
|
|
414
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
415
|
+
cdef cppclass C_Slicer0_i32 "MatrixTrucPythonInterface<false,false,int32_t,Available_columns::INTRUSIVE_SET>":
|
|
416
|
+
ctypedef int32_t value_type
|
|
417
|
+
|
|
418
|
+
C_Slicer0_i32()
|
|
419
|
+
|
|
420
|
+
C_Slicer0_i32(const vector[vector[unsigned int]]&, const vector[int]&, const vector[Finitely_critical_multi_filtration[int32_t]]&)
|
|
421
|
+
|
|
422
|
+
C_Slicer0_i32& operator=(const C_Slicer0_i32&)
|
|
423
|
+
vector[vector[pair[int32_t, int32_t]]] get_barcode() nogil
|
|
424
|
+
void push_to(const Line[int32_t]&) nogil
|
|
425
|
+
void set_one_filtration(const vector[int32_t]&) nogil
|
|
426
|
+
|
|
427
|
+
vector[int32_t] get_one_filtration()
|
|
428
|
+
void compute_persistence() nogil
|
|
429
|
+
uint32_t num_generators() nogil
|
|
430
|
+
uint32_t num_parameters() nogil
|
|
431
|
+
string to_str() nogil
|
|
432
|
+
pair[Finitely_critical_multi_filtration[int32_t], Finitely_critical_multi_filtration[int32_t]] get_bounding_box() except + nogil
|
|
433
|
+
vector[Finitely_critical_multi_filtration[int32_t]] get_filtration_values() nogil
|
|
434
|
+
vector[int] get_dimensions() nogil
|
|
435
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
436
|
+
void coarsen_on_grid_inplace(vector[vector[int32_t]], bool) nogil
|
|
437
|
+
vector[Finitely_critical_multi_filtration[int32_t]]& get_filtrations() nogil
|
|
438
|
+
C_Slicer0_i32 coarsen_on_grid(vector[vector[int32_t]]) nogil
|
|
439
|
+
|
|
440
|
+
#------------------------------------------------------------------------------
|
|
441
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
442
|
+
cdef cppclass C_Slicer0_f32 "MatrixTrucPythonInterface<false,false,float,Available_columns::INTRUSIVE_SET>":
|
|
443
|
+
ctypedef float value_type
|
|
444
|
+
|
|
445
|
+
C_Slicer0_f32()
|
|
446
|
+
|
|
447
|
+
C_Slicer0_f32(const vector[vector[unsigned int]]&, const vector[int]&, const vector[Finitely_critical_multi_filtration[float]]&)
|
|
448
|
+
|
|
449
|
+
C_Slicer0_f32& operator=(const C_Slicer0_f32&)
|
|
450
|
+
vector[vector[pair[float, float]]] get_barcode() nogil
|
|
451
|
+
void push_to(const Line[float]&) nogil
|
|
452
|
+
void set_one_filtration(const vector[float]&) nogil
|
|
453
|
+
|
|
454
|
+
vector[float] get_one_filtration()
|
|
455
|
+
void compute_persistence() nogil
|
|
456
|
+
uint32_t num_generators() nogil
|
|
457
|
+
uint32_t num_parameters() nogil
|
|
458
|
+
string to_str() nogil
|
|
459
|
+
pair[Finitely_critical_multi_filtration[float], Finitely_critical_multi_filtration[float]] get_bounding_box() except + nogil
|
|
460
|
+
vector[Finitely_critical_multi_filtration[float]] get_filtration_values() nogil
|
|
461
|
+
vector[int] get_dimensions() nogil
|
|
462
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
463
|
+
void coarsen_on_grid_inplace(vector[vector[float]], bool) nogil
|
|
464
|
+
vector[Finitely_critical_multi_filtration[float]]& get_filtrations() nogil
|
|
465
|
+
C_Slicer0_i32 coarsen_on_grid(vector[vector[float]]) nogil
|
|
466
|
+
|
|
467
|
+
#------------------------------------------------------------------------------
|
|
468
|
+
cdef extern from "Persistence_slices_interface.h":
|
|
469
|
+
cdef cppclass C_Slicer0_f64 "MatrixTrucPythonInterface<false,false,double,Available_columns::INTRUSIVE_SET>":
|
|
470
|
+
ctypedef double value_type
|
|
471
|
+
|
|
472
|
+
C_Slicer0_f64()
|
|
473
|
+
|
|
474
|
+
C_Slicer0_f64(const vector[vector[unsigned int]]&, const vector[int]&, const vector[Finitely_critical_multi_filtration[double]]&)
|
|
475
|
+
|
|
476
|
+
C_Slicer0_f64& operator=(const C_Slicer0_f64&)
|
|
477
|
+
vector[vector[pair[double, double]]] get_barcode() nogil
|
|
478
|
+
void push_to(const Line[double]&) nogil
|
|
479
|
+
void set_one_filtration(const vector[double]&) nogil
|
|
480
|
+
|
|
481
|
+
vector[double] get_one_filtration()
|
|
482
|
+
void compute_persistence() nogil
|
|
483
|
+
uint32_t num_generators() nogil
|
|
484
|
+
uint32_t num_parameters() nogil
|
|
485
|
+
string to_str() nogil
|
|
486
|
+
pair[Finitely_critical_multi_filtration[double], Finitely_critical_multi_filtration[double]] get_bounding_box() except + nogil
|
|
487
|
+
vector[Finitely_critical_multi_filtration[double]] get_filtration_values() nogil
|
|
488
|
+
vector[int] get_dimensions() nogil
|
|
489
|
+
vector[vector[uint]] get_boundaries() nogil
|
|
490
|
+
void coarsen_on_grid_inplace(vector[vector[double]], bool) nogil
|
|
491
|
+
vector[Finitely_critical_multi_filtration[double]]& get_filtrations() nogil
|
|
492
|
+
C_Slicer0_i32 coarsen_on_grid(vector[vector[double]]) nogil
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
#### MMA Stuff
|
|
497
|
+
|
|
498
|
+
from multipers.mma_structures cimport Module
|
|
499
|
+
cdef extern from "multiparameter_module_approximation/approximation.h" namespace "Gudhi::multiparameter::mma":
|
|
500
|
+
Module[float] multiparameter_module_approximation(GeneralVineClementTruc&, Finitely_critical_multi_filtration[float]&, float, Box[float]&, bool, bool, bool) except + nogil
|
|
501
|
+
Module[float] multiparameter_module_approximation(SimplicialVineGraphTruc&, Finitely_critical_multi_filtration[float]&, float, Box[float]&, bool, bool, bool) except + nogil
|
|
502
|
+
Module[float] multiparameter_module_approximation(SimplicialVineMatrixTruc&, Finitely_critical_multi_filtration[float]&, float, Box[float]&, bool, bool, bool) except + nogil
|
|
503
|
+
Module[float] multiparameter_module_approximation(C_KSlicer0_vine_f32&, Finitely_critical_multi_filtration[float]&, float, Box[float]&, bool, bool, bool) except + nogil
|
|
504
|
+
Module[double] multiparameter_module_approximation(C_KSlicer0_vine_f64&, Finitely_critical_multi_filtration[double]&, double, Box[double]&, bool, bool, bool) except + nogil
|
|
505
|
+
Module[float] multiparameter_module_approximation(C_Slicer0_vine_f32&, Finitely_critical_multi_filtration[float]&, float, Box[float]&, bool, bool, bool) except + nogil
|
|
506
|
+
Module[double] multiparameter_module_approximation(C_Slicer0_vine_f64&, Finitely_critical_multi_filtration[double]&, double, Box[double]&, bool, bool, bool) except + nogil
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
import multipers.slicer as mps
|
|
512
|
+
from cython.operator cimport dereference
|
|
513
|
+
## TODO : make it less hardcoded
|
|
514
|
+
cdef inline Module[float] _multiparameter_module_approximation_f32(object slicer, Finitely_critical_multi_filtration[float]& direction, float max_error, Box[float] box, bool threshold, bool complete, bool verbose):
|
|
515
|
+
import multipers.slicer as mps
|
|
516
|
+
cdef intptr_t slicer_ptr = <intptr_t>(slicer.get_ptr())
|
|
517
|
+
cdef Module[float] mod
|
|
518
|
+
if False:
|
|
519
|
+
pass
|
|
520
|
+
elif isinstance(slicer, mps._SlicerClement):
|
|
521
|
+
with nogil:
|
|
522
|
+
mod = multiparameter_module_approximation(dereference(<GeneralVineClementTruc*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
523
|
+
elif isinstance(slicer, mps._SlicerVineGraph):
|
|
524
|
+
with nogil:
|
|
525
|
+
mod = multiparameter_module_approximation(dereference(<SimplicialVineGraphTruc*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
526
|
+
elif isinstance(slicer, mps._SlicerVineSimplicial):
|
|
527
|
+
with nogil:
|
|
528
|
+
mod = multiparameter_module_approximation(dereference(<SimplicialVineMatrixTruc*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
529
|
+
elif isinstance(slicer, mps._KSlicer0_vine_f32):
|
|
530
|
+
with nogil:
|
|
531
|
+
mod = multiparameter_module_approximation(dereference(<C_KSlicer0_vine_f32*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
532
|
+
elif isinstance(slicer, mps._Slicer0_vine_f32):
|
|
533
|
+
with nogil:
|
|
534
|
+
mod = multiparameter_module_approximation(dereference(<C_Slicer0_vine_f32*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
535
|
+
else:
|
|
536
|
+
raise ValueError(f"Unsupported slicer type {type(slicer)}")
|
|
537
|
+
|
|
538
|
+
return mod
|
|
539
|
+
## TODO : make it less hardcoded
|
|
540
|
+
cdef inline Module[double] _multiparameter_module_approximation_f64(object slicer, Finitely_critical_multi_filtration[double]& direction, double max_error, Box[double] box, bool threshold, bool complete, bool verbose):
|
|
541
|
+
import multipers.slicer as mps
|
|
542
|
+
cdef intptr_t slicer_ptr = <intptr_t>(slicer.get_ptr())
|
|
543
|
+
cdef Module[double] mod
|
|
544
|
+
if False:
|
|
545
|
+
pass
|
|
546
|
+
elif isinstance(slicer, mps._KSlicer0_vine_f64):
|
|
547
|
+
with nogil:
|
|
548
|
+
mod = multiparameter_module_approximation(dereference(<C_KSlicer0_vine_f64*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
549
|
+
elif isinstance(slicer, mps._Slicer0_vine_f64):
|
|
550
|
+
with nogil:
|
|
551
|
+
mod = multiparameter_module_approximation(dereference(<C_Slicer0_vine_f64*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
552
|
+
else:
|
|
553
|
+
raise ValueError(f"Unsupported slicer type {type(slicer)}")
|
|
554
|
+
|
|
555
|
+
return mod
|
|
556
|
+
|
|
557
|
+
###### RANK INVARIANT
|
|
558
|
+
from libc.stdint cimport intptr_t, uint16_t, uint32_t, int32_t, int16_t, int8_t
|
|
559
|
+
ctypedef int32_t tensor_dtype
|
|
560
|
+
ctypedef int32_t indices_type
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
ctypedef pair[vector[vector[indices_type]], vector[tensor_dtype]] signed_measure_type
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
cdef extern from "multi_parameter_rank_invariant/rank_invariant.h" namespace "Gudhi::multiparameter::rank_invariant":
|
|
570
|
+
## from slicers
|
|
571
|
+
void compute_rank_invariant_python(GeneralVineClementTruc&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
572
|
+
signed_measure_type compute_rank_signed_measure(GeneralVineClementTruc&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
573
|
+
void compute_rank_invariant_python(SimplicialVineGraphTruc&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
574
|
+
signed_measure_type compute_rank_signed_measure(SimplicialVineGraphTruc&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
575
|
+
void compute_rank_invariant_python(SimplicialVineMatrixTruc&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
576
|
+
signed_measure_type compute_rank_signed_measure(SimplicialVineMatrixTruc&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
577
|
+
void compute_rank_invariant_python(SimplicialNoVineMatrixTruc&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
578
|
+
signed_measure_type compute_rank_signed_measure(SimplicialNoVineMatrixTruc&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
579
|
+
void compute_rank_invariant_python(C_KSlicer0_vine_i32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
580
|
+
signed_measure_type compute_rank_signed_measure(C_KSlicer0_vine_i32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
581
|
+
void compute_rank_invariant_python(C_KSlicer0_vine_f32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
582
|
+
signed_measure_type compute_rank_signed_measure(C_KSlicer0_vine_f32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
583
|
+
void compute_rank_invariant_python(C_KSlicer0_vine_f64&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
584
|
+
signed_measure_type compute_rank_signed_measure(C_KSlicer0_vine_f64&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
585
|
+
void compute_rank_invariant_python(C_Slicer0_vine_i32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
586
|
+
signed_measure_type compute_rank_signed_measure(C_Slicer0_vine_i32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
587
|
+
void compute_rank_invariant_python(C_Slicer0_vine_f32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
588
|
+
signed_measure_type compute_rank_signed_measure(C_Slicer0_vine_f32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
589
|
+
void compute_rank_invariant_python(C_Slicer0_vine_f64&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
590
|
+
signed_measure_type compute_rank_signed_measure(C_Slicer0_vine_f64&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
591
|
+
void compute_rank_invariant_python(C_KSlicer0_i32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
592
|
+
signed_measure_type compute_rank_signed_measure(C_KSlicer0_i32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
593
|
+
void compute_rank_invariant_python(C_KSlicer0_f32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
594
|
+
signed_measure_type compute_rank_signed_measure(C_KSlicer0_f32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
595
|
+
void compute_rank_invariant_python(C_KSlicer0_f64&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
596
|
+
signed_measure_type compute_rank_signed_measure(C_KSlicer0_f64&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
597
|
+
void compute_rank_invariant_python(C_Slicer0_i32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
598
|
+
signed_measure_type compute_rank_signed_measure(C_Slicer0_i32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
599
|
+
void compute_rank_invariant_python(C_Slicer0_f32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
600
|
+
signed_measure_type compute_rank_signed_measure(C_Slicer0_f32&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
601
|
+
void compute_rank_invariant_python(C_Slicer0_f64&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type) except + nogil
|
|
602
|
+
signed_measure_type compute_rank_signed_measure(C_Slicer0_f64&, tensor_dtype* , const vector[indices_type], const vector[indices_type], indices_type, bool) except + nogil
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
cdef inline void _compute_rank_invariant(object slicer, tensor_dtype* container_ptr, vector[indices_type] c_grid_shape, vector[indices_type] degrees, int n_jobs):
|
|
609
|
+
import multipers.slicer as mps
|
|
610
|
+
cdef intptr_t slicer_ptr = <intptr_t>(slicer.get_ptr())
|
|
611
|
+
if isinstance(slicer, mps._SlicerClement):
|
|
612
|
+
with nogil:
|
|
613
|
+
compute_rank_invariant_python(dereference(<GeneralVineClementTruc*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
614
|
+
return
|
|
615
|
+
if isinstance(slicer, mps._SlicerVineGraph):
|
|
616
|
+
with nogil:
|
|
617
|
+
compute_rank_invariant_python(dereference(<SimplicialVineGraphTruc*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
618
|
+
return
|
|
619
|
+
if isinstance(slicer, mps._SlicerVineSimplicial):
|
|
620
|
+
with nogil:
|
|
621
|
+
compute_rank_invariant_python(dereference(<SimplicialVineMatrixTruc*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
622
|
+
return
|
|
623
|
+
if isinstance(slicer, mps._SlicerNoVineSimplicial):
|
|
624
|
+
with nogil:
|
|
625
|
+
compute_rank_invariant_python(dereference(<SimplicialNoVineMatrixTruc*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
626
|
+
return
|
|
627
|
+
if isinstance(slicer, mps._KSlicer0_vine_i32):
|
|
628
|
+
with nogil:
|
|
629
|
+
compute_rank_invariant_python(dereference(<C_KSlicer0_vine_i32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
630
|
+
return
|
|
631
|
+
if isinstance(slicer, mps._KSlicer0_vine_f32):
|
|
632
|
+
with nogil:
|
|
633
|
+
compute_rank_invariant_python(dereference(<C_KSlicer0_vine_f32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
634
|
+
return
|
|
635
|
+
if isinstance(slicer, mps._KSlicer0_vine_f64):
|
|
636
|
+
with nogil:
|
|
637
|
+
compute_rank_invariant_python(dereference(<C_KSlicer0_vine_f64*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
638
|
+
return
|
|
639
|
+
if isinstance(slicer, mps._Slicer0_vine_i32):
|
|
640
|
+
with nogil:
|
|
641
|
+
compute_rank_invariant_python(dereference(<C_Slicer0_vine_i32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
642
|
+
return
|
|
643
|
+
if isinstance(slicer, mps._Slicer0_vine_f32):
|
|
644
|
+
with nogil:
|
|
645
|
+
compute_rank_invariant_python(dereference(<C_Slicer0_vine_f32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
646
|
+
return
|
|
647
|
+
if isinstance(slicer, mps._Slicer0_vine_f64):
|
|
648
|
+
with nogil:
|
|
649
|
+
compute_rank_invariant_python(dereference(<C_Slicer0_vine_f64*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
650
|
+
return
|
|
651
|
+
if isinstance(slicer, mps._KSlicer0_i32):
|
|
652
|
+
with nogil:
|
|
653
|
+
compute_rank_invariant_python(dereference(<C_KSlicer0_i32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
654
|
+
return
|
|
655
|
+
if isinstance(slicer, mps._KSlicer0_f32):
|
|
656
|
+
with nogil:
|
|
657
|
+
compute_rank_invariant_python(dereference(<C_KSlicer0_f32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
658
|
+
return
|
|
659
|
+
if isinstance(slicer, mps._KSlicer0_f64):
|
|
660
|
+
with nogil:
|
|
661
|
+
compute_rank_invariant_python(dereference(<C_KSlicer0_f64*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
662
|
+
return
|
|
663
|
+
if isinstance(slicer, mps._Slicer0_i32):
|
|
664
|
+
with nogil:
|
|
665
|
+
compute_rank_invariant_python(dereference(<C_Slicer0_i32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
666
|
+
return
|
|
667
|
+
if isinstance(slicer, mps._Slicer0_f32):
|
|
668
|
+
with nogil:
|
|
669
|
+
compute_rank_invariant_python(dereference(<C_Slicer0_f32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
670
|
+
return
|
|
671
|
+
if isinstance(slicer, mps._Slicer0_f64):
|
|
672
|
+
with nogil:
|
|
673
|
+
compute_rank_invariant_python(dereference(<C_Slicer0_f64*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs)
|
|
674
|
+
return
|
|
675
|
+
raise ValueError(f"Unsupported slicer type {type(slicer)}")
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
cdef inline _compute_rank_sm(object slicer, tensor_dtype* container_ptr, vector[indices_type] c_grid_shape, vector[indices_type] degrees, int n_jobs, bool verbose):
|
|
680
|
+
import multipers.slicer as mps
|
|
681
|
+
cdef intptr_t slicer_ptr = <intptr_t>(slicer.get_ptr())
|
|
682
|
+
cdef signed_measure_type sm
|
|
683
|
+
cdef cnp.ndarray[indices_type, ndim=2] pts
|
|
684
|
+
cdef cnp.ndarray[tensor_dtype, ndim=1] weights
|
|
685
|
+
if isinstance(slicer, mps._SlicerClement):
|
|
686
|
+
with nogil:
|
|
687
|
+
sm = compute_rank_signed_measure(dereference(<GeneralVineClementTruc*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
688
|
+
pts = sm.first
|
|
689
|
+
weights = sm.second
|
|
690
|
+
return (pts,weights)
|
|
691
|
+
if isinstance(slicer, mps._SlicerVineGraph):
|
|
692
|
+
with nogil:
|
|
693
|
+
sm = compute_rank_signed_measure(dereference(<SimplicialVineGraphTruc*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
694
|
+
pts = sm.first
|
|
695
|
+
weights = sm.second
|
|
696
|
+
return (pts,weights)
|
|
697
|
+
if isinstance(slicer, mps._SlicerVineSimplicial):
|
|
698
|
+
with nogil:
|
|
699
|
+
sm = compute_rank_signed_measure(dereference(<SimplicialVineMatrixTruc*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
700
|
+
pts = sm.first
|
|
701
|
+
weights = sm.second
|
|
702
|
+
return (pts,weights)
|
|
703
|
+
if isinstance(slicer, mps._SlicerNoVineSimplicial):
|
|
704
|
+
with nogil:
|
|
705
|
+
sm = compute_rank_signed_measure(dereference(<SimplicialNoVineMatrixTruc*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
706
|
+
pts = sm.first
|
|
707
|
+
weights = sm.second
|
|
708
|
+
return (pts,weights)
|
|
709
|
+
if isinstance(slicer, mps._KSlicer0_vine_i32):
|
|
710
|
+
with nogil:
|
|
711
|
+
sm = compute_rank_signed_measure(dereference(<C_KSlicer0_vine_i32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
712
|
+
pts = sm.first
|
|
713
|
+
weights = sm.second
|
|
714
|
+
return (pts,weights)
|
|
715
|
+
if isinstance(slicer, mps._KSlicer0_vine_f32):
|
|
716
|
+
with nogil:
|
|
717
|
+
sm = compute_rank_signed_measure(dereference(<C_KSlicer0_vine_f32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
718
|
+
pts = sm.first
|
|
719
|
+
weights = sm.second
|
|
720
|
+
return (pts,weights)
|
|
721
|
+
if isinstance(slicer, mps._KSlicer0_vine_f64):
|
|
722
|
+
with nogil:
|
|
723
|
+
sm = compute_rank_signed_measure(dereference(<C_KSlicer0_vine_f64*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
724
|
+
pts = sm.first
|
|
725
|
+
weights = sm.second
|
|
726
|
+
return (pts,weights)
|
|
727
|
+
if isinstance(slicer, mps._Slicer0_vine_i32):
|
|
728
|
+
with nogil:
|
|
729
|
+
sm = compute_rank_signed_measure(dereference(<C_Slicer0_vine_i32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
730
|
+
pts = sm.first
|
|
731
|
+
weights = sm.second
|
|
732
|
+
return (pts,weights)
|
|
733
|
+
if isinstance(slicer, mps._Slicer0_vine_f32):
|
|
734
|
+
with nogil:
|
|
735
|
+
sm = compute_rank_signed_measure(dereference(<C_Slicer0_vine_f32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
736
|
+
pts = sm.first
|
|
737
|
+
weights = sm.second
|
|
738
|
+
return (pts,weights)
|
|
739
|
+
if isinstance(slicer, mps._Slicer0_vine_f64):
|
|
740
|
+
with nogil:
|
|
741
|
+
sm = compute_rank_signed_measure(dereference(<C_Slicer0_vine_f64*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
742
|
+
pts = sm.first
|
|
743
|
+
weights = sm.second
|
|
744
|
+
return (pts,weights)
|
|
745
|
+
if isinstance(slicer, mps._KSlicer0_i32):
|
|
746
|
+
with nogil:
|
|
747
|
+
sm = compute_rank_signed_measure(dereference(<C_KSlicer0_i32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
748
|
+
pts = sm.first
|
|
749
|
+
weights = sm.second
|
|
750
|
+
return (pts,weights)
|
|
751
|
+
if isinstance(slicer, mps._KSlicer0_f32):
|
|
752
|
+
with nogil:
|
|
753
|
+
sm = compute_rank_signed_measure(dereference(<C_KSlicer0_f32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
754
|
+
pts = sm.first
|
|
755
|
+
weights = sm.second
|
|
756
|
+
return (pts,weights)
|
|
757
|
+
if isinstance(slicer, mps._KSlicer0_f64):
|
|
758
|
+
with nogil:
|
|
759
|
+
sm = compute_rank_signed_measure(dereference(<C_KSlicer0_f64*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
760
|
+
pts = sm.first
|
|
761
|
+
weights = sm.second
|
|
762
|
+
return (pts,weights)
|
|
763
|
+
if isinstance(slicer, mps._Slicer0_i32):
|
|
764
|
+
with nogil:
|
|
765
|
+
sm = compute_rank_signed_measure(dereference(<C_Slicer0_i32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
766
|
+
pts = sm.first
|
|
767
|
+
weights = sm.second
|
|
768
|
+
return (pts,weights)
|
|
769
|
+
if isinstance(slicer, mps._Slicer0_f32):
|
|
770
|
+
with nogil:
|
|
771
|
+
sm = compute_rank_signed_measure(dereference(<C_Slicer0_f32*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
772
|
+
pts = sm.first
|
|
773
|
+
weights = sm.second
|
|
774
|
+
return (pts,weights)
|
|
775
|
+
if isinstance(slicer, mps._Slicer0_f64):
|
|
776
|
+
with nogil:
|
|
777
|
+
sm = compute_rank_signed_measure(dereference(<C_Slicer0_f64*>(slicer_ptr)),container_ptr, c_grid_shape,degrees, n_jobs, verbose)
|
|
778
|
+
pts = sm.first
|
|
779
|
+
weights = sm.second
|
|
780
|
+
return (pts,weights)
|
|
781
|
+
raise ValueError(f"Unsupported slicer type {type(slicer)}")
|