multipers 2.3.3b5__cp311-cp311-win_amd64.whl → 2.3.3b6__cp311-cp311-win_amd64.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/array_api/numpy.py +5 -0
- multipers/array_api/torch.py +22 -0
- multipers/filtrations/filtrations.py +19 -6
- multipers/function_rips.cp311-win_amd64.pyd +0 -0
- multipers/grids.cp311-win_amd64.pyd +0 -0
- multipers/io.cp311-win_amd64.pyd +0 -0
- multipers/mma_structures.cp311-win_amd64.pyd +0 -0
- multipers/multiparameter_module_approximation.cp311-win_amd64.pyd +0 -0
- multipers/plots.py +12 -6
- multipers/point_measure.cp311-win_amd64.pyd +0 -0
- multipers/simplex_tree_multi.cp311-win_amd64.pyd +0 -0
- multipers/simplex_tree_multi.pyx +24 -8
- multipers/simplex_tree_multi.pyx.tp +3 -1
- multipers/slicer.cp311-win_amd64.pyd +0 -0
- multipers/slicer.pxd +20 -20
- multipers/slicer.pyx +61 -60
- multipers/slicer.pyx.tp +2 -1
- multipers/tbb12.dll +0 -0
- multipers/tbbbind_2_5.dll +0 -0
- multipers/tbbmalloc.dll +0 -0
- multipers/tbbmalloc_proxy.dll +0 -0
- {multipers-2.3.3b5.dist-info → multipers-2.3.3b6.dist-info}/METADATA +1 -1
- {multipers-2.3.3b5.dist-info → multipers-2.3.3b6.dist-info}/RECORD +26 -26
- {multipers-2.3.3b5.dist-info → multipers-2.3.3b6.dist-info}/WHEEL +0 -0
- {multipers-2.3.3b5.dist-info → multipers-2.3.3b6.dist-info}/licenses/LICENSE +0 -0
- {multipers-2.3.3b5.dist-info → multipers-2.3.3b6.dist-info}/top_level.txt +0 -0
multipers/array_api/numpy.py
CHANGED
|
@@ -18,6 +18,11 @@ min = _np.min
|
|
|
18
18
|
max = _np.max
|
|
19
19
|
repeat_interleave = _np.repeat
|
|
20
20
|
cdist = cdist # type: ignore[no-redef]
|
|
21
|
+
unique = _np.unique
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def quantile_closest(x, q, axis=None):
|
|
25
|
+
return _np.quantile(x, q, axis=axis, interpolation="closest_observation")
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
def minvalues(x: _np.ndarray, **kwargs):
|
multipers/array_api/torch.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import numpy as _np
|
|
1
2
|
import torch as _t
|
|
2
3
|
|
|
3
4
|
backend = _t
|
|
@@ -16,6 +17,27 @@ max = _t.max
|
|
|
16
17
|
repeat_interleave = _t.repeat_interleave
|
|
17
18
|
|
|
18
19
|
|
|
20
|
+
# in our context, this allows to get a correct gradient.
|
|
21
|
+
def unique(x, assume_sorted=False, _mean=True):
|
|
22
|
+
if not x.requires_grad:
|
|
23
|
+
return x.unique(sorted=assume_sorted)
|
|
24
|
+
if x.ndim != 1:
|
|
25
|
+
raise ValueError(f"Got ndim!=1. {x=}")
|
|
26
|
+
if not assume_sorted:
|
|
27
|
+
x = x.sort().values
|
|
28
|
+
_, c = _t.unique(x, sorted=True, return_counts=True)
|
|
29
|
+
if _mean:
|
|
30
|
+
x = _t.segment_reduce(data=x, reduce="mean", lengths=c, unsafe=True, axis=0)
|
|
31
|
+
return x
|
|
32
|
+
|
|
33
|
+
c = _np.concatenate([[0], _np.cumsum(c[:-1])])
|
|
34
|
+
return x[c]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def quantile_closest(x, q, axis=None):
|
|
38
|
+
return _t.quantile(x, q, dim=axis, interpolation="nearest")
|
|
39
|
+
|
|
40
|
+
|
|
19
41
|
def minvalues(x: _t.Tensor, **kwargs):
|
|
20
42
|
return _t.min(x, **kwargs).values
|
|
21
43
|
|
|
@@ -17,7 +17,6 @@ try:
|
|
|
17
17
|
|
|
18
18
|
from multipers.filtrations.density import KDE
|
|
19
19
|
except ImportError:
|
|
20
|
-
|
|
21
20
|
from sklearn.neighbors import KernelDensity
|
|
22
21
|
|
|
23
22
|
warn("pykeops not found. Falling back to sklearn.")
|
|
@@ -67,7 +66,9 @@ def RipsLowerstar(
|
|
|
67
66
|
function = function[:, None]
|
|
68
67
|
if function.ndim != 2:
|
|
69
68
|
raise ValueError(
|
|
70
|
-
f"
|
|
69
|
+
f"""
|
|
70
|
+
`function.ndim` should be 0 or 1 . Got {function.ndim=}.{function=}
|
|
71
|
+
"""
|
|
71
72
|
)
|
|
72
73
|
num_parameters = function.shape[1] + 1
|
|
73
74
|
st = SimplexTreeMulti(st, num_parameters=num_parameters)
|
|
@@ -154,6 +155,9 @@ def DelaunayLowerstar(
|
|
|
154
155
|
verbose=verbose,
|
|
155
156
|
clear=clear,
|
|
156
157
|
)
|
|
158
|
+
if reduce_degree >= 0:
|
|
159
|
+
# Force resolution to avoid confusion with hilbert.
|
|
160
|
+
slicer = slicer.minpres(degree=reduce_degree, force=True)
|
|
157
161
|
if flagify:
|
|
158
162
|
from multipers.slicer import to_simplextree
|
|
159
163
|
|
|
@@ -192,7 +196,7 @@ def DelaunayCodensity(
|
|
|
192
196
|
), "Density estimation is either via kernels or dtm."
|
|
193
197
|
if bandwidth is not None:
|
|
194
198
|
kde = KDE(bandwidth=bandwidth, kernel=kernel, return_log=return_log)
|
|
195
|
-
f = kde.fit(points).score_samples(points)
|
|
199
|
+
f = -kde.fit(points).score_samples(points)
|
|
196
200
|
elif dtm_mass is not None:
|
|
197
201
|
f = DTM(masses=[dtm_mass]).fit(points).score_samples(points)[0]
|
|
198
202
|
else:
|
|
@@ -287,11 +291,17 @@ def CoreDelaunay(
|
|
|
287
291
|
"safe",
|
|
288
292
|
"exact",
|
|
289
293
|
"fast",
|
|
290
|
-
], f"
|
|
294
|
+
], f"""
|
|
295
|
+
The parameter precision must be one of ['safe', 'exact', 'fast'],
|
|
296
|
+
got {precision}.
|
|
297
|
+
"""
|
|
291
298
|
|
|
292
299
|
if verbose:
|
|
293
300
|
print(
|
|
294
|
-
f"Computing the Delaunay Core Bifiltration
|
|
301
|
+
f"""Computing the Delaunay Core Bifiltration
|
|
302
|
+
of {len(points)} points in dimension {points.shape[1]}
|
|
303
|
+
with parameters:
|
|
304
|
+
"""
|
|
295
305
|
)
|
|
296
306
|
print(f"\tbeta = {beta}")
|
|
297
307
|
print(f"\tks = {ks}")
|
|
@@ -333,7 +343,10 @@ def CoreDelaunay(
|
|
|
333
343
|
num_simplices = len(vertex_array)
|
|
334
344
|
if verbose:
|
|
335
345
|
print(
|
|
336
|
-
f"
|
|
346
|
+
f"""
|
|
347
|
+
Inserting {num_simplices} simplices of dimension {dim}
|
|
348
|
+
({num_simplices * len(ks)} birth values)...
|
|
349
|
+
"""
|
|
337
350
|
)
|
|
338
351
|
max_knn_distances = np.max(knn_distances[vertex_array], axis=1)
|
|
339
352
|
critical_radii = np.maximum(alphas[:, None], beta * max_knn_distances)
|
|
Binary file
|
|
Binary file
|
multipers/io.cp311-win_amd64.pyd
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
multipers/plots.py
CHANGED
|
@@ -15,9 +15,9 @@ _custom_colors = [
|
|
|
15
15
|
"#00b4d8",
|
|
16
16
|
"#90e0ef",
|
|
17
17
|
]
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"continuous_cmap",
|
|
18
|
+
_cmap_ = ListedColormap(_custom_colors)
|
|
19
|
+
_cmap = mcolors.LinearSegmentedColormap.from_list(
|
|
20
|
+
"continuous_cmap", _cmap_.colors, N=256
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
|
|
@@ -180,8 +180,9 @@ def plot_surface(
|
|
|
180
180
|
fig=None,
|
|
181
181
|
ax=None,
|
|
182
182
|
cmap: Optional[str] = None,
|
|
183
|
-
discrete_surface=False,
|
|
184
|
-
has_negative_values=False,
|
|
183
|
+
discrete_surface: bool = False,
|
|
184
|
+
has_negative_values: bool = False,
|
|
185
|
+
contour: bool = True,
|
|
185
186
|
**plt_args,
|
|
186
187
|
):
|
|
187
188
|
import matplotlib
|
|
@@ -213,7 +214,12 @@ def plot_surface(
|
|
|
213
214
|
)
|
|
214
215
|
cbar.set_ticks(ticks=bounds, labels=bounds)
|
|
215
216
|
return im
|
|
216
|
-
|
|
217
|
+
|
|
218
|
+
if contour:
|
|
219
|
+
levels = plt_args.pop("levels", 20)
|
|
220
|
+
im = ax.contourf(grid[0], grid[1], hf.T, cmap=cmap, levels=levels, **plt_args)
|
|
221
|
+
else:
|
|
222
|
+
im = ax.pcolormesh(grid[0], grid[1], hf.T, cmap=cmap, **plt_args)
|
|
217
223
|
return im
|
|
218
224
|
|
|
219
225
|
|
|
Binary file
|
|
Binary file
|
multipers/simplex_tree_multi.pyx
CHANGED
|
@@ -883,6 +883,8 @@ cdef class SimplexTreeMulti_KFi32:
|
|
|
883
883
|
bool coordinate_values=True,
|
|
884
884
|
bool force=False,
|
|
885
885
|
str strategy:_available_strategies = "exact",
|
|
886
|
+
resolution:Optional[int|list[int]] = None,
|
|
887
|
+
bool coordinates = False,
|
|
886
888
|
grid_strategy=None,
|
|
887
889
|
bool inplace=False,
|
|
888
890
|
**filtration_grid_kwargs
|
|
@@ -910,7 +912,7 @@ cdef class SimplexTreeMulti_KFi32:
|
|
|
910
912
|
|
|
911
913
|
#TODO : multi-critical
|
|
912
914
|
if filtration_grid is None:
|
|
913
|
-
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
|
|
915
|
+
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
|
|
914
916
|
else:
|
|
915
917
|
filtration_grid = sanitize_grid(filtration_grid)
|
|
916
918
|
if len(filtration_grid) != self.num_parameters:
|
|
@@ -2322,6 +2324,8 @@ cdef class SimplexTreeMulti_Fi32:
|
|
|
2322
2324
|
bool coordinate_values=True,
|
|
2323
2325
|
bool force=False,
|
|
2324
2326
|
str strategy:_available_strategies = "exact",
|
|
2327
|
+
resolution:Optional[int|list[int]] = None,
|
|
2328
|
+
bool coordinates = False,
|
|
2325
2329
|
grid_strategy=None,
|
|
2326
2330
|
bool inplace=False,
|
|
2327
2331
|
**filtration_grid_kwargs
|
|
@@ -2349,7 +2353,7 @@ cdef class SimplexTreeMulti_Fi32:
|
|
|
2349
2353
|
|
|
2350
2354
|
#TODO : multi-critical
|
|
2351
2355
|
if filtration_grid is None:
|
|
2352
|
-
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
|
|
2356
|
+
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
|
|
2353
2357
|
else:
|
|
2354
2358
|
filtration_grid = sanitize_grid(filtration_grid)
|
|
2355
2359
|
if len(filtration_grid) != self.num_parameters:
|
|
@@ -3471,6 +3475,8 @@ cdef class SimplexTreeMulti_KFi64:
|
|
|
3471
3475
|
bool coordinate_values=True,
|
|
3472
3476
|
bool force=False,
|
|
3473
3477
|
str strategy:_available_strategies = "exact",
|
|
3478
|
+
resolution:Optional[int|list[int]] = None,
|
|
3479
|
+
bool coordinates = False,
|
|
3474
3480
|
grid_strategy=None,
|
|
3475
3481
|
bool inplace=False,
|
|
3476
3482
|
**filtration_grid_kwargs
|
|
@@ -3498,7 +3504,7 @@ cdef class SimplexTreeMulti_KFi64:
|
|
|
3498
3504
|
|
|
3499
3505
|
#TODO : multi-critical
|
|
3500
3506
|
if filtration_grid is None:
|
|
3501
|
-
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
|
|
3507
|
+
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
|
|
3502
3508
|
else:
|
|
3503
3509
|
filtration_grid = sanitize_grid(filtration_grid)
|
|
3504
3510
|
if len(filtration_grid) != self.num_parameters:
|
|
@@ -4910,6 +4916,8 @@ cdef class SimplexTreeMulti_Fi64:
|
|
|
4910
4916
|
bool coordinate_values=True,
|
|
4911
4917
|
bool force=False,
|
|
4912
4918
|
str strategy:_available_strategies = "exact",
|
|
4919
|
+
resolution:Optional[int|list[int]] = None,
|
|
4920
|
+
bool coordinates = False,
|
|
4913
4921
|
grid_strategy=None,
|
|
4914
4922
|
bool inplace=False,
|
|
4915
4923
|
**filtration_grid_kwargs
|
|
@@ -4937,7 +4945,7 @@ cdef class SimplexTreeMulti_Fi64:
|
|
|
4937
4945
|
|
|
4938
4946
|
#TODO : multi-critical
|
|
4939
4947
|
if filtration_grid is None:
|
|
4940
|
-
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
|
|
4948
|
+
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
|
|
4941
4949
|
else:
|
|
4942
4950
|
filtration_grid = sanitize_grid(filtration_grid)
|
|
4943
4951
|
if len(filtration_grid) != self.num_parameters:
|
|
@@ -6059,6 +6067,8 @@ cdef class SimplexTreeMulti_KFf32:
|
|
|
6059
6067
|
bool coordinate_values=True,
|
|
6060
6068
|
bool force=False,
|
|
6061
6069
|
str strategy:_available_strategies = "exact",
|
|
6070
|
+
resolution:Optional[int|list[int]] = None,
|
|
6071
|
+
bool coordinates = False,
|
|
6062
6072
|
grid_strategy=None,
|
|
6063
6073
|
bool inplace=False,
|
|
6064
6074
|
**filtration_grid_kwargs
|
|
@@ -6086,7 +6096,7 @@ cdef class SimplexTreeMulti_KFf32:
|
|
|
6086
6096
|
|
|
6087
6097
|
#TODO : multi-critical
|
|
6088
6098
|
if filtration_grid is None:
|
|
6089
|
-
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
|
|
6099
|
+
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
|
|
6090
6100
|
else:
|
|
6091
6101
|
filtration_grid = sanitize_grid(filtration_grid)
|
|
6092
6102
|
if len(filtration_grid) != self.num_parameters:
|
|
@@ -7498,6 +7508,8 @@ cdef class SimplexTreeMulti_Ff32:
|
|
|
7498
7508
|
bool coordinate_values=True,
|
|
7499
7509
|
bool force=False,
|
|
7500
7510
|
str strategy:_available_strategies = "exact",
|
|
7511
|
+
resolution:Optional[int|list[int]] = None,
|
|
7512
|
+
bool coordinates = False,
|
|
7501
7513
|
grid_strategy=None,
|
|
7502
7514
|
bool inplace=False,
|
|
7503
7515
|
**filtration_grid_kwargs
|
|
@@ -7525,7 +7537,7 @@ cdef class SimplexTreeMulti_Ff32:
|
|
|
7525
7537
|
|
|
7526
7538
|
#TODO : multi-critical
|
|
7527
7539
|
if filtration_grid is None:
|
|
7528
|
-
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
|
|
7540
|
+
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
|
|
7529
7541
|
else:
|
|
7530
7542
|
filtration_grid = sanitize_grid(filtration_grid)
|
|
7531
7543
|
if len(filtration_grid) != self.num_parameters:
|
|
@@ -8647,6 +8659,8 @@ cdef class SimplexTreeMulti_KFf64:
|
|
|
8647
8659
|
bool coordinate_values=True,
|
|
8648
8660
|
bool force=False,
|
|
8649
8661
|
str strategy:_available_strategies = "exact",
|
|
8662
|
+
resolution:Optional[int|list[int]] = None,
|
|
8663
|
+
bool coordinates = False,
|
|
8650
8664
|
grid_strategy=None,
|
|
8651
8665
|
bool inplace=False,
|
|
8652
8666
|
**filtration_grid_kwargs
|
|
@@ -8674,7 +8688,7 @@ cdef class SimplexTreeMulti_KFf64:
|
|
|
8674
8688
|
|
|
8675
8689
|
#TODO : multi-critical
|
|
8676
8690
|
if filtration_grid is None:
|
|
8677
|
-
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
|
|
8691
|
+
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
|
|
8678
8692
|
else:
|
|
8679
8693
|
filtration_grid = sanitize_grid(filtration_grid)
|
|
8680
8694
|
if len(filtration_grid) != self.num_parameters:
|
|
@@ -10086,6 +10100,8 @@ cdef class SimplexTreeMulti_Ff64:
|
|
|
10086
10100
|
bool coordinate_values=True,
|
|
10087
10101
|
bool force=False,
|
|
10088
10102
|
str strategy:_available_strategies = "exact",
|
|
10103
|
+
resolution:Optional[int|list[int]] = None,
|
|
10104
|
+
bool coordinates = False,
|
|
10089
10105
|
grid_strategy=None,
|
|
10090
10106
|
bool inplace=False,
|
|
10091
10107
|
**filtration_grid_kwargs
|
|
@@ -10113,7 +10129,7 @@ cdef class SimplexTreeMulti_Ff64:
|
|
|
10113
10129
|
|
|
10114
10130
|
#TODO : multi-critical
|
|
10115
10131
|
if filtration_grid is None:
|
|
10116
|
-
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
|
|
10132
|
+
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
|
|
10117
10133
|
else:
|
|
10118
10134
|
filtration_grid = sanitize_grid(filtration_grid)
|
|
10119
10135
|
if len(filtration_grid) != self.num_parameters:
|
|
@@ -1330,6 +1330,8 @@ cdef class SimplexTreeMulti_{{FSHORT}}:
|
|
|
1330
1330
|
bool coordinate_values=True,
|
|
1331
1331
|
bool force=False,
|
|
1332
1332
|
str strategy:_available_strategies = "exact",
|
|
1333
|
+
resolution:Optional[int|list[int]] = None,
|
|
1334
|
+
bool coordinates = False,
|
|
1333
1335
|
grid_strategy=None,
|
|
1334
1336
|
bool inplace=False,
|
|
1335
1337
|
**filtration_grid_kwargs
|
|
@@ -1357,7 +1359,7 @@ cdef class SimplexTreeMulti_{{FSHORT}}:
|
|
|
1357
1359
|
|
|
1358
1360
|
#TODO : multi-critical
|
|
1359
1361
|
if filtration_grid is None:
|
|
1360
|
-
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
|
|
1362
|
+
filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
|
|
1361
1363
|
else:
|
|
1362
1364
|
filtration_grid = sanitize_grid(filtration_grid)
|
|
1363
1365
|
if len(filtration_grid) != self.num_parameters:
|
|
Binary file
|
multipers/slicer.pxd
CHANGED
|
@@ -2013,51 +2013,51 @@ cdef extern from "multiparameter_module_approximation/approximation.h" namespace
|
|
|
2013
2013
|
|
|
2014
2014
|
import multipers.slicer as mps
|
|
2015
2015
|
from cython.operator cimport dereference
|
|
2016
|
-
cdef inline Module[
|
|
2016
|
+
cdef inline Module[double] _multiparameter_module_approximation_f64(object slicer, One_critical_filtration[double] direction, double max_error, Box[double] box, bool threshold, bool complete, bool verbose):
|
|
2017
2017
|
import multipers.slicer as mps
|
|
2018
2018
|
cdef intptr_t slicer_ptr = <intptr_t>(slicer.get_ptr())
|
|
2019
|
-
cdef Module[
|
|
2019
|
+
cdef Module[double] mod
|
|
2020
2020
|
if False:
|
|
2021
2021
|
pass
|
|
2022
|
-
elif isinstance(slicer, mps.
|
|
2022
|
+
elif isinstance(slicer, mps._KSlicer_Matrix0_vine_f64):
|
|
2023
2023
|
with nogil:
|
|
2024
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2024
|
+
mod = multiparameter_module_approximation(dereference(<C_KSlicer_Matrix0_vine_f64*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2025
2025
|
return mod
|
|
2026
|
-
elif isinstance(slicer, mps.
|
|
2026
|
+
elif isinstance(slicer, mps._KSlicer_Matrix1_vine_f64):
|
|
2027
2027
|
with nogil:
|
|
2028
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2028
|
+
mod = multiparameter_module_approximation(dereference(<C_KSlicer_Matrix1_vine_f64*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2029
2029
|
return mod
|
|
2030
|
-
elif isinstance(slicer, mps.
|
|
2030
|
+
elif isinstance(slicer, mps._Slicer_Matrix0_vine_f64):
|
|
2031
2031
|
with nogil:
|
|
2032
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2032
|
+
mod = multiparameter_module_approximation(dereference(<C_Slicer_Matrix0_vine_f64*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2033
2033
|
return mod
|
|
2034
|
-
elif isinstance(slicer, mps.
|
|
2034
|
+
elif isinstance(slicer, mps._Slicer_Matrix1_vine_f64):
|
|
2035
2035
|
with nogil:
|
|
2036
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2036
|
+
mod = multiparameter_module_approximation(dereference(<C_Slicer_Matrix1_vine_f64*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2037
2037
|
return mod
|
|
2038
2038
|
else:
|
|
2039
2039
|
raise ValueError(f"Unsupported slicer type {type(slicer)}")
|
|
2040
|
-
cdef inline Module[
|
|
2040
|
+
cdef inline Module[float] _multiparameter_module_approximation_f32(object slicer, One_critical_filtration[float] direction, float max_error, Box[float] box, bool threshold, bool complete, bool verbose):
|
|
2041
2041
|
import multipers.slicer as mps
|
|
2042
2042
|
cdef intptr_t slicer_ptr = <intptr_t>(slicer.get_ptr())
|
|
2043
|
-
cdef Module[
|
|
2043
|
+
cdef Module[float] mod
|
|
2044
2044
|
if False:
|
|
2045
2045
|
pass
|
|
2046
|
-
elif isinstance(slicer, mps.
|
|
2046
|
+
elif isinstance(slicer, mps._KSlicer_Matrix0_vine_f32):
|
|
2047
2047
|
with nogil:
|
|
2048
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2048
|
+
mod = multiparameter_module_approximation(dereference(<C_KSlicer_Matrix0_vine_f32*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2049
2049
|
return mod
|
|
2050
|
-
elif isinstance(slicer, mps.
|
|
2050
|
+
elif isinstance(slicer, mps._KSlicer_Matrix1_vine_f32):
|
|
2051
2051
|
with nogil:
|
|
2052
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2052
|
+
mod = multiparameter_module_approximation(dereference(<C_KSlicer_Matrix1_vine_f32*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2053
2053
|
return mod
|
|
2054
|
-
elif isinstance(slicer, mps.
|
|
2054
|
+
elif isinstance(slicer, mps._Slicer_Matrix0_vine_f32):
|
|
2055
2055
|
with nogil:
|
|
2056
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2056
|
+
mod = multiparameter_module_approximation(dereference(<C_Slicer_Matrix0_vine_f32*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2057
2057
|
return mod
|
|
2058
|
-
elif isinstance(slicer, mps.
|
|
2058
|
+
elif isinstance(slicer, mps._Slicer_Matrix1_vine_f32):
|
|
2059
2059
|
with nogil:
|
|
2060
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2060
|
+
mod = multiparameter_module_approximation(dereference(<C_Slicer_Matrix1_vine_f32*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2061
2061
|
return mod
|
|
2062
2062
|
else:
|
|
2063
2063
|
raise ValueError(f"Unsupported slicer type {type(slicer)}")
|
multipers/slicer.pyx
CHANGED
|
@@ -549,7 +549,7 @@ cdef class _KSlicer_Matrix0_vine_i32:
|
|
|
549
549
|
filtration_array = np.asarray(filtration_array, dtype= np.int32)
|
|
550
550
|
cdef int32_t[:,:] arr_view = filtration_array
|
|
551
551
|
cdef int size = arr_view.shape[0]
|
|
552
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
552
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
553
553
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
554
554
|
|
|
555
555
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -1040,7 +1040,7 @@ cdef class _KSlicer_Matrix1_vine_i32:
|
|
|
1040
1040
|
filtration_array = np.asarray(filtration_array, dtype= np.int32)
|
|
1041
1041
|
cdef int32_t[:,:] arr_view = filtration_array
|
|
1042
1042
|
cdef int size = arr_view.shape[0]
|
|
1043
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
1043
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
1044
1044
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
1045
1045
|
|
|
1046
1046
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -1531,7 +1531,7 @@ cdef class _KSlicer_Matrix0_vine_i64:
|
|
|
1531
1531
|
filtration_array = np.asarray(filtration_array, dtype= np.int64)
|
|
1532
1532
|
cdef int64_t[:,:] arr_view = filtration_array
|
|
1533
1533
|
cdef int size = arr_view.shape[0]
|
|
1534
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
1534
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
1535
1535
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
1536
1536
|
|
|
1537
1537
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -2022,7 +2022,7 @@ cdef class _KSlicer_Matrix1_vine_i64:
|
|
|
2022
2022
|
filtration_array = np.asarray(filtration_array, dtype= np.int64)
|
|
2023
2023
|
cdef int64_t[:,:] arr_view = filtration_array
|
|
2024
2024
|
cdef int size = arr_view.shape[0]
|
|
2025
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
2025
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
2026
2026
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
2027
2027
|
|
|
2028
2028
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -2514,7 +2514,7 @@ cdef class _KSlicer_Matrix0_vine_f32:
|
|
|
2514
2514
|
filtration_array = np.asarray(filtration_array, dtype= np.float32)
|
|
2515
2515
|
cdef float[:,:] arr_view = filtration_array
|
|
2516
2516
|
cdef int size = arr_view.shape[0]
|
|
2517
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
2517
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
2518
2518
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
2519
2519
|
|
|
2520
2520
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -3006,7 +3006,7 @@ cdef class _KSlicer_Matrix1_vine_f32:
|
|
|
3006
3006
|
filtration_array = np.asarray(filtration_array, dtype= np.float32)
|
|
3007
3007
|
cdef float[:,:] arr_view = filtration_array
|
|
3008
3008
|
cdef int size = arr_view.shape[0]
|
|
3009
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
3009
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
3010
3010
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
3011
3011
|
|
|
3012
3012
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -3498,7 +3498,7 @@ cdef class _KSlicer_Matrix0_vine_f64:
|
|
|
3498
3498
|
filtration_array = np.asarray(filtration_array, dtype= np.float64)
|
|
3499
3499
|
cdef double[:,:] arr_view = filtration_array
|
|
3500
3500
|
cdef int size = arr_view.shape[0]
|
|
3501
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
3501
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
3502
3502
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
3503
3503
|
|
|
3504
3504
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -3990,7 +3990,7 @@ cdef class _KSlicer_Matrix1_vine_f64:
|
|
|
3990
3990
|
filtration_array = np.asarray(filtration_array, dtype= np.float64)
|
|
3991
3991
|
cdef double[:,:] arr_view = filtration_array
|
|
3992
3992
|
cdef int size = arr_view.shape[0]
|
|
3993
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
3993
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
3994
3994
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
3995
3995
|
|
|
3996
3996
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -4472,7 +4472,7 @@ cdef class _Slicer_Matrix0_vine_i32:
|
|
|
4472
4472
|
filtration_array = np.asarray(filtration_array, dtype= np.int32)
|
|
4473
4473
|
cdef int32_t[:,:] arr_view = filtration_array
|
|
4474
4474
|
cdef int size = arr_view.shape[0]
|
|
4475
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
4475
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
4476
4476
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
4477
4477
|
|
|
4478
4478
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -4976,7 +4976,7 @@ cdef class _Slicer_Matrix1_vine_i32:
|
|
|
4976
4976
|
filtration_array = np.asarray(filtration_array, dtype= np.int32)
|
|
4977
4977
|
cdef int32_t[:,:] arr_view = filtration_array
|
|
4978
4978
|
cdef int size = arr_view.shape[0]
|
|
4979
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
4979
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
4980
4980
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
4981
4981
|
|
|
4982
4982
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -5480,7 +5480,7 @@ cdef class _Slicer_Matrix0_vine_i64:
|
|
|
5480
5480
|
filtration_array = np.asarray(filtration_array, dtype= np.int64)
|
|
5481
5481
|
cdef int64_t[:,:] arr_view = filtration_array
|
|
5482
5482
|
cdef int size = arr_view.shape[0]
|
|
5483
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
5483
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
5484
5484
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
5485
5485
|
|
|
5486
5486
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -5984,7 +5984,7 @@ cdef class _Slicer_Matrix1_vine_i64:
|
|
|
5984
5984
|
filtration_array = np.asarray(filtration_array, dtype= np.int64)
|
|
5985
5985
|
cdef int64_t[:,:] arr_view = filtration_array
|
|
5986
5986
|
cdef int size = arr_view.shape[0]
|
|
5987
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
5987
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
5988
5988
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
5989
5989
|
|
|
5990
5990
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -6489,7 +6489,7 @@ cdef class _Slicer_Matrix0_vine_f32:
|
|
|
6489
6489
|
filtration_array = np.asarray(filtration_array, dtype= np.float32)
|
|
6490
6490
|
cdef float[:,:] arr_view = filtration_array
|
|
6491
6491
|
cdef int size = arr_view.shape[0]
|
|
6492
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
6492
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
6493
6493
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
6494
6494
|
|
|
6495
6495
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -6994,7 +6994,7 @@ cdef class _Slicer_Matrix1_vine_f32:
|
|
|
6994
6994
|
filtration_array = np.asarray(filtration_array, dtype= np.float32)
|
|
6995
6995
|
cdef float[:,:] arr_view = filtration_array
|
|
6996
6996
|
cdef int size = arr_view.shape[0]
|
|
6997
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
6997
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
6998
6998
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
6999
6999
|
|
|
7000
7000
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -7499,7 +7499,7 @@ cdef class _Slicer_Matrix0_vine_f64:
|
|
|
7499
7499
|
filtration_array = np.asarray(filtration_array, dtype= np.float64)
|
|
7500
7500
|
cdef double[:,:] arr_view = filtration_array
|
|
7501
7501
|
cdef int size = arr_view.shape[0]
|
|
7502
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
7502
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
7503
7503
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
7504
7504
|
|
|
7505
7505
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -8004,7 +8004,7 @@ cdef class _Slicer_Matrix1_vine_f64:
|
|
|
8004
8004
|
filtration_array = np.asarray(filtration_array, dtype= np.float64)
|
|
8005
8005
|
cdef double[:,:] arr_view = filtration_array
|
|
8006
8006
|
cdef int size = arr_view.shape[0]
|
|
8007
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
8007
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
8008
8008
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
8009
8009
|
|
|
8010
8010
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -8517,7 +8517,7 @@ cdef class _KSlicer_Matrix0_i32:
|
|
|
8517
8517
|
filtration_array = np.asarray(filtration_array, dtype= np.int32)
|
|
8518
8518
|
cdef int32_t[:,:] arr_view = filtration_array
|
|
8519
8519
|
cdef int size = arr_view.shape[0]
|
|
8520
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
8520
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
8521
8521
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
8522
8522
|
|
|
8523
8523
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -8990,7 +8990,7 @@ cdef class _KSlicer_Matrix1_i32:
|
|
|
8990
8990
|
filtration_array = np.asarray(filtration_array, dtype= np.int32)
|
|
8991
8991
|
cdef int32_t[:,:] arr_view = filtration_array
|
|
8992
8992
|
cdef int size = arr_view.shape[0]
|
|
8993
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
8993
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
8994
8994
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
8995
8995
|
|
|
8996
8996
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -9463,7 +9463,7 @@ cdef class _KSlicer_Matrix0_i64:
|
|
|
9463
9463
|
filtration_array = np.asarray(filtration_array, dtype= np.int64)
|
|
9464
9464
|
cdef int64_t[:,:] arr_view = filtration_array
|
|
9465
9465
|
cdef int size = arr_view.shape[0]
|
|
9466
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
9466
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
9467
9467
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
9468
9468
|
|
|
9469
9469
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -9936,7 +9936,7 @@ cdef class _KSlicer_Matrix1_i64:
|
|
|
9936
9936
|
filtration_array = np.asarray(filtration_array, dtype= np.int64)
|
|
9937
9937
|
cdef int64_t[:,:] arr_view = filtration_array
|
|
9938
9938
|
cdef int size = arr_view.shape[0]
|
|
9939
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
9939
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
9940
9940
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
9941
9941
|
|
|
9942
9942
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -10410,7 +10410,7 @@ cdef class _KSlicer_Matrix0_f32:
|
|
|
10410
10410
|
filtration_array = np.asarray(filtration_array, dtype= np.float32)
|
|
10411
10411
|
cdef float[:,:] arr_view = filtration_array
|
|
10412
10412
|
cdef int size = arr_view.shape[0]
|
|
10413
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
10413
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
10414
10414
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
10415
10415
|
|
|
10416
10416
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -10884,7 +10884,7 @@ cdef class _KSlicer_Matrix1_f32:
|
|
|
10884
10884
|
filtration_array = np.asarray(filtration_array, dtype= np.float32)
|
|
10885
10885
|
cdef float[:,:] arr_view = filtration_array
|
|
10886
10886
|
cdef int size = arr_view.shape[0]
|
|
10887
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
10887
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
10888
10888
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
10889
10889
|
|
|
10890
10890
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -11358,7 +11358,7 @@ cdef class _KSlicer_Matrix0_f64:
|
|
|
11358
11358
|
filtration_array = np.asarray(filtration_array, dtype= np.float64)
|
|
11359
11359
|
cdef double[:,:] arr_view = filtration_array
|
|
11360
11360
|
cdef int size = arr_view.shape[0]
|
|
11361
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
11361
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
11362
11362
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
11363
11363
|
|
|
11364
11364
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -11832,7 +11832,7 @@ cdef class _KSlicer_Matrix1_f64:
|
|
|
11832
11832
|
filtration_array = np.asarray(filtration_array, dtype= np.float64)
|
|
11833
11833
|
cdef double[:,:] arr_view = filtration_array
|
|
11834
11834
|
cdef int size = arr_view.shape[0]
|
|
11835
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
11835
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
11836
11836
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
11837
11837
|
|
|
11838
11838
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -12296,7 +12296,7 @@ cdef class _Slicer_Matrix0_i32:
|
|
|
12296
12296
|
filtration_array = np.asarray(filtration_array, dtype= np.int32)
|
|
12297
12297
|
cdef int32_t[:,:] arr_view = filtration_array
|
|
12298
12298
|
cdef int size = arr_view.shape[0]
|
|
12299
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
12299
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
12300
12300
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
12301
12301
|
|
|
12302
12302
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -12782,7 +12782,7 @@ cdef class _Slicer_Matrix1_i32:
|
|
|
12782
12782
|
filtration_array = np.asarray(filtration_array, dtype= np.int32)
|
|
12783
12783
|
cdef int32_t[:,:] arr_view = filtration_array
|
|
12784
12784
|
cdef int size = arr_view.shape[0]
|
|
12785
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
12785
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
12786
12786
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
12787
12787
|
|
|
12788
12788
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -13268,7 +13268,7 @@ cdef class _Slicer_Matrix0_i64:
|
|
|
13268
13268
|
filtration_array = np.asarray(filtration_array, dtype= np.int64)
|
|
13269
13269
|
cdef int64_t[:,:] arr_view = filtration_array
|
|
13270
13270
|
cdef int size = arr_view.shape[0]
|
|
13271
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
13271
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
13272
13272
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
13273
13273
|
|
|
13274
13274
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -13754,7 +13754,7 @@ cdef class _Slicer_Matrix1_i64:
|
|
|
13754
13754
|
filtration_array = np.asarray(filtration_array, dtype= np.int64)
|
|
13755
13755
|
cdef int64_t[:,:] arr_view = filtration_array
|
|
13756
13756
|
cdef int size = arr_view.shape[0]
|
|
13757
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
13757
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
13758
13758
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
13759
13759
|
|
|
13760
13760
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -14241,7 +14241,7 @@ cdef class _Slicer_Matrix0_f32:
|
|
|
14241
14241
|
filtration_array = np.asarray(filtration_array, dtype= np.float32)
|
|
14242
14242
|
cdef float[:,:] arr_view = filtration_array
|
|
14243
14243
|
cdef int size = arr_view.shape[0]
|
|
14244
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
14244
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
14245
14245
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
14246
14246
|
|
|
14247
14247
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -14728,7 +14728,7 @@ cdef class _Slicer_Matrix1_f32:
|
|
|
14728
14728
|
filtration_array = np.asarray(filtration_array, dtype= np.float32)
|
|
14729
14729
|
cdef float[:,:] arr_view = filtration_array
|
|
14730
14730
|
cdef int size = arr_view.shape[0]
|
|
14731
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
14731
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
14732
14732
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
14733
14733
|
|
|
14734
14734
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -15215,7 +15215,7 @@ cdef class _Slicer_Matrix0_f64:
|
|
|
15215
15215
|
filtration_array = np.asarray(filtration_array, dtype= np.float64)
|
|
15216
15216
|
cdef double[:,:] arr_view = filtration_array
|
|
15217
15217
|
cdef int size = arr_view.shape[0]
|
|
15218
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
15218
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
15219
15219
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
15220
15220
|
|
|
15221
15221
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -15702,7 +15702,7 @@ cdef class _Slicer_Matrix1_f64:
|
|
|
15702
15702
|
filtration_array = np.asarray(filtration_array, dtype= np.float64)
|
|
15703
15703
|
cdef double[:,:] arr_view = filtration_array
|
|
15704
15704
|
cdef int size = arr_view.shape[0]
|
|
15705
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
15705
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
15706
15706
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
15707
15707
|
|
|
15708
15708
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -16197,7 +16197,7 @@ cdef class _KSlicer_GudhiCohomology0_i32:
|
|
|
16197
16197
|
filtration_array = np.asarray(filtration_array, dtype= np.int32)
|
|
16198
16198
|
cdef int32_t[:,:] arr_view = filtration_array
|
|
16199
16199
|
cdef int size = arr_view.shape[0]
|
|
16200
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
16200
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
16201
16201
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
16202
16202
|
|
|
16203
16203
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -16670,7 +16670,7 @@ cdef class _KSlicer_GudhiCohomology0_i64:
|
|
|
16670
16670
|
filtration_array = np.asarray(filtration_array, dtype= np.int64)
|
|
16671
16671
|
cdef int64_t[:,:] arr_view = filtration_array
|
|
16672
16672
|
cdef int size = arr_view.shape[0]
|
|
16673
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
16673
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
16674
16674
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
16675
16675
|
|
|
16676
16676
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -17144,7 +17144,7 @@ cdef class _KSlicer_GudhiCohomology0_f32:
|
|
|
17144
17144
|
filtration_array = np.asarray(filtration_array, dtype= np.float32)
|
|
17145
17145
|
cdef float[:,:] arr_view = filtration_array
|
|
17146
17146
|
cdef int size = arr_view.shape[0]
|
|
17147
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
17147
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
17148
17148
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
17149
17149
|
|
|
17150
17150
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -17618,7 +17618,7 @@ cdef class _KSlicer_GudhiCohomology0_f64:
|
|
|
17618
17618
|
filtration_array = np.asarray(filtration_array, dtype= np.float64)
|
|
17619
17619
|
cdef double[:,:] arr_view = filtration_array
|
|
17620
17620
|
cdef int size = arr_view.shape[0]
|
|
17621
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
17621
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
17622
17622
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
17623
17623
|
|
|
17624
17624
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -18082,7 +18082,7 @@ cdef class _Slicer_GudhiCohomology0_i32:
|
|
|
18082
18082
|
filtration_array = np.asarray(filtration_array, dtype= np.int32)
|
|
18083
18083
|
cdef int32_t[:,:] arr_view = filtration_array
|
|
18084
18084
|
cdef int size = arr_view.shape[0]
|
|
18085
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
18085
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
18086
18086
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
18087
18087
|
|
|
18088
18088
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -18568,7 +18568,7 @@ cdef class _Slicer_GudhiCohomology0_i64:
|
|
|
18568
18568
|
filtration_array = np.asarray(filtration_array, dtype= np.int64)
|
|
18569
18569
|
cdef int64_t[:,:] arr_view = filtration_array
|
|
18570
18570
|
cdef int size = arr_view.shape[0]
|
|
18571
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
18571
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
18572
18572
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
18573
18573
|
|
|
18574
18574
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -19055,7 +19055,7 @@ cdef class _Slicer_GudhiCohomology0_f32:
|
|
|
19055
19055
|
filtration_array = np.asarray(filtration_array, dtype= np.float32)
|
|
19056
19056
|
cdef float[:,:] arr_view = filtration_array
|
|
19057
19057
|
cdef int size = arr_view.shape[0]
|
|
19058
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
19058
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
19059
19059
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
19060
19060
|
|
|
19061
19061
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -19542,7 +19542,7 @@ cdef class _Slicer_GudhiCohomology0_f64:
|
|
|
19542
19542
|
filtration_array = np.asarray(filtration_array, dtype= np.float64)
|
|
19543
19543
|
cdef double[:,:] arr_view = filtration_array
|
|
19544
19544
|
cdef int size = arr_view.shape[0]
|
|
19545
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
19545
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
19546
19546
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
19547
19547
|
|
|
19548
19548
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -19876,7 +19876,7 @@ cdef extern from "gudhi/cubical_to_boundary.h" namespace "":
|
|
|
19876
19876
|
void _to_boundary(const vector[unsigned int]&, vector[vector[unsigned int]]&, vector[int]&) except + nogil
|
|
19877
19877
|
void get_vertices(unsigned int, cset[unsigned int]&, const vector[vector[unsigned int]]&) nogil
|
|
19878
19878
|
|
|
19879
|
-
def
|
|
19879
|
+
def _from_bitmapf32(image, **slicer_kwargs):
|
|
19880
19880
|
from multipers import Slicer
|
|
19881
19881
|
dtype = slicer_kwargs.get("dtype", image.dtype)
|
|
19882
19882
|
slicer_kwargs["dtype"] = dtype
|
|
@@ -19894,9 +19894,9 @@ def _from_bitmapi64(image, **slicer_kwargs):
|
|
|
19894
19894
|
cdef cset[unsigned int] vertices
|
|
19895
19895
|
|
|
19896
19896
|
cdef unsigned int num_gens = gen_dims.size()
|
|
19897
|
-
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.
|
|
19898
|
-
cdef
|
|
19899
|
-
cdef
|
|
19897
|
+
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.float32) - _Slicer._inf_value()
|
|
19898
|
+
cdef float[:,:] F = filtration_values
|
|
19899
|
+
cdef float[:,:] c_img = image.reshape(-1,num_parameters)
|
|
19900
19900
|
with nogil:
|
|
19901
19901
|
for i in range(num_gens):
|
|
19902
19902
|
# with gil:
|
|
@@ -19914,7 +19914,7 @@ def _from_bitmapi64(image, **slicer_kwargs):
|
|
|
19914
19914
|
# print(f"F = {np.asarray(F[i])}")
|
|
19915
19915
|
slicer = _Slicer(gen_maps, gen_dims, filtration_values)
|
|
19916
19916
|
return slicer
|
|
19917
|
-
def
|
|
19917
|
+
def _from_bitmapi32(image, **slicer_kwargs):
|
|
19918
19918
|
from multipers import Slicer
|
|
19919
19919
|
dtype = slicer_kwargs.get("dtype", image.dtype)
|
|
19920
19920
|
slicer_kwargs["dtype"] = dtype
|
|
@@ -19932,9 +19932,9 @@ def _from_bitmapf64(image, **slicer_kwargs):
|
|
|
19932
19932
|
cdef cset[unsigned int] vertices
|
|
19933
19933
|
|
|
19934
19934
|
cdef unsigned int num_gens = gen_dims.size()
|
|
19935
|
-
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.
|
|
19936
|
-
cdef
|
|
19937
|
-
cdef
|
|
19935
|
+
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.int32) - _Slicer._inf_value()
|
|
19936
|
+
cdef int32_t[:,:] F = filtration_values
|
|
19937
|
+
cdef int32_t[:,:] c_img = image.reshape(-1,num_parameters)
|
|
19938
19938
|
with nogil:
|
|
19939
19939
|
for i in range(num_gens):
|
|
19940
19940
|
# with gil:
|
|
@@ -19952,7 +19952,7 @@ def _from_bitmapf64(image, **slicer_kwargs):
|
|
|
19952
19952
|
# print(f"F = {np.asarray(F[i])}")
|
|
19953
19953
|
slicer = _Slicer(gen_maps, gen_dims, filtration_values)
|
|
19954
19954
|
return slicer
|
|
19955
|
-
def
|
|
19955
|
+
def _from_bitmapf64(image, **slicer_kwargs):
|
|
19956
19956
|
from multipers import Slicer
|
|
19957
19957
|
dtype = slicer_kwargs.get("dtype", image.dtype)
|
|
19958
19958
|
slicer_kwargs["dtype"] = dtype
|
|
@@ -19970,9 +19970,9 @@ def _from_bitmapf32(image, **slicer_kwargs):
|
|
|
19970
19970
|
cdef cset[unsigned int] vertices
|
|
19971
19971
|
|
|
19972
19972
|
cdef unsigned int num_gens = gen_dims.size()
|
|
19973
|
-
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.
|
|
19974
|
-
cdef
|
|
19975
|
-
cdef
|
|
19973
|
+
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.float64) - _Slicer._inf_value()
|
|
19974
|
+
cdef double[:,:] F = filtration_values
|
|
19975
|
+
cdef double[:,:] c_img = image.reshape(-1,num_parameters)
|
|
19976
19976
|
with nogil:
|
|
19977
19977
|
for i in range(num_gens):
|
|
19978
19978
|
# with gil:
|
|
@@ -19990,7 +19990,7 @@ def _from_bitmapf32(image, **slicer_kwargs):
|
|
|
19990
19990
|
# print(f"F = {np.asarray(F[i])}")
|
|
19991
19991
|
slicer = _Slicer(gen_maps, gen_dims, filtration_values)
|
|
19992
19992
|
return slicer
|
|
19993
|
-
def
|
|
19993
|
+
def _from_bitmapi64(image, **slicer_kwargs):
|
|
19994
19994
|
from multipers import Slicer
|
|
19995
19995
|
dtype = slicer_kwargs.get("dtype", image.dtype)
|
|
19996
19996
|
slicer_kwargs["dtype"] = dtype
|
|
@@ -20008,9 +20008,9 @@ def _from_bitmapi32(image, **slicer_kwargs):
|
|
|
20008
20008
|
cdef cset[unsigned int] vertices
|
|
20009
20009
|
|
|
20010
20010
|
cdef unsigned int num_gens = gen_dims.size()
|
|
20011
|
-
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.
|
|
20012
|
-
cdef
|
|
20013
|
-
cdef
|
|
20011
|
+
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.int64) - _Slicer._inf_value()
|
|
20012
|
+
cdef int64_t[:,:] F = filtration_values
|
|
20013
|
+
cdef int64_t[:,:] c_img = image.reshape(-1,num_parameters)
|
|
20014
20014
|
with nogil:
|
|
20015
20015
|
for i in range(num_gens):
|
|
20016
20016
|
# with gil:
|
|
@@ -20031,14 +20031,14 @@ def _from_bitmapi32(image, **slicer_kwargs):
|
|
|
20031
20031
|
|
|
20032
20032
|
def from_bitmap(img, **kwargs):
|
|
20033
20033
|
img = np.asarray(img)
|
|
20034
|
-
if img.dtype == np.int64:
|
|
20035
|
-
return _from_bitmapi64(img, **kwargs)
|
|
20036
|
-
if img.dtype == np.float64:
|
|
20037
|
-
return _from_bitmapf64(img, **kwargs)
|
|
20038
20034
|
if img.dtype == np.float32:
|
|
20039
20035
|
return _from_bitmapf32(img, **kwargs)
|
|
20040
20036
|
if img.dtype == np.int32:
|
|
20041
20037
|
return _from_bitmapi32(img, **kwargs)
|
|
20038
|
+
if img.dtype == np.float64:
|
|
20039
|
+
return _from_bitmapf64(img, **kwargs)
|
|
20040
|
+
if img.dtype == np.int64:
|
|
20041
|
+
return _from_bitmapi64(img, **kwargs)
|
|
20042
20042
|
raise ValueError(f"Invalid dtype. Got {img.dtype=}, was expecting {available_dtype=}.")
|
|
20043
20043
|
|
|
20044
20044
|
def from_function_delaunay(
|
|
@@ -20067,6 +20067,7 @@ def from_function_delaunay(
|
|
|
20067
20067
|
function_delaunay_presentation_to_slicer(s, points, grades, degree=degree, verbose=verbose,clear=clear)
|
|
20068
20068
|
if degree >= 0:
|
|
20069
20069
|
s.minpres_degree = degree
|
|
20070
|
+
# s = s.minpres(degree=degree, force=True)
|
|
20070
20071
|
return s
|
|
20071
20072
|
|
|
20072
20073
|
def slicer2blocks(slicer, int degree = -1, bool reverse=True):
|
multipers/slicer.pyx.tp
CHANGED
|
@@ -342,7 +342,7 @@ cdef class {{D['PYTHON_TYPE']}}:
|
|
|
342
342
|
filtration_array = np.asarray(filtration_array, dtype= {{D['PY_VALUE_TYPE']}})
|
|
343
343
|
cdef {{D['C_VALUE_TYPE']}}[:,:] arr_view = filtration_array
|
|
344
344
|
cdef int size = arr_view.shape[0]
|
|
345
|
-
if arr_view.shape[1] != self.truc.num_generators():
|
|
345
|
+
if <int>arr_view.shape[1] != <int>self.truc.num_generators():
|
|
346
346
|
raise ValueError(f"Got filtration array of shape {filtration_array.shape=} / {arr_view.shape=}. Was expecting (-1, {len(self)=})")
|
|
347
347
|
|
|
348
348
|
return tuple(tuple(np.array(bc_idx_degree, dtype=int) for bc_idx_degree in bc_idx) for bc_idx in self.truc.custom_persistences(&arr_view[0,0], size, ignore_inf))
|
|
@@ -785,6 +785,7 @@ def from_function_delaunay(
|
|
|
785
785
|
function_delaunay_presentation_to_slicer(s, points, grades, degree=degree, verbose=verbose,clear=clear)
|
|
786
786
|
if degree >= 0:
|
|
787
787
|
s.minpres_degree = degree
|
|
788
|
+
# s = s.minpres(degree=degree, force=True)
|
|
788
789
|
return s
|
|
789
790
|
|
|
790
791
|
def slicer2blocks(slicer, int degree = -1, bool reverse=True):
|
multipers/tbb12.dll
CHANGED
|
Binary file
|
multipers/tbbbind_2_5.dll
CHANGED
|
Binary file
|
multipers/tbbmalloc.dll
CHANGED
|
Binary file
|
multipers/tbbmalloc_proxy.dll
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: multipers
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.3b6
|
|
4
4
|
Summary: Multiparameter Topological Persistence for Machine Learning
|
|
5
5
|
Author-email: David Loiseaux <david.lapous@proton.me>, Hannah Schreiber <hannah.schreiber@inria.fr>
|
|
6
6
|
Maintainer-email: David Loiseaux <david.lapous@proton.me>
|
|
@@ -5,41 +5,41 @@ multipers/distances.py,sha256=uAZj2GtUQp50OxN2qU7sl2JqsmJ74IG9j5tZapLO2Us,6220
|
|
|
5
5
|
multipers/filtration_conversions.pxd,sha256=Je7a3F4zS1PQn6Ul1YCXgA6p39X2FouStru-XtN-aOw,10800
|
|
6
6
|
multipers/filtration_conversions.pxd.tp,sha256=_9tUvZVUA7J_RUM3q7BxY48fYgDHCUA7Xhy4nBfLLs0,3309
|
|
7
7
|
multipers/filtrations.pxd,sha256=08ONkZNCjs8Nme8lcD9myPz-K662sA-EDpSwzgC2_ts,9461
|
|
8
|
-
multipers/function_rips.cp311-win_amd64.pyd,sha256=
|
|
8
|
+
multipers/function_rips.cp311-win_amd64.pyd,sha256=vN2KIt05lpx99Dbjak3QNZn_iN6do86XwjWWV9BWB0s,329216
|
|
9
9
|
multipers/function_rips.pyx,sha256=j5NjbK3YrAv_2s8YHB1JB0k6m9NC7RQCSFlJe-w_kgE,5252
|
|
10
|
-
multipers/grids.cp311-win_amd64.pyd,sha256=
|
|
10
|
+
multipers/grids.cp311-win_amd64.pyd,sha256=dNAPlIcVfLN4qnmwZBctaWcuGA5B5qOgu1hngmJ3Fw8,483328
|
|
11
11
|
multipers/grids.pyx,sha256=ONN_RKkuxqwb9IaS9gd42FUGaiBLc8QWcd3L-ubZjKE,16575
|
|
12
|
-
multipers/io.cp311-win_amd64.pyd,sha256
|
|
12
|
+
multipers/io.cp311-win_amd64.pyd,sha256=v1N4VOxj1IwCEAmrCTBbQRkfph18IarZx-nvHCCU6fc,223232
|
|
13
13
|
multipers/io.pyx,sha256=pQBH_rSqaCZqDSxTLnhlyECP3fLbX2tR_RKJHydHm_0,22210
|
|
14
|
-
multipers/mma_structures.cp311-win_amd64.pyd,sha256=
|
|
14
|
+
multipers/mma_structures.cp311-win_amd64.pyd,sha256=FTtKZ1LXPBBelPKfoBFdpODPQFbWScKjshU9UpGlWXY,1325056
|
|
15
15
|
multipers/mma_structures.pxd,sha256=jh1QnQRidt_VK0CK7losQi6rAl_1qG5DNuR23J42pUA,6595
|
|
16
16
|
multipers/mma_structures.pyx,sha256=4zNC6ePfFKMvx0MrH-FqJVouyTMciRc49oevKDnsJhI,109530
|
|
17
17
|
multipers/mma_structures.pyx.tp,sha256=hWuuk9USDFa8CbQVRHNjWSAdGgpkWKvSCNjTtVuSzwM,42299
|
|
18
18
|
multipers/multiparameter_edge_collapse.py,sha256=MFt0eKQQSv2354omeIqOmzASYTKIMsYdxZHFZauQr8g,1229
|
|
19
|
-
multipers/multiparameter_module_approximation.cp311-win_amd64.pyd,sha256=
|
|
19
|
+
multipers/multiparameter_module_approximation.cp311-win_amd64.pyd,sha256=sbeu0XWTVUqFfShhxwINIzblJ07F2pLUcy-dh4EmgFQ,446976
|
|
20
20
|
multipers/multiparameter_module_approximation.pyx,sha256=wp7la7Z9wBngnfw6WOVddf93mPyXf4HfNT6dKW2Z0r0,9030
|
|
21
21
|
multipers/pickle.py,sha256=YYVt4iHiD16E1x5Yn_4mX6P5P8rKi56pNGjJo5IzPhc,2579
|
|
22
|
-
multipers/plots.py,sha256
|
|
23
|
-
multipers/point_measure.cp311-win_amd64.pyd,sha256=
|
|
22
|
+
multipers/plots.py,sha256=-yOaufE_flzrZDQIgwhchvJIo0MBJMrUJKuo_sKG6IM,14918
|
|
23
|
+
multipers/point_measure.cp311-win_amd64.pyd,sha256=vqIF_dM-br7ycheOjfySiJjtLrY1_1RkGpWbV1IKIu0,621056
|
|
24
24
|
multipers/point_measure.pyx,sha256=ovpyvjMdOPBOK_0TT0VoK4b2t8m5InFdKmRBB6biTts,14077
|
|
25
|
-
multipers/simplex_tree_multi.cp311-win_amd64.pyd,sha256=
|
|
25
|
+
multipers/simplex_tree_multi.cp311-win_amd64.pyd,sha256=Js-J8uJJpNUKrHvRDCUHm7uxKpq79Pneg7MwXlrtZMM,3756032
|
|
26
26
|
multipers/simplex_tree_multi.pxd,sha256=KpyDEQNPoMC2sOU9-d4LtrGXx_UVCJGxMJ1kk1AzHgU,6631
|
|
27
|
-
multipers/simplex_tree_multi.pyx,sha256=
|
|
28
|
-
multipers/simplex_tree_multi.pyx.tp,sha256=
|
|
29
|
-
multipers/slicer.cp311-win_amd64.pyd,sha256=
|
|
30
|
-
multipers/slicer.pxd,sha256=
|
|
27
|
+
multipers/simplex_tree_multi.pyx,sha256=13x2WFMExcukd_2CrLOJa3Edex3WNqaSSrGBmPhYoDM,499100
|
|
28
|
+
multipers/simplex_tree_multi.pyx.tp,sha256=YFzVUJPWNOOpRiyOgaYlFR_DJ_57rAQLsOp2W0l71_s,89318
|
|
29
|
+
multipers/slicer.cp311-win_amd64.pyd,sha256=HgeOEAmEK-GxhNupc08jpvuTR7aw8dzTLepbspSmT6M,11618816
|
|
30
|
+
multipers/slicer.pxd,sha256=fzA-lL_QWyUMf9rRSpcKG35QNS9UXEmVC9r7kR0geho,185230
|
|
31
31
|
multipers/slicer.pxd.tp,sha256=fLOUPtPGqiY9o1fPDyc_whBrgKLh_6HVfvl7OtE-34Y,10243
|
|
32
|
-
multipers/slicer.pyx,sha256=
|
|
33
|
-
multipers/slicer.pyx.tp,sha256=
|
|
34
|
-
multipers/tbb12.dll,sha256=
|
|
35
|
-
multipers/tbbbind_2_5.dll,sha256=
|
|
36
|
-
multipers/tbbmalloc.dll,sha256=
|
|
37
|
-
multipers/tbbmalloc_proxy.dll,sha256=
|
|
32
|
+
multipers/slicer.pyx,sha256=xZngjWgxvIYXwPkoOiOXOtYZ0ABHetY8gShjYrfjbTY,894493
|
|
33
|
+
multipers/slicer.pyx.tp,sha256=GCL7xUZccfmnIoY4bk05L5ODkSNzEzXgodp0VkH-xT8,44584
|
|
34
|
+
multipers/tbb12.dll,sha256=flSoIAkNVECA5vNkh5jLn1jcZNxTw3yb2tuTtxn6oEE,344576
|
|
35
|
+
multipers/tbbbind_2_5.dll,sha256=4JWlgl4aJJ3m5NIE85AgQi46REU3UkIJwNsKnh9aK_c,23552
|
|
36
|
+
multipers/tbbmalloc.dll,sha256=r9y_3nR6Rpc68g1F7Oci8EpunjWIJQU-zjLIVXc9SDY,113664
|
|
37
|
+
multipers/tbbmalloc_proxy.dll,sha256=5vcuiOpM9KTAY7daWxCsAc2MU_l8K3TWpw0kz-Xh0sk,30720
|
|
38
38
|
multipers/tensor.pxd,sha256=MSmaMU0sOP9CHLmg4dym7nOGaI1S4cOdM01TQ9flI54,417
|
|
39
39
|
multipers/test.pyx,sha256=-g7WU-jKrZK8H0c-6eAPsfrApjvTKrUoswVYFu8LoV4,1798
|
|
40
40
|
multipers/array_api/__init__.py,sha256=072Lk60jfw3re6iCY3EorteHEoQ7vbUgpMpuGCpfh04,1109
|
|
41
|
-
multipers/array_api/numpy.py,sha256=
|
|
42
|
-
multipers/array_api/torch.py,sha256=
|
|
41
|
+
multipers/array_api/numpy.py,sha256=1l9zL3jP8xhKYpXRjGzhHw4DP_tGdMQ3WRS8Tcmf3xc,816
|
|
42
|
+
multipers/array_api/torch.py,sha256=o8ekBau6G46LHd8-b_cWu_vPWIBiTfE4Dz5UL0xWwxY,1257
|
|
43
43
|
multipers/data/MOL2.py,sha256=nLZHy2OSFN9Z2uJKsbqWOEG2R7G-uH6dCLHG48UjvR4,15428
|
|
44
44
|
multipers/data/UCR.py,sha256=PuT8l3i26y0goBzIESwdgJAe6YFCyDiWSoxECcP5rhs,798
|
|
45
45
|
multipers/data/__init__.py,sha256=w7uUe4LOHbdbKU4R8MNs7em65wZJN0v5ukoG1otFanQ,24
|
|
@@ -51,7 +51,7 @@ multipers/data/shape3d.py,sha256=AE-vvjKrhKxOwMo-lurUsFqqLjIg5obo-RTbRZF_5Mk,389
|
|
|
51
51
|
multipers/data/synthetic.py,sha256=RvLWIBE5j99kJSt-D7cnPGI3c7skD4p8_qofJbMIXM0,3078
|
|
52
52
|
multipers/filtrations/__init__.py,sha256=Lg0EHe2cxT32UQAg0kr_Vpua-xPBZxGol8VIfz8UwWk,319
|
|
53
53
|
multipers/filtrations/density.py,sha256=z_QwAi_5EdUoKXc6s7N-qWM7n6r5hWHiHeJkLPWhE-w,19818
|
|
54
|
-
multipers/filtrations/filtrations.py,sha256=
|
|
54
|
+
multipers/filtrations/filtrations.py,sha256=r3WS4GMBvcJ0ryIMbNHFgep0FCtl3h404V_SbMM8hN0,13333
|
|
55
55
|
multipers/gudhi/Persistence_slices_interface.h,sha256=QnUeCCKi9K8CfqI3W5i3Ra1Jy2Z1IIivr3MIpnBsnYU,6562
|
|
56
56
|
multipers/gudhi/Simplex_tree_interface.h,sha256=kkq8pE3jKGLY1dK7sYpb_uERHaWGurrRXfaw_ygs-mY,10217
|
|
57
57
|
multipers/gudhi/Simplex_tree_multi_interface.h,sha256=7D9EqyO9dgi-VMTf-O8SR2UMQL95q_TL9ApmmN4ggFw,25484
|
|
@@ -178,8 +178,8 @@ multipers/tests/__init__.py,sha256=-7Fj-zFAfBJv18trg0CPglQTmYu_ehySZGqtJzPlN8U,1
|
|
|
178
178
|
multipers/torch/__init__.py,sha256=OLxIiZ389uCqehpUxBPUI_x1SYu531onc4tiTscAuIw,27
|
|
179
179
|
multipers/torch/diff_grids.py,sha256=2YK-c351tBpj8sfzjf26fbE1l0xlWse7oVVfDHD3zwM,7492
|
|
180
180
|
multipers/torch/rips_density.py,sha256=H-kmSzY8hXhmVn15Oltc71DHs1IUHg5oPRgNyWW8L4Q,11706
|
|
181
|
-
multipers-2.3.
|
|
182
|
-
multipers-2.3.
|
|
183
|
-
multipers-2.3.
|
|
184
|
-
multipers-2.3.
|
|
185
|
-
multipers-2.3.
|
|
181
|
+
multipers-2.3.3b6.dist-info/licenses/LICENSE,sha256=UsQRnvlo_9wpQS9DNt52GEraERHwK2GIRwuqr2Yv5JI,1071
|
|
182
|
+
multipers-2.3.3b6.dist-info/METADATA,sha256=0zSGxpVm4912cviaU4-M6i-GMYDdQtoDLr25L35Xq6I,9817
|
|
183
|
+
multipers-2.3.3b6.dist-info/WHEEL,sha256=JLOMsP7F5qtkAkINx5UnzbFguf8CqZeraV8o04b0I8I,101
|
|
184
|
+
multipers-2.3.3b6.dist-info/top_level.txt,sha256=L9e0AGmhRzrNw9FpuUx-zlqi5NcBOmrI9wYY8kYWr8A,10
|
|
185
|
+
multipers-2.3.3b6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|