multipers 2.3.0__cp312-cp312-win_amd64.whl → 2.3.1__cp312-cp312-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/{ml/convolutions.py → filtrations/density.py} +45 -2
- multipers/filtrations/filtrations.py +2 -2
- multipers/function_rips.cp312-win_amd64.pyd +0 -0
- multipers/grids.cp312-win_amd64.pyd +0 -0
- multipers/gudhi/Simplex_tree_multi_interface.h +1 -1
- multipers/gudhi/gudhi/One_critical_filtration.h +2 -1
- multipers/gudhi/mma_interface_h0.h +1 -1
- multipers/gudhi/mma_interface_matrix.h +8 -1
- multipers/gudhi/naive_merge_tree.h +1 -1
- multipers/gudhi/truc.h +82 -15
- multipers/io.cp312-win_amd64.pyd +0 -0
- multipers/io.pyx +14 -11
- multipers/ml/point_clouds.py +2 -2
- multipers/ml/signed_measures.py +3 -3
- multipers/mma_structures.cp312-win_amd64.pyd +0 -0
- multipers/mma_structures.pyx +0 -4
- multipers/mma_structures.pyx.tp +0 -2
- multipers/multiparameter_module_approximation/approximation.h +4 -2
- multipers/multiparameter_module_approximation.cp312-win_amd64.pyd +0 -0
- multipers/multiparameter_module_approximation.pyx +3 -1
- multipers/plots.py +1 -1
- multipers/point_measure.cp312-win_amd64.pyd +0 -0
- multipers/simplex_tree_multi.cp312-win_amd64.pyd +0 -0
- multipers/simplex_tree_multi.pyx +97 -33
- multipers/simplex_tree_multi.pyx.tp +13 -5
- multipers/slicer.cp312-win_amd64.pyd +0 -0
- multipers/slicer.pxd +200 -80
- multipers/slicer.pxd.tp +5 -2
- multipers/slicer.pyx +484 -204
- multipers/slicer.pyx.tp +16 -9
- multipers/tensor/tensor.h +1 -1
- multipers/torch/rips_density.py +1 -1
- {multipers-2.3.0.dist-info → multipers-2.3.1.dist-info}/METADATA +1 -1
- {multipers-2.3.0.dist-info → multipers-2.3.1.dist-info}/RECORD +37 -37
- {multipers-2.3.0.dist-info → multipers-2.3.1.dist-info}/WHEEL +1 -1
- {multipers-2.3.0.dist-info → multipers-2.3.1.dist-info}/LICENSE +0 -0
- {multipers-2.3.0.dist-info → multipers-2.3.1.dist-info}/top_level.txt +0 -0
multipers/slicer.pyx
CHANGED
|
@@ -448,6 +448,13 @@ cdef class _KSlicer_Matrix0_vine_i32:
|
|
|
448
448
|
self.truc = C_KSlicer_Matrix0_vine_i32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
449
449
|
self.minpres_degree = -1
|
|
450
450
|
|
|
451
|
+
def to_colexical(self)->_KSlicer_Matrix0_vine_i32:
|
|
452
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
453
|
+
new_slicer = _KSlicer_Matrix0_vine_i32()
|
|
454
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
455
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
456
|
+
return new_slicer
|
|
457
|
+
|
|
451
458
|
def copy(self)->_KSlicer_Matrix0_vine_i32:
|
|
452
459
|
"""
|
|
453
460
|
Returns a copy of the slicer.
|
|
@@ -491,7 +498,7 @@ cdef class _KSlicer_Matrix0_vine_i32:
|
|
|
491
498
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
492
499
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
493
500
|
|
|
494
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
501
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
495
502
|
"""
|
|
496
503
|
Computes the persistence on a line L defined by
|
|
497
504
|
- a basepoint (num_parameters,) array
|
|
@@ -500,7 +507,7 @@ cdef class _KSlicer_Matrix0_vine_i32:
|
|
|
500
507
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
501
508
|
"""
|
|
502
509
|
self.push_to_line(basepoint,direction)
|
|
503
|
-
self.truc.compute_persistence()
|
|
510
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
504
511
|
if keep_inf:
|
|
505
512
|
bcs = tuple(np.asarray(stuff, dtype = np.int32) for stuff in self.truc.get_barcode())
|
|
506
513
|
else:
|
|
@@ -510,7 +517,7 @@ cdef class _KSlicer_Matrix0_vine_i32:
|
|
|
510
517
|
bcs = _KSlicer_Matrix0_vine_i32._bc_to_full(bcs, basepoint, direction)
|
|
511
518
|
return bcs
|
|
512
519
|
|
|
513
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
520
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
514
521
|
"""
|
|
515
522
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
516
523
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -521,11 +528,11 @@ cdef class _KSlicer_Matrix0_vine_i32:
|
|
|
521
528
|
if directions is None:
|
|
522
529
|
c_basepoints = basepoints
|
|
523
530
|
with nogil:
|
|
524
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
531
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
525
532
|
else:
|
|
526
533
|
c_truc = zip(basepoints,directions)
|
|
527
534
|
with nogil:
|
|
528
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
535
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
529
536
|
cdef int num_bc = c_basepoints.size()
|
|
530
537
|
|
|
531
538
|
if keep_inf:
|
|
@@ -838,6 +845,13 @@ cdef class _KSlicer_Matrix1_vine_i32:
|
|
|
838
845
|
self.truc = C_KSlicer_Matrix1_vine_i32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
839
846
|
self.minpres_degree = -1
|
|
840
847
|
|
|
848
|
+
def to_colexical(self)->_KSlicer_Matrix1_vine_i32:
|
|
849
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
850
|
+
new_slicer = _KSlicer_Matrix1_vine_i32()
|
|
851
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
852
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
853
|
+
return new_slicer
|
|
854
|
+
|
|
841
855
|
def copy(self)->_KSlicer_Matrix1_vine_i32:
|
|
842
856
|
"""
|
|
843
857
|
Returns a copy of the slicer.
|
|
@@ -881,7 +895,7 @@ cdef class _KSlicer_Matrix1_vine_i32:
|
|
|
881
895
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
882
896
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
883
897
|
|
|
884
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
898
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
885
899
|
"""
|
|
886
900
|
Computes the persistence on a line L defined by
|
|
887
901
|
- a basepoint (num_parameters,) array
|
|
@@ -890,7 +904,7 @@ cdef class _KSlicer_Matrix1_vine_i32:
|
|
|
890
904
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
891
905
|
"""
|
|
892
906
|
self.push_to_line(basepoint,direction)
|
|
893
|
-
self.truc.compute_persistence()
|
|
907
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
894
908
|
if keep_inf:
|
|
895
909
|
bcs = tuple(np.asarray(stuff, dtype = np.int32) for stuff in self.truc.get_barcode())
|
|
896
910
|
else:
|
|
@@ -900,7 +914,7 @@ cdef class _KSlicer_Matrix1_vine_i32:
|
|
|
900
914
|
bcs = _KSlicer_Matrix1_vine_i32._bc_to_full(bcs, basepoint, direction)
|
|
901
915
|
return bcs
|
|
902
916
|
|
|
903
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
917
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
904
918
|
"""
|
|
905
919
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
906
920
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -911,11 +925,11 @@ cdef class _KSlicer_Matrix1_vine_i32:
|
|
|
911
925
|
if directions is None:
|
|
912
926
|
c_basepoints = basepoints
|
|
913
927
|
with nogil:
|
|
914
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
928
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
915
929
|
else:
|
|
916
930
|
c_truc = zip(basepoints,directions)
|
|
917
931
|
with nogil:
|
|
918
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
932
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
919
933
|
cdef int num_bc = c_basepoints.size()
|
|
920
934
|
|
|
921
935
|
if keep_inf:
|
|
@@ -1228,6 +1242,13 @@ cdef class _KSlicer_Matrix0_vine_i64:
|
|
|
1228
1242
|
self.truc = C_KSlicer_Matrix0_vine_i64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
1229
1243
|
self.minpres_degree = -1
|
|
1230
1244
|
|
|
1245
|
+
def to_colexical(self)->_KSlicer_Matrix0_vine_i64:
|
|
1246
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
1247
|
+
new_slicer = _KSlicer_Matrix0_vine_i64()
|
|
1248
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
1249
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
1250
|
+
return new_slicer
|
|
1251
|
+
|
|
1231
1252
|
def copy(self)->_KSlicer_Matrix0_vine_i64:
|
|
1232
1253
|
"""
|
|
1233
1254
|
Returns a copy of the slicer.
|
|
@@ -1271,7 +1292,7 @@ cdef class _KSlicer_Matrix0_vine_i64:
|
|
|
1271
1292
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
1272
1293
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
1273
1294
|
|
|
1274
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
1295
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
1275
1296
|
"""
|
|
1276
1297
|
Computes the persistence on a line L defined by
|
|
1277
1298
|
- a basepoint (num_parameters,) array
|
|
@@ -1280,7 +1301,7 @@ cdef class _KSlicer_Matrix0_vine_i64:
|
|
|
1280
1301
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
1281
1302
|
"""
|
|
1282
1303
|
self.push_to_line(basepoint,direction)
|
|
1283
|
-
self.truc.compute_persistence()
|
|
1304
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
1284
1305
|
if keep_inf:
|
|
1285
1306
|
bcs = tuple(np.asarray(stuff, dtype = np.int64) for stuff in self.truc.get_barcode())
|
|
1286
1307
|
else:
|
|
@@ -1290,7 +1311,7 @@ cdef class _KSlicer_Matrix0_vine_i64:
|
|
|
1290
1311
|
bcs = _KSlicer_Matrix0_vine_i64._bc_to_full(bcs, basepoint, direction)
|
|
1291
1312
|
return bcs
|
|
1292
1313
|
|
|
1293
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
1314
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
1294
1315
|
"""
|
|
1295
1316
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
1296
1317
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -1301,11 +1322,11 @@ cdef class _KSlicer_Matrix0_vine_i64:
|
|
|
1301
1322
|
if directions is None:
|
|
1302
1323
|
c_basepoints = basepoints
|
|
1303
1324
|
with nogil:
|
|
1304
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
1325
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
1305
1326
|
else:
|
|
1306
1327
|
c_truc = zip(basepoints,directions)
|
|
1307
1328
|
with nogil:
|
|
1308
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
1329
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
1309
1330
|
cdef int num_bc = c_basepoints.size()
|
|
1310
1331
|
|
|
1311
1332
|
if keep_inf:
|
|
@@ -1618,6 +1639,13 @@ cdef class _KSlicer_Matrix1_vine_i64:
|
|
|
1618
1639
|
self.truc = C_KSlicer_Matrix1_vine_i64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
1619
1640
|
self.minpres_degree = -1
|
|
1620
1641
|
|
|
1642
|
+
def to_colexical(self)->_KSlicer_Matrix1_vine_i64:
|
|
1643
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
1644
|
+
new_slicer = _KSlicer_Matrix1_vine_i64()
|
|
1645
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
1646
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
1647
|
+
return new_slicer
|
|
1648
|
+
|
|
1621
1649
|
def copy(self)->_KSlicer_Matrix1_vine_i64:
|
|
1622
1650
|
"""
|
|
1623
1651
|
Returns a copy of the slicer.
|
|
@@ -1661,7 +1689,7 @@ cdef class _KSlicer_Matrix1_vine_i64:
|
|
|
1661
1689
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
1662
1690
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
1663
1691
|
|
|
1664
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
1692
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
1665
1693
|
"""
|
|
1666
1694
|
Computes the persistence on a line L defined by
|
|
1667
1695
|
- a basepoint (num_parameters,) array
|
|
@@ -1670,7 +1698,7 @@ cdef class _KSlicer_Matrix1_vine_i64:
|
|
|
1670
1698
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
1671
1699
|
"""
|
|
1672
1700
|
self.push_to_line(basepoint,direction)
|
|
1673
|
-
self.truc.compute_persistence()
|
|
1701
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
1674
1702
|
if keep_inf:
|
|
1675
1703
|
bcs = tuple(np.asarray(stuff, dtype = np.int64) for stuff in self.truc.get_barcode())
|
|
1676
1704
|
else:
|
|
@@ -1680,7 +1708,7 @@ cdef class _KSlicer_Matrix1_vine_i64:
|
|
|
1680
1708
|
bcs = _KSlicer_Matrix1_vine_i64._bc_to_full(bcs, basepoint, direction)
|
|
1681
1709
|
return bcs
|
|
1682
1710
|
|
|
1683
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
1711
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
1684
1712
|
"""
|
|
1685
1713
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
1686
1714
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -1691,11 +1719,11 @@ cdef class _KSlicer_Matrix1_vine_i64:
|
|
|
1691
1719
|
if directions is None:
|
|
1692
1720
|
c_basepoints = basepoints
|
|
1693
1721
|
with nogil:
|
|
1694
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
1722
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
1695
1723
|
else:
|
|
1696
1724
|
c_truc = zip(basepoints,directions)
|
|
1697
1725
|
with nogil:
|
|
1698
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
1726
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
1699
1727
|
cdef int num_bc = c_basepoints.size()
|
|
1700
1728
|
|
|
1701
1729
|
if keep_inf:
|
|
@@ -2008,6 +2036,13 @@ cdef class _KSlicer_Matrix0_vine_f32:
|
|
|
2008
2036
|
self.truc = C_KSlicer_Matrix0_vine_f32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
2009
2037
|
self.minpres_degree = -1
|
|
2010
2038
|
|
|
2039
|
+
def to_colexical(self)->_KSlicer_Matrix0_vine_f32:
|
|
2040
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
2041
|
+
new_slicer = _KSlicer_Matrix0_vine_f32()
|
|
2042
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
2043
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
2044
|
+
return new_slicer
|
|
2045
|
+
|
|
2011
2046
|
def copy(self)->_KSlicer_Matrix0_vine_f32:
|
|
2012
2047
|
"""
|
|
2013
2048
|
Returns a copy of the slicer.
|
|
@@ -2051,7 +2086,7 @@ cdef class _KSlicer_Matrix0_vine_f32:
|
|
|
2051
2086
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
2052
2087
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
2053
2088
|
|
|
2054
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
2089
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
2055
2090
|
"""
|
|
2056
2091
|
Computes the persistence on a line L defined by
|
|
2057
2092
|
- a basepoint (num_parameters,) array
|
|
@@ -2060,7 +2095,7 @@ cdef class _KSlicer_Matrix0_vine_f32:
|
|
|
2060
2095
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
2061
2096
|
"""
|
|
2062
2097
|
self.push_to_line(basepoint,direction)
|
|
2063
|
-
self.truc.compute_persistence()
|
|
2098
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
2064
2099
|
if keep_inf:
|
|
2065
2100
|
bcs = tuple(np.asarray(stuff, dtype = np.float32) for stuff in self.truc.get_barcode())
|
|
2066
2101
|
else:
|
|
@@ -2070,7 +2105,7 @@ cdef class _KSlicer_Matrix0_vine_f32:
|
|
|
2070
2105
|
bcs = _KSlicer_Matrix0_vine_f32._bc_to_full(bcs, basepoint, direction)
|
|
2071
2106
|
return bcs
|
|
2072
2107
|
|
|
2073
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
2108
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
2074
2109
|
"""
|
|
2075
2110
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
2076
2111
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -2081,11 +2116,11 @@ cdef class _KSlicer_Matrix0_vine_f32:
|
|
|
2081
2116
|
if directions is None:
|
|
2082
2117
|
c_basepoints = basepoints
|
|
2083
2118
|
with nogil:
|
|
2084
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
2119
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
2085
2120
|
else:
|
|
2086
2121
|
c_truc = zip(basepoints,directions)
|
|
2087
2122
|
with nogil:
|
|
2088
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
2123
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
2089
2124
|
cdef int num_bc = c_basepoints.size()
|
|
2090
2125
|
|
|
2091
2126
|
if keep_inf:
|
|
@@ -2398,6 +2433,13 @@ cdef class _KSlicer_Matrix1_vine_f32:
|
|
|
2398
2433
|
self.truc = C_KSlicer_Matrix1_vine_f32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
2399
2434
|
self.minpres_degree = -1
|
|
2400
2435
|
|
|
2436
|
+
def to_colexical(self)->_KSlicer_Matrix1_vine_f32:
|
|
2437
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
2438
|
+
new_slicer = _KSlicer_Matrix1_vine_f32()
|
|
2439
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
2440
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
2441
|
+
return new_slicer
|
|
2442
|
+
|
|
2401
2443
|
def copy(self)->_KSlicer_Matrix1_vine_f32:
|
|
2402
2444
|
"""
|
|
2403
2445
|
Returns a copy of the slicer.
|
|
@@ -2441,7 +2483,7 @@ cdef class _KSlicer_Matrix1_vine_f32:
|
|
|
2441
2483
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
2442
2484
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
2443
2485
|
|
|
2444
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
2486
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
2445
2487
|
"""
|
|
2446
2488
|
Computes the persistence on a line L defined by
|
|
2447
2489
|
- a basepoint (num_parameters,) array
|
|
@@ -2450,7 +2492,7 @@ cdef class _KSlicer_Matrix1_vine_f32:
|
|
|
2450
2492
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
2451
2493
|
"""
|
|
2452
2494
|
self.push_to_line(basepoint,direction)
|
|
2453
|
-
self.truc.compute_persistence()
|
|
2495
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
2454
2496
|
if keep_inf:
|
|
2455
2497
|
bcs = tuple(np.asarray(stuff, dtype = np.float32) for stuff in self.truc.get_barcode())
|
|
2456
2498
|
else:
|
|
@@ -2460,7 +2502,7 @@ cdef class _KSlicer_Matrix1_vine_f32:
|
|
|
2460
2502
|
bcs = _KSlicer_Matrix1_vine_f32._bc_to_full(bcs, basepoint, direction)
|
|
2461
2503
|
return bcs
|
|
2462
2504
|
|
|
2463
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
2505
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
2464
2506
|
"""
|
|
2465
2507
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
2466
2508
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -2471,11 +2513,11 @@ cdef class _KSlicer_Matrix1_vine_f32:
|
|
|
2471
2513
|
if directions is None:
|
|
2472
2514
|
c_basepoints = basepoints
|
|
2473
2515
|
with nogil:
|
|
2474
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
2516
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
2475
2517
|
else:
|
|
2476
2518
|
c_truc = zip(basepoints,directions)
|
|
2477
2519
|
with nogil:
|
|
2478
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
2520
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
2479
2521
|
cdef int num_bc = c_basepoints.size()
|
|
2480
2522
|
|
|
2481
2523
|
if keep_inf:
|
|
@@ -2788,6 +2830,13 @@ cdef class _KSlicer_Matrix0_vine_f64:
|
|
|
2788
2830
|
self.truc = C_KSlicer_Matrix0_vine_f64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
2789
2831
|
self.minpres_degree = -1
|
|
2790
2832
|
|
|
2833
|
+
def to_colexical(self)->_KSlicer_Matrix0_vine_f64:
|
|
2834
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
2835
|
+
new_slicer = _KSlicer_Matrix0_vine_f64()
|
|
2836
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
2837
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
2838
|
+
return new_slicer
|
|
2839
|
+
|
|
2791
2840
|
def copy(self)->_KSlicer_Matrix0_vine_f64:
|
|
2792
2841
|
"""
|
|
2793
2842
|
Returns a copy of the slicer.
|
|
@@ -2831,7 +2880,7 @@ cdef class _KSlicer_Matrix0_vine_f64:
|
|
|
2831
2880
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
2832
2881
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
2833
2882
|
|
|
2834
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
2883
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
2835
2884
|
"""
|
|
2836
2885
|
Computes the persistence on a line L defined by
|
|
2837
2886
|
- a basepoint (num_parameters,) array
|
|
@@ -2840,7 +2889,7 @@ cdef class _KSlicer_Matrix0_vine_f64:
|
|
|
2840
2889
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
2841
2890
|
"""
|
|
2842
2891
|
self.push_to_line(basepoint,direction)
|
|
2843
|
-
self.truc.compute_persistence()
|
|
2892
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
2844
2893
|
if keep_inf:
|
|
2845
2894
|
bcs = tuple(np.asarray(stuff, dtype = np.float64) for stuff in self.truc.get_barcode())
|
|
2846
2895
|
else:
|
|
@@ -2850,7 +2899,7 @@ cdef class _KSlicer_Matrix0_vine_f64:
|
|
|
2850
2899
|
bcs = _KSlicer_Matrix0_vine_f64._bc_to_full(bcs, basepoint, direction)
|
|
2851
2900
|
return bcs
|
|
2852
2901
|
|
|
2853
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
2902
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
2854
2903
|
"""
|
|
2855
2904
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
2856
2905
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -2861,11 +2910,11 @@ cdef class _KSlicer_Matrix0_vine_f64:
|
|
|
2861
2910
|
if directions is None:
|
|
2862
2911
|
c_basepoints = basepoints
|
|
2863
2912
|
with nogil:
|
|
2864
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
2913
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
2865
2914
|
else:
|
|
2866
2915
|
c_truc = zip(basepoints,directions)
|
|
2867
2916
|
with nogil:
|
|
2868
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
2917
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
2869
2918
|
cdef int num_bc = c_basepoints.size()
|
|
2870
2919
|
|
|
2871
2920
|
if keep_inf:
|
|
@@ -3178,6 +3227,13 @@ cdef class _KSlicer_Matrix1_vine_f64:
|
|
|
3178
3227
|
self.truc = C_KSlicer_Matrix1_vine_f64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
3179
3228
|
self.minpres_degree = -1
|
|
3180
3229
|
|
|
3230
|
+
def to_colexical(self)->_KSlicer_Matrix1_vine_f64:
|
|
3231
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
3232
|
+
new_slicer = _KSlicer_Matrix1_vine_f64()
|
|
3233
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
3234
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
3235
|
+
return new_slicer
|
|
3236
|
+
|
|
3181
3237
|
def copy(self)->_KSlicer_Matrix1_vine_f64:
|
|
3182
3238
|
"""
|
|
3183
3239
|
Returns a copy of the slicer.
|
|
@@ -3221,7 +3277,7 @@ cdef class _KSlicer_Matrix1_vine_f64:
|
|
|
3221
3277
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
3222
3278
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
3223
3279
|
|
|
3224
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
3280
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
3225
3281
|
"""
|
|
3226
3282
|
Computes the persistence on a line L defined by
|
|
3227
3283
|
- a basepoint (num_parameters,) array
|
|
@@ -3230,7 +3286,7 @@ cdef class _KSlicer_Matrix1_vine_f64:
|
|
|
3230
3286
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
3231
3287
|
"""
|
|
3232
3288
|
self.push_to_line(basepoint,direction)
|
|
3233
|
-
self.truc.compute_persistence()
|
|
3289
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
3234
3290
|
if keep_inf:
|
|
3235
3291
|
bcs = tuple(np.asarray(stuff, dtype = np.float64) for stuff in self.truc.get_barcode())
|
|
3236
3292
|
else:
|
|
@@ -3240,7 +3296,7 @@ cdef class _KSlicer_Matrix1_vine_f64:
|
|
|
3240
3296
|
bcs = _KSlicer_Matrix1_vine_f64._bc_to_full(bcs, basepoint, direction)
|
|
3241
3297
|
return bcs
|
|
3242
3298
|
|
|
3243
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
3299
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
3244
3300
|
"""
|
|
3245
3301
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
3246
3302
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -3251,11 +3307,11 @@ cdef class _KSlicer_Matrix1_vine_f64:
|
|
|
3251
3307
|
if directions is None:
|
|
3252
3308
|
c_basepoints = basepoints
|
|
3253
3309
|
with nogil:
|
|
3254
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
3310
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
3255
3311
|
else:
|
|
3256
3312
|
c_truc = zip(basepoints,directions)
|
|
3257
3313
|
with nogil:
|
|
3258
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
3314
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
3259
3315
|
cdef int num_bc = c_basepoints.size()
|
|
3260
3316
|
|
|
3261
3317
|
if keep_inf:
|
|
@@ -3559,6 +3615,13 @@ cdef class _Slicer_Matrix0_vine_i32:
|
|
|
3559
3615
|
self.truc = C_Slicer_Matrix0_vine_i32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
3560
3616
|
self.minpres_degree = -1
|
|
3561
3617
|
|
|
3618
|
+
def to_colexical(self)->_Slicer_Matrix0_vine_i32:
|
|
3619
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
3620
|
+
new_slicer = _Slicer_Matrix0_vine_i32()
|
|
3621
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
3622
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
3623
|
+
return new_slicer
|
|
3624
|
+
|
|
3562
3625
|
def copy(self)->_Slicer_Matrix0_vine_i32:
|
|
3563
3626
|
"""
|
|
3564
3627
|
Returns a copy of the slicer.
|
|
@@ -3602,7 +3665,7 @@ cdef class _Slicer_Matrix0_vine_i32:
|
|
|
3602
3665
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
3603
3666
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
3604
3667
|
|
|
3605
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
3668
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
3606
3669
|
"""
|
|
3607
3670
|
Computes the persistence on a line L defined by
|
|
3608
3671
|
- a basepoint (num_parameters,) array
|
|
@@ -3611,7 +3674,7 @@ cdef class _Slicer_Matrix0_vine_i32:
|
|
|
3611
3674
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
3612
3675
|
"""
|
|
3613
3676
|
self.push_to_line(basepoint,direction)
|
|
3614
|
-
self.truc.compute_persistence()
|
|
3677
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
3615
3678
|
if keep_inf:
|
|
3616
3679
|
bcs = tuple(np.asarray(stuff, dtype = np.int32) for stuff in self.truc.get_barcode())
|
|
3617
3680
|
else:
|
|
@@ -3621,7 +3684,7 @@ cdef class _Slicer_Matrix0_vine_i32:
|
|
|
3621
3684
|
bcs = _Slicer_Matrix0_vine_i32._bc_to_full(bcs, basepoint, direction)
|
|
3622
3685
|
return bcs
|
|
3623
3686
|
|
|
3624
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
3687
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
3625
3688
|
"""
|
|
3626
3689
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
3627
3690
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -3632,11 +3695,11 @@ cdef class _Slicer_Matrix0_vine_i32:
|
|
|
3632
3695
|
if directions is None:
|
|
3633
3696
|
c_basepoints = basepoints
|
|
3634
3697
|
with nogil:
|
|
3635
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
3698
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
3636
3699
|
else:
|
|
3637
3700
|
c_truc = zip(basepoints,directions)
|
|
3638
3701
|
with nogil:
|
|
3639
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
3702
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
3640
3703
|
cdef int num_bc = c_basepoints.size()
|
|
3641
3704
|
|
|
3642
3705
|
if keep_inf:
|
|
@@ -3961,6 +4024,13 @@ cdef class _Slicer_Matrix1_vine_i32:
|
|
|
3961
4024
|
self.truc = C_Slicer_Matrix1_vine_i32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
3962
4025
|
self.minpres_degree = -1
|
|
3963
4026
|
|
|
4027
|
+
def to_colexical(self)->_Slicer_Matrix1_vine_i32:
|
|
4028
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
4029
|
+
new_slicer = _Slicer_Matrix1_vine_i32()
|
|
4030
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
4031
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
4032
|
+
return new_slicer
|
|
4033
|
+
|
|
3964
4034
|
def copy(self)->_Slicer_Matrix1_vine_i32:
|
|
3965
4035
|
"""
|
|
3966
4036
|
Returns a copy of the slicer.
|
|
@@ -4004,7 +4074,7 @@ cdef class _Slicer_Matrix1_vine_i32:
|
|
|
4004
4074
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
4005
4075
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
4006
4076
|
|
|
4007
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
4077
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
4008
4078
|
"""
|
|
4009
4079
|
Computes the persistence on a line L defined by
|
|
4010
4080
|
- a basepoint (num_parameters,) array
|
|
@@ -4013,7 +4083,7 @@ cdef class _Slicer_Matrix1_vine_i32:
|
|
|
4013
4083
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
4014
4084
|
"""
|
|
4015
4085
|
self.push_to_line(basepoint,direction)
|
|
4016
|
-
self.truc.compute_persistence()
|
|
4086
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
4017
4087
|
if keep_inf:
|
|
4018
4088
|
bcs = tuple(np.asarray(stuff, dtype = np.int32) for stuff in self.truc.get_barcode())
|
|
4019
4089
|
else:
|
|
@@ -4023,7 +4093,7 @@ cdef class _Slicer_Matrix1_vine_i32:
|
|
|
4023
4093
|
bcs = _Slicer_Matrix1_vine_i32._bc_to_full(bcs, basepoint, direction)
|
|
4024
4094
|
return bcs
|
|
4025
4095
|
|
|
4026
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
4096
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
4027
4097
|
"""
|
|
4028
4098
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
4029
4099
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -4034,11 +4104,11 @@ cdef class _Slicer_Matrix1_vine_i32:
|
|
|
4034
4104
|
if directions is None:
|
|
4035
4105
|
c_basepoints = basepoints
|
|
4036
4106
|
with nogil:
|
|
4037
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
4107
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
4038
4108
|
else:
|
|
4039
4109
|
c_truc = zip(basepoints,directions)
|
|
4040
4110
|
with nogil:
|
|
4041
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
4111
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
4042
4112
|
cdef int num_bc = c_basepoints.size()
|
|
4043
4113
|
|
|
4044
4114
|
if keep_inf:
|
|
@@ -4363,6 +4433,13 @@ cdef class _Slicer_Matrix0_vine_i64:
|
|
|
4363
4433
|
self.truc = C_Slicer_Matrix0_vine_i64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
4364
4434
|
self.minpres_degree = -1
|
|
4365
4435
|
|
|
4436
|
+
def to_colexical(self)->_Slicer_Matrix0_vine_i64:
|
|
4437
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
4438
|
+
new_slicer = _Slicer_Matrix0_vine_i64()
|
|
4439
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
4440
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
4441
|
+
return new_slicer
|
|
4442
|
+
|
|
4366
4443
|
def copy(self)->_Slicer_Matrix0_vine_i64:
|
|
4367
4444
|
"""
|
|
4368
4445
|
Returns a copy of the slicer.
|
|
@@ -4406,7 +4483,7 @@ cdef class _Slicer_Matrix0_vine_i64:
|
|
|
4406
4483
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
4407
4484
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
4408
4485
|
|
|
4409
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
4486
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
4410
4487
|
"""
|
|
4411
4488
|
Computes the persistence on a line L defined by
|
|
4412
4489
|
- a basepoint (num_parameters,) array
|
|
@@ -4415,7 +4492,7 @@ cdef class _Slicer_Matrix0_vine_i64:
|
|
|
4415
4492
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
4416
4493
|
"""
|
|
4417
4494
|
self.push_to_line(basepoint,direction)
|
|
4418
|
-
self.truc.compute_persistence()
|
|
4495
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
4419
4496
|
if keep_inf:
|
|
4420
4497
|
bcs = tuple(np.asarray(stuff, dtype = np.int64) for stuff in self.truc.get_barcode())
|
|
4421
4498
|
else:
|
|
@@ -4425,7 +4502,7 @@ cdef class _Slicer_Matrix0_vine_i64:
|
|
|
4425
4502
|
bcs = _Slicer_Matrix0_vine_i64._bc_to_full(bcs, basepoint, direction)
|
|
4426
4503
|
return bcs
|
|
4427
4504
|
|
|
4428
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
4505
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
4429
4506
|
"""
|
|
4430
4507
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
4431
4508
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -4436,11 +4513,11 @@ cdef class _Slicer_Matrix0_vine_i64:
|
|
|
4436
4513
|
if directions is None:
|
|
4437
4514
|
c_basepoints = basepoints
|
|
4438
4515
|
with nogil:
|
|
4439
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
4516
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
4440
4517
|
else:
|
|
4441
4518
|
c_truc = zip(basepoints,directions)
|
|
4442
4519
|
with nogil:
|
|
4443
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
4520
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
4444
4521
|
cdef int num_bc = c_basepoints.size()
|
|
4445
4522
|
|
|
4446
4523
|
if keep_inf:
|
|
@@ -4765,6 +4842,13 @@ cdef class _Slicer_Matrix1_vine_i64:
|
|
|
4765
4842
|
self.truc = C_Slicer_Matrix1_vine_i64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
4766
4843
|
self.minpres_degree = -1
|
|
4767
4844
|
|
|
4845
|
+
def to_colexical(self)->_Slicer_Matrix1_vine_i64:
|
|
4846
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
4847
|
+
new_slicer = _Slicer_Matrix1_vine_i64()
|
|
4848
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
4849
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
4850
|
+
return new_slicer
|
|
4851
|
+
|
|
4768
4852
|
def copy(self)->_Slicer_Matrix1_vine_i64:
|
|
4769
4853
|
"""
|
|
4770
4854
|
Returns a copy of the slicer.
|
|
@@ -4808,7 +4892,7 @@ cdef class _Slicer_Matrix1_vine_i64:
|
|
|
4808
4892
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
4809
4893
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
4810
4894
|
|
|
4811
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
4895
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
4812
4896
|
"""
|
|
4813
4897
|
Computes the persistence on a line L defined by
|
|
4814
4898
|
- a basepoint (num_parameters,) array
|
|
@@ -4817,7 +4901,7 @@ cdef class _Slicer_Matrix1_vine_i64:
|
|
|
4817
4901
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
4818
4902
|
"""
|
|
4819
4903
|
self.push_to_line(basepoint,direction)
|
|
4820
|
-
self.truc.compute_persistence()
|
|
4904
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
4821
4905
|
if keep_inf:
|
|
4822
4906
|
bcs = tuple(np.asarray(stuff, dtype = np.int64) for stuff in self.truc.get_barcode())
|
|
4823
4907
|
else:
|
|
@@ -4827,7 +4911,7 @@ cdef class _Slicer_Matrix1_vine_i64:
|
|
|
4827
4911
|
bcs = _Slicer_Matrix1_vine_i64._bc_to_full(bcs, basepoint, direction)
|
|
4828
4912
|
return bcs
|
|
4829
4913
|
|
|
4830
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
4914
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
4831
4915
|
"""
|
|
4832
4916
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
4833
4917
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -4838,11 +4922,11 @@ cdef class _Slicer_Matrix1_vine_i64:
|
|
|
4838
4922
|
if directions is None:
|
|
4839
4923
|
c_basepoints = basepoints
|
|
4840
4924
|
with nogil:
|
|
4841
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
4925
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
4842
4926
|
else:
|
|
4843
4927
|
c_truc = zip(basepoints,directions)
|
|
4844
4928
|
with nogil:
|
|
4845
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
4929
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
4846
4930
|
cdef int num_bc = c_basepoints.size()
|
|
4847
4931
|
|
|
4848
4932
|
if keep_inf:
|
|
@@ -5167,6 +5251,13 @@ cdef class _Slicer_Matrix0_vine_f32:
|
|
|
5167
5251
|
self.truc = C_Slicer_Matrix0_vine_f32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
5168
5252
|
self.minpres_degree = -1
|
|
5169
5253
|
|
|
5254
|
+
def to_colexical(self)->_Slicer_Matrix0_vine_f32:
|
|
5255
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
5256
|
+
new_slicer = _Slicer_Matrix0_vine_f32()
|
|
5257
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
5258
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
5259
|
+
return new_slicer
|
|
5260
|
+
|
|
5170
5261
|
def copy(self)->_Slicer_Matrix0_vine_f32:
|
|
5171
5262
|
"""
|
|
5172
5263
|
Returns a copy of the slicer.
|
|
@@ -5210,7 +5301,7 @@ cdef class _Slicer_Matrix0_vine_f32:
|
|
|
5210
5301
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
5211
5302
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
5212
5303
|
|
|
5213
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
5304
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
5214
5305
|
"""
|
|
5215
5306
|
Computes the persistence on a line L defined by
|
|
5216
5307
|
- a basepoint (num_parameters,) array
|
|
@@ -5219,7 +5310,7 @@ cdef class _Slicer_Matrix0_vine_f32:
|
|
|
5219
5310
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
5220
5311
|
"""
|
|
5221
5312
|
self.push_to_line(basepoint,direction)
|
|
5222
|
-
self.truc.compute_persistence()
|
|
5313
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
5223
5314
|
if keep_inf:
|
|
5224
5315
|
bcs = tuple(np.asarray(stuff, dtype = np.float32) for stuff in self.truc.get_barcode())
|
|
5225
5316
|
else:
|
|
@@ -5229,7 +5320,7 @@ cdef class _Slicer_Matrix0_vine_f32:
|
|
|
5229
5320
|
bcs = _Slicer_Matrix0_vine_f32._bc_to_full(bcs, basepoint, direction)
|
|
5230
5321
|
return bcs
|
|
5231
5322
|
|
|
5232
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
5323
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
5233
5324
|
"""
|
|
5234
5325
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
5235
5326
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -5240,11 +5331,11 @@ cdef class _Slicer_Matrix0_vine_f32:
|
|
|
5240
5331
|
if directions is None:
|
|
5241
5332
|
c_basepoints = basepoints
|
|
5242
5333
|
with nogil:
|
|
5243
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
5334
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
5244
5335
|
else:
|
|
5245
5336
|
c_truc = zip(basepoints,directions)
|
|
5246
5337
|
with nogil:
|
|
5247
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
5338
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
5248
5339
|
cdef int num_bc = c_basepoints.size()
|
|
5249
5340
|
|
|
5250
5341
|
if keep_inf:
|
|
@@ -5569,6 +5660,13 @@ cdef class _Slicer_Matrix1_vine_f32:
|
|
|
5569
5660
|
self.truc = C_Slicer_Matrix1_vine_f32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
5570
5661
|
self.minpres_degree = -1
|
|
5571
5662
|
|
|
5663
|
+
def to_colexical(self)->_Slicer_Matrix1_vine_f32:
|
|
5664
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
5665
|
+
new_slicer = _Slicer_Matrix1_vine_f32()
|
|
5666
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
5667
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
5668
|
+
return new_slicer
|
|
5669
|
+
|
|
5572
5670
|
def copy(self)->_Slicer_Matrix1_vine_f32:
|
|
5573
5671
|
"""
|
|
5574
5672
|
Returns a copy of the slicer.
|
|
@@ -5612,7 +5710,7 @@ cdef class _Slicer_Matrix1_vine_f32:
|
|
|
5612
5710
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
5613
5711
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
5614
5712
|
|
|
5615
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
5713
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
5616
5714
|
"""
|
|
5617
5715
|
Computes the persistence on a line L defined by
|
|
5618
5716
|
- a basepoint (num_parameters,) array
|
|
@@ -5621,7 +5719,7 @@ cdef class _Slicer_Matrix1_vine_f32:
|
|
|
5621
5719
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
5622
5720
|
"""
|
|
5623
5721
|
self.push_to_line(basepoint,direction)
|
|
5624
|
-
self.truc.compute_persistence()
|
|
5722
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
5625
5723
|
if keep_inf:
|
|
5626
5724
|
bcs = tuple(np.asarray(stuff, dtype = np.float32) for stuff in self.truc.get_barcode())
|
|
5627
5725
|
else:
|
|
@@ -5631,7 +5729,7 @@ cdef class _Slicer_Matrix1_vine_f32:
|
|
|
5631
5729
|
bcs = _Slicer_Matrix1_vine_f32._bc_to_full(bcs, basepoint, direction)
|
|
5632
5730
|
return bcs
|
|
5633
5731
|
|
|
5634
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
5732
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
5635
5733
|
"""
|
|
5636
5734
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
5637
5735
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -5642,11 +5740,11 @@ cdef class _Slicer_Matrix1_vine_f32:
|
|
|
5642
5740
|
if directions is None:
|
|
5643
5741
|
c_basepoints = basepoints
|
|
5644
5742
|
with nogil:
|
|
5645
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
5743
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
5646
5744
|
else:
|
|
5647
5745
|
c_truc = zip(basepoints,directions)
|
|
5648
5746
|
with nogil:
|
|
5649
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
5747
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
5650
5748
|
cdef int num_bc = c_basepoints.size()
|
|
5651
5749
|
|
|
5652
5750
|
if keep_inf:
|
|
@@ -5971,6 +6069,13 @@ cdef class _Slicer_Matrix0_vine_f64:
|
|
|
5971
6069
|
self.truc = C_Slicer_Matrix0_vine_f64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
5972
6070
|
self.minpres_degree = -1
|
|
5973
6071
|
|
|
6072
|
+
def to_colexical(self)->_Slicer_Matrix0_vine_f64:
|
|
6073
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
6074
|
+
new_slicer = _Slicer_Matrix0_vine_f64()
|
|
6075
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
6076
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
6077
|
+
return new_slicer
|
|
6078
|
+
|
|
5974
6079
|
def copy(self)->_Slicer_Matrix0_vine_f64:
|
|
5975
6080
|
"""
|
|
5976
6081
|
Returns a copy of the slicer.
|
|
@@ -6014,7 +6119,7 @@ cdef class _Slicer_Matrix0_vine_f64:
|
|
|
6014
6119
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
6015
6120
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
6016
6121
|
|
|
6017
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
6122
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
6018
6123
|
"""
|
|
6019
6124
|
Computes the persistence on a line L defined by
|
|
6020
6125
|
- a basepoint (num_parameters,) array
|
|
@@ -6023,7 +6128,7 @@ cdef class _Slicer_Matrix0_vine_f64:
|
|
|
6023
6128
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
6024
6129
|
"""
|
|
6025
6130
|
self.push_to_line(basepoint,direction)
|
|
6026
|
-
self.truc.compute_persistence()
|
|
6131
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
6027
6132
|
if keep_inf:
|
|
6028
6133
|
bcs = tuple(np.asarray(stuff, dtype = np.float64) for stuff in self.truc.get_barcode())
|
|
6029
6134
|
else:
|
|
@@ -6033,7 +6138,7 @@ cdef class _Slicer_Matrix0_vine_f64:
|
|
|
6033
6138
|
bcs = _Slicer_Matrix0_vine_f64._bc_to_full(bcs, basepoint, direction)
|
|
6034
6139
|
return bcs
|
|
6035
6140
|
|
|
6036
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
6141
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
6037
6142
|
"""
|
|
6038
6143
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
6039
6144
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -6044,11 +6149,11 @@ cdef class _Slicer_Matrix0_vine_f64:
|
|
|
6044
6149
|
if directions is None:
|
|
6045
6150
|
c_basepoints = basepoints
|
|
6046
6151
|
with nogil:
|
|
6047
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
6152
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
6048
6153
|
else:
|
|
6049
6154
|
c_truc = zip(basepoints,directions)
|
|
6050
6155
|
with nogil:
|
|
6051
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
6156
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
6052
6157
|
cdef int num_bc = c_basepoints.size()
|
|
6053
6158
|
|
|
6054
6159
|
if keep_inf:
|
|
@@ -6373,6 +6478,13 @@ cdef class _Slicer_Matrix1_vine_f64:
|
|
|
6373
6478
|
self.truc = C_Slicer_Matrix1_vine_f64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
6374
6479
|
self.minpres_degree = -1
|
|
6375
6480
|
|
|
6481
|
+
def to_colexical(self)->_Slicer_Matrix1_vine_f64:
|
|
6482
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
6483
|
+
new_slicer = _Slicer_Matrix1_vine_f64()
|
|
6484
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
6485
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
6486
|
+
return new_slicer
|
|
6487
|
+
|
|
6376
6488
|
def copy(self)->_Slicer_Matrix1_vine_f64:
|
|
6377
6489
|
"""
|
|
6378
6490
|
Returns a copy of the slicer.
|
|
@@ -6416,7 +6528,7 @@ cdef class _Slicer_Matrix1_vine_f64:
|
|
|
6416
6528
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
6417
6529
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
6418
6530
|
|
|
6419
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
6531
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
6420
6532
|
"""
|
|
6421
6533
|
Computes the persistence on a line L defined by
|
|
6422
6534
|
- a basepoint (num_parameters,) array
|
|
@@ -6425,7 +6537,7 @@ cdef class _Slicer_Matrix1_vine_f64:
|
|
|
6425
6537
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
6426
6538
|
"""
|
|
6427
6539
|
self.push_to_line(basepoint,direction)
|
|
6428
|
-
self.truc.compute_persistence()
|
|
6540
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
6429
6541
|
if keep_inf:
|
|
6430
6542
|
bcs = tuple(np.asarray(stuff, dtype = np.float64) for stuff in self.truc.get_barcode())
|
|
6431
6543
|
else:
|
|
@@ -6435,7 +6547,7 @@ cdef class _Slicer_Matrix1_vine_f64:
|
|
|
6435
6547
|
bcs = _Slicer_Matrix1_vine_f64._bc_to_full(bcs, basepoint, direction)
|
|
6436
6548
|
return bcs
|
|
6437
6549
|
|
|
6438
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
6550
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
6439
6551
|
"""
|
|
6440
6552
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
6441
6553
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -6446,11 +6558,11 @@ cdef class _Slicer_Matrix1_vine_f64:
|
|
|
6446
6558
|
if directions is None:
|
|
6447
6559
|
c_basepoints = basepoints
|
|
6448
6560
|
with nogil:
|
|
6449
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
6561
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
6450
6562
|
else:
|
|
6451
6563
|
c_truc = zip(basepoints,directions)
|
|
6452
6564
|
with nogil:
|
|
6453
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
6565
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
6454
6566
|
cdef int num_bc = c_basepoints.size()
|
|
6455
6567
|
|
|
6456
6568
|
if keep_inf:
|
|
@@ -6784,6 +6896,13 @@ cdef class _KSlicer_Matrix0_i32:
|
|
|
6784
6896
|
self.truc = C_KSlicer_Matrix0_i32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
6785
6897
|
self.minpres_degree = -1
|
|
6786
6898
|
|
|
6899
|
+
def to_colexical(self)->_KSlicer_Matrix0_i32:
|
|
6900
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
6901
|
+
new_slicer = _KSlicer_Matrix0_i32()
|
|
6902
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
6903
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
6904
|
+
return new_slicer
|
|
6905
|
+
|
|
6787
6906
|
def copy(self)->_KSlicer_Matrix0_i32:
|
|
6788
6907
|
"""
|
|
6789
6908
|
Returns a copy of the slicer.
|
|
@@ -6827,7 +6946,7 @@ cdef class _KSlicer_Matrix0_i32:
|
|
|
6827
6946
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
6828
6947
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
6829
6948
|
|
|
6830
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
6949
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
6831
6950
|
"""
|
|
6832
6951
|
Computes the persistence on a line L defined by
|
|
6833
6952
|
- a basepoint (num_parameters,) array
|
|
@@ -6836,7 +6955,7 @@ cdef class _KSlicer_Matrix0_i32:
|
|
|
6836
6955
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
6837
6956
|
"""
|
|
6838
6957
|
self.push_to_line(basepoint,direction)
|
|
6839
|
-
self.truc.compute_persistence()
|
|
6958
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
6840
6959
|
if keep_inf:
|
|
6841
6960
|
bcs = tuple(np.asarray(stuff, dtype = np.int32) for stuff in self.truc.get_barcode())
|
|
6842
6961
|
else:
|
|
@@ -6846,7 +6965,7 @@ cdef class _KSlicer_Matrix0_i32:
|
|
|
6846
6965
|
bcs = _KSlicer_Matrix0_i32._bc_to_full(bcs, basepoint, direction)
|
|
6847
6966
|
return bcs
|
|
6848
6967
|
|
|
6849
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
6968
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
6850
6969
|
"""
|
|
6851
6970
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
6852
6971
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -6857,11 +6976,11 @@ cdef class _KSlicer_Matrix0_i32:
|
|
|
6857
6976
|
if directions is None:
|
|
6858
6977
|
c_basepoints = basepoints
|
|
6859
6978
|
with nogil:
|
|
6860
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
6979
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
6861
6980
|
else:
|
|
6862
6981
|
c_truc = zip(basepoints,directions)
|
|
6863
6982
|
with nogil:
|
|
6864
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
6983
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
6865
6984
|
cdef int num_bc = c_basepoints.size()
|
|
6866
6985
|
|
|
6867
6986
|
if keep_inf:
|
|
@@ -7156,6 +7275,13 @@ cdef class _KSlicer_Matrix1_i32:
|
|
|
7156
7275
|
self.truc = C_KSlicer_Matrix1_i32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
7157
7276
|
self.minpres_degree = -1
|
|
7158
7277
|
|
|
7278
|
+
def to_colexical(self)->_KSlicer_Matrix1_i32:
|
|
7279
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
7280
|
+
new_slicer = _KSlicer_Matrix1_i32()
|
|
7281
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
7282
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
7283
|
+
return new_slicer
|
|
7284
|
+
|
|
7159
7285
|
def copy(self)->_KSlicer_Matrix1_i32:
|
|
7160
7286
|
"""
|
|
7161
7287
|
Returns a copy of the slicer.
|
|
@@ -7199,7 +7325,7 @@ cdef class _KSlicer_Matrix1_i32:
|
|
|
7199
7325
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
7200
7326
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
7201
7327
|
|
|
7202
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
7328
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
7203
7329
|
"""
|
|
7204
7330
|
Computes the persistence on a line L defined by
|
|
7205
7331
|
- a basepoint (num_parameters,) array
|
|
@@ -7208,7 +7334,7 @@ cdef class _KSlicer_Matrix1_i32:
|
|
|
7208
7334
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
7209
7335
|
"""
|
|
7210
7336
|
self.push_to_line(basepoint,direction)
|
|
7211
|
-
self.truc.compute_persistence()
|
|
7337
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
7212
7338
|
if keep_inf:
|
|
7213
7339
|
bcs = tuple(np.asarray(stuff, dtype = np.int32) for stuff in self.truc.get_barcode())
|
|
7214
7340
|
else:
|
|
@@ -7218,7 +7344,7 @@ cdef class _KSlicer_Matrix1_i32:
|
|
|
7218
7344
|
bcs = _KSlicer_Matrix1_i32._bc_to_full(bcs, basepoint, direction)
|
|
7219
7345
|
return bcs
|
|
7220
7346
|
|
|
7221
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
7347
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
7222
7348
|
"""
|
|
7223
7349
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
7224
7350
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -7229,11 +7355,11 @@ cdef class _KSlicer_Matrix1_i32:
|
|
|
7229
7355
|
if directions is None:
|
|
7230
7356
|
c_basepoints = basepoints
|
|
7231
7357
|
with nogil:
|
|
7232
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
7358
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
7233
7359
|
else:
|
|
7234
7360
|
c_truc = zip(basepoints,directions)
|
|
7235
7361
|
with nogil:
|
|
7236
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
7362
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
7237
7363
|
cdef int num_bc = c_basepoints.size()
|
|
7238
7364
|
|
|
7239
7365
|
if keep_inf:
|
|
@@ -7528,6 +7654,13 @@ cdef class _KSlicer_Matrix0_i64:
|
|
|
7528
7654
|
self.truc = C_KSlicer_Matrix0_i64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
7529
7655
|
self.minpres_degree = -1
|
|
7530
7656
|
|
|
7657
|
+
def to_colexical(self)->_KSlicer_Matrix0_i64:
|
|
7658
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
7659
|
+
new_slicer = _KSlicer_Matrix0_i64()
|
|
7660
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
7661
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
7662
|
+
return new_slicer
|
|
7663
|
+
|
|
7531
7664
|
def copy(self)->_KSlicer_Matrix0_i64:
|
|
7532
7665
|
"""
|
|
7533
7666
|
Returns a copy of the slicer.
|
|
@@ -7571,7 +7704,7 @@ cdef class _KSlicer_Matrix0_i64:
|
|
|
7571
7704
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
7572
7705
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
7573
7706
|
|
|
7574
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
7707
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
7575
7708
|
"""
|
|
7576
7709
|
Computes the persistence on a line L defined by
|
|
7577
7710
|
- a basepoint (num_parameters,) array
|
|
@@ -7580,7 +7713,7 @@ cdef class _KSlicer_Matrix0_i64:
|
|
|
7580
7713
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
7581
7714
|
"""
|
|
7582
7715
|
self.push_to_line(basepoint,direction)
|
|
7583
|
-
self.truc.compute_persistence()
|
|
7716
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
7584
7717
|
if keep_inf:
|
|
7585
7718
|
bcs = tuple(np.asarray(stuff, dtype = np.int64) for stuff in self.truc.get_barcode())
|
|
7586
7719
|
else:
|
|
@@ -7590,7 +7723,7 @@ cdef class _KSlicer_Matrix0_i64:
|
|
|
7590
7723
|
bcs = _KSlicer_Matrix0_i64._bc_to_full(bcs, basepoint, direction)
|
|
7591
7724
|
return bcs
|
|
7592
7725
|
|
|
7593
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
7726
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
7594
7727
|
"""
|
|
7595
7728
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
7596
7729
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -7601,11 +7734,11 @@ cdef class _KSlicer_Matrix0_i64:
|
|
|
7601
7734
|
if directions is None:
|
|
7602
7735
|
c_basepoints = basepoints
|
|
7603
7736
|
with nogil:
|
|
7604
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
7737
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
7605
7738
|
else:
|
|
7606
7739
|
c_truc = zip(basepoints,directions)
|
|
7607
7740
|
with nogil:
|
|
7608
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
7741
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
7609
7742
|
cdef int num_bc = c_basepoints.size()
|
|
7610
7743
|
|
|
7611
7744
|
if keep_inf:
|
|
@@ -7900,6 +8033,13 @@ cdef class _KSlicer_Matrix1_i64:
|
|
|
7900
8033
|
self.truc = C_KSlicer_Matrix1_i64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
7901
8034
|
self.minpres_degree = -1
|
|
7902
8035
|
|
|
8036
|
+
def to_colexical(self)->_KSlicer_Matrix1_i64:
|
|
8037
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
8038
|
+
new_slicer = _KSlicer_Matrix1_i64()
|
|
8039
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
8040
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
8041
|
+
return new_slicer
|
|
8042
|
+
|
|
7903
8043
|
def copy(self)->_KSlicer_Matrix1_i64:
|
|
7904
8044
|
"""
|
|
7905
8045
|
Returns a copy of the slicer.
|
|
@@ -7943,7 +8083,7 @@ cdef class _KSlicer_Matrix1_i64:
|
|
|
7943
8083
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
7944
8084
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
7945
8085
|
|
|
7946
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
8086
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
7947
8087
|
"""
|
|
7948
8088
|
Computes the persistence on a line L defined by
|
|
7949
8089
|
- a basepoint (num_parameters,) array
|
|
@@ -7952,7 +8092,7 @@ cdef class _KSlicer_Matrix1_i64:
|
|
|
7952
8092
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
7953
8093
|
"""
|
|
7954
8094
|
self.push_to_line(basepoint,direction)
|
|
7955
|
-
self.truc.compute_persistence()
|
|
8095
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
7956
8096
|
if keep_inf:
|
|
7957
8097
|
bcs = tuple(np.asarray(stuff, dtype = np.int64) for stuff in self.truc.get_barcode())
|
|
7958
8098
|
else:
|
|
@@ -7962,7 +8102,7 @@ cdef class _KSlicer_Matrix1_i64:
|
|
|
7962
8102
|
bcs = _KSlicer_Matrix1_i64._bc_to_full(bcs, basepoint, direction)
|
|
7963
8103
|
return bcs
|
|
7964
8104
|
|
|
7965
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
8105
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
7966
8106
|
"""
|
|
7967
8107
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
7968
8108
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -7973,11 +8113,11 @@ cdef class _KSlicer_Matrix1_i64:
|
|
|
7973
8113
|
if directions is None:
|
|
7974
8114
|
c_basepoints = basepoints
|
|
7975
8115
|
with nogil:
|
|
7976
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
8116
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
7977
8117
|
else:
|
|
7978
8118
|
c_truc = zip(basepoints,directions)
|
|
7979
8119
|
with nogil:
|
|
7980
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
8120
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
7981
8121
|
cdef int num_bc = c_basepoints.size()
|
|
7982
8122
|
|
|
7983
8123
|
if keep_inf:
|
|
@@ -8272,6 +8412,13 @@ cdef class _KSlicer_Matrix0_f32:
|
|
|
8272
8412
|
self.truc = C_KSlicer_Matrix0_f32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
8273
8413
|
self.minpres_degree = -1
|
|
8274
8414
|
|
|
8415
|
+
def to_colexical(self)->_KSlicer_Matrix0_f32:
|
|
8416
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
8417
|
+
new_slicer = _KSlicer_Matrix0_f32()
|
|
8418
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
8419
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
8420
|
+
return new_slicer
|
|
8421
|
+
|
|
8275
8422
|
def copy(self)->_KSlicer_Matrix0_f32:
|
|
8276
8423
|
"""
|
|
8277
8424
|
Returns a copy of the slicer.
|
|
@@ -8315,7 +8462,7 @@ cdef class _KSlicer_Matrix0_f32:
|
|
|
8315
8462
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
8316
8463
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
8317
8464
|
|
|
8318
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
8465
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
8319
8466
|
"""
|
|
8320
8467
|
Computes the persistence on a line L defined by
|
|
8321
8468
|
- a basepoint (num_parameters,) array
|
|
@@ -8324,7 +8471,7 @@ cdef class _KSlicer_Matrix0_f32:
|
|
|
8324
8471
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
8325
8472
|
"""
|
|
8326
8473
|
self.push_to_line(basepoint,direction)
|
|
8327
|
-
self.truc.compute_persistence()
|
|
8474
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
8328
8475
|
if keep_inf:
|
|
8329
8476
|
bcs = tuple(np.asarray(stuff, dtype = np.float32) for stuff in self.truc.get_barcode())
|
|
8330
8477
|
else:
|
|
@@ -8334,7 +8481,7 @@ cdef class _KSlicer_Matrix0_f32:
|
|
|
8334
8481
|
bcs = _KSlicer_Matrix0_f32._bc_to_full(bcs, basepoint, direction)
|
|
8335
8482
|
return bcs
|
|
8336
8483
|
|
|
8337
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
8484
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
8338
8485
|
"""
|
|
8339
8486
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
8340
8487
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -8345,11 +8492,11 @@ cdef class _KSlicer_Matrix0_f32:
|
|
|
8345
8492
|
if directions is None:
|
|
8346
8493
|
c_basepoints = basepoints
|
|
8347
8494
|
with nogil:
|
|
8348
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
8495
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
8349
8496
|
else:
|
|
8350
8497
|
c_truc = zip(basepoints,directions)
|
|
8351
8498
|
with nogil:
|
|
8352
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
8499
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
8353
8500
|
cdef int num_bc = c_basepoints.size()
|
|
8354
8501
|
|
|
8355
8502
|
if keep_inf:
|
|
@@ -8644,6 +8791,13 @@ cdef class _KSlicer_Matrix1_f32:
|
|
|
8644
8791
|
self.truc = C_KSlicer_Matrix1_f32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
8645
8792
|
self.minpres_degree = -1
|
|
8646
8793
|
|
|
8794
|
+
def to_colexical(self)->_KSlicer_Matrix1_f32:
|
|
8795
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
8796
|
+
new_slicer = _KSlicer_Matrix1_f32()
|
|
8797
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
8798
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
8799
|
+
return new_slicer
|
|
8800
|
+
|
|
8647
8801
|
def copy(self)->_KSlicer_Matrix1_f32:
|
|
8648
8802
|
"""
|
|
8649
8803
|
Returns a copy of the slicer.
|
|
@@ -8687,7 +8841,7 @@ cdef class _KSlicer_Matrix1_f32:
|
|
|
8687
8841
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
8688
8842
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
8689
8843
|
|
|
8690
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
8844
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
8691
8845
|
"""
|
|
8692
8846
|
Computes the persistence on a line L defined by
|
|
8693
8847
|
- a basepoint (num_parameters,) array
|
|
@@ -8696,7 +8850,7 @@ cdef class _KSlicer_Matrix1_f32:
|
|
|
8696
8850
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
8697
8851
|
"""
|
|
8698
8852
|
self.push_to_line(basepoint,direction)
|
|
8699
|
-
self.truc.compute_persistence()
|
|
8853
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
8700
8854
|
if keep_inf:
|
|
8701
8855
|
bcs = tuple(np.asarray(stuff, dtype = np.float32) for stuff in self.truc.get_barcode())
|
|
8702
8856
|
else:
|
|
@@ -8706,7 +8860,7 @@ cdef class _KSlicer_Matrix1_f32:
|
|
|
8706
8860
|
bcs = _KSlicer_Matrix1_f32._bc_to_full(bcs, basepoint, direction)
|
|
8707
8861
|
return bcs
|
|
8708
8862
|
|
|
8709
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
8863
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
8710
8864
|
"""
|
|
8711
8865
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
8712
8866
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -8717,11 +8871,11 @@ cdef class _KSlicer_Matrix1_f32:
|
|
|
8717
8871
|
if directions is None:
|
|
8718
8872
|
c_basepoints = basepoints
|
|
8719
8873
|
with nogil:
|
|
8720
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
8874
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
8721
8875
|
else:
|
|
8722
8876
|
c_truc = zip(basepoints,directions)
|
|
8723
8877
|
with nogil:
|
|
8724
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
8878
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
8725
8879
|
cdef int num_bc = c_basepoints.size()
|
|
8726
8880
|
|
|
8727
8881
|
if keep_inf:
|
|
@@ -9016,6 +9170,13 @@ cdef class _KSlicer_Matrix0_f64:
|
|
|
9016
9170
|
self.truc = C_KSlicer_Matrix0_f64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
9017
9171
|
self.minpres_degree = -1
|
|
9018
9172
|
|
|
9173
|
+
def to_colexical(self)->_KSlicer_Matrix0_f64:
|
|
9174
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
9175
|
+
new_slicer = _KSlicer_Matrix0_f64()
|
|
9176
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
9177
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
9178
|
+
return new_slicer
|
|
9179
|
+
|
|
9019
9180
|
def copy(self)->_KSlicer_Matrix0_f64:
|
|
9020
9181
|
"""
|
|
9021
9182
|
Returns a copy of the slicer.
|
|
@@ -9059,7 +9220,7 @@ cdef class _KSlicer_Matrix0_f64:
|
|
|
9059
9220
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
9060
9221
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
9061
9222
|
|
|
9062
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
9223
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
9063
9224
|
"""
|
|
9064
9225
|
Computes the persistence on a line L defined by
|
|
9065
9226
|
- a basepoint (num_parameters,) array
|
|
@@ -9068,7 +9229,7 @@ cdef class _KSlicer_Matrix0_f64:
|
|
|
9068
9229
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
9069
9230
|
"""
|
|
9070
9231
|
self.push_to_line(basepoint,direction)
|
|
9071
|
-
self.truc.compute_persistence()
|
|
9232
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
9072
9233
|
if keep_inf:
|
|
9073
9234
|
bcs = tuple(np.asarray(stuff, dtype = np.float64) for stuff in self.truc.get_barcode())
|
|
9074
9235
|
else:
|
|
@@ -9078,7 +9239,7 @@ cdef class _KSlicer_Matrix0_f64:
|
|
|
9078
9239
|
bcs = _KSlicer_Matrix0_f64._bc_to_full(bcs, basepoint, direction)
|
|
9079
9240
|
return bcs
|
|
9080
9241
|
|
|
9081
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
9242
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
9082
9243
|
"""
|
|
9083
9244
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
9084
9245
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -9089,11 +9250,11 @@ cdef class _KSlicer_Matrix0_f64:
|
|
|
9089
9250
|
if directions is None:
|
|
9090
9251
|
c_basepoints = basepoints
|
|
9091
9252
|
with nogil:
|
|
9092
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
9253
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
9093
9254
|
else:
|
|
9094
9255
|
c_truc = zip(basepoints,directions)
|
|
9095
9256
|
with nogil:
|
|
9096
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
9257
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
9097
9258
|
cdef int num_bc = c_basepoints.size()
|
|
9098
9259
|
|
|
9099
9260
|
if keep_inf:
|
|
@@ -9388,6 +9549,13 @@ cdef class _KSlicer_Matrix1_f64:
|
|
|
9388
9549
|
self.truc = C_KSlicer_Matrix1_f64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
9389
9550
|
self.minpres_degree = -1
|
|
9390
9551
|
|
|
9552
|
+
def to_colexical(self)->_KSlicer_Matrix1_f64:
|
|
9553
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
9554
|
+
new_slicer = _KSlicer_Matrix1_f64()
|
|
9555
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
9556
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
9557
|
+
return new_slicer
|
|
9558
|
+
|
|
9391
9559
|
def copy(self)->_KSlicer_Matrix1_f64:
|
|
9392
9560
|
"""
|
|
9393
9561
|
Returns a copy of the slicer.
|
|
@@ -9431,7 +9599,7 @@ cdef class _KSlicer_Matrix1_f64:
|
|
|
9431
9599
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
9432
9600
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
9433
9601
|
|
|
9434
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
9602
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
9435
9603
|
"""
|
|
9436
9604
|
Computes the persistence on a line L defined by
|
|
9437
9605
|
- a basepoint (num_parameters,) array
|
|
@@ -9440,7 +9608,7 @@ cdef class _KSlicer_Matrix1_f64:
|
|
|
9440
9608
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
9441
9609
|
"""
|
|
9442
9610
|
self.push_to_line(basepoint,direction)
|
|
9443
|
-
self.truc.compute_persistence()
|
|
9611
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
9444
9612
|
if keep_inf:
|
|
9445
9613
|
bcs = tuple(np.asarray(stuff, dtype = np.float64) for stuff in self.truc.get_barcode())
|
|
9446
9614
|
else:
|
|
@@ -9450,7 +9618,7 @@ cdef class _KSlicer_Matrix1_f64:
|
|
|
9450
9618
|
bcs = _KSlicer_Matrix1_f64._bc_to_full(bcs, basepoint, direction)
|
|
9451
9619
|
return bcs
|
|
9452
9620
|
|
|
9453
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
9621
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
9454
9622
|
"""
|
|
9455
9623
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
9456
9624
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -9461,11 +9629,11 @@ cdef class _KSlicer_Matrix1_f64:
|
|
|
9461
9629
|
if directions is None:
|
|
9462
9630
|
c_basepoints = basepoints
|
|
9463
9631
|
with nogil:
|
|
9464
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
9632
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
9465
9633
|
else:
|
|
9466
9634
|
c_truc = zip(basepoints,directions)
|
|
9467
9635
|
with nogil:
|
|
9468
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
9636
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
9469
9637
|
cdef int num_bc = c_basepoints.size()
|
|
9470
9638
|
|
|
9471
9639
|
if keep_inf:
|
|
@@ -9751,6 +9919,13 @@ cdef class _Slicer_Matrix0_i32:
|
|
|
9751
9919
|
self.truc = C_Slicer_Matrix0_i32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
9752
9920
|
self.minpres_degree = -1
|
|
9753
9921
|
|
|
9922
|
+
def to_colexical(self)->_Slicer_Matrix0_i32:
|
|
9923
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
9924
|
+
new_slicer = _Slicer_Matrix0_i32()
|
|
9925
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
9926
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
9927
|
+
return new_slicer
|
|
9928
|
+
|
|
9754
9929
|
def copy(self)->_Slicer_Matrix0_i32:
|
|
9755
9930
|
"""
|
|
9756
9931
|
Returns a copy of the slicer.
|
|
@@ -9794,7 +9969,7 @@ cdef class _Slicer_Matrix0_i32:
|
|
|
9794
9969
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
9795
9970
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
9796
9971
|
|
|
9797
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
9972
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
9798
9973
|
"""
|
|
9799
9974
|
Computes the persistence on a line L defined by
|
|
9800
9975
|
- a basepoint (num_parameters,) array
|
|
@@ -9803,7 +9978,7 @@ cdef class _Slicer_Matrix0_i32:
|
|
|
9803
9978
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
9804
9979
|
"""
|
|
9805
9980
|
self.push_to_line(basepoint,direction)
|
|
9806
|
-
self.truc.compute_persistence()
|
|
9981
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
9807
9982
|
if keep_inf:
|
|
9808
9983
|
bcs = tuple(np.asarray(stuff, dtype = np.int32) for stuff in self.truc.get_barcode())
|
|
9809
9984
|
else:
|
|
@@ -9813,7 +9988,7 @@ cdef class _Slicer_Matrix0_i32:
|
|
|
9813
9988
|
bcs = _Slicer_Matrix0_i32._bc_to_full(bcs, basepoint, direction)
|
|
9814
9989
|
return bcs
|
|
9815
9990
|
|
|
9816
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
9991
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
9817
9992
|
"""
|
|
9818
9993
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
9819
9994
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -9824,11 +9999,11 @@ cdef class _Slicer_Matrix0_i32:
|
|
|
9824
9999
|
if directions is None:
|
|
9825
10000
|
c_basepoints = basepoints
|
|
9826
10001
|
with nogil:
|
|
9827
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
10002
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
9828
10003
|
else:
|
|
9829
10004
|
c_truc = zip(basepoints,directions)
|
|
9830
10005
|
with nogil:
|
|
9831
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
10006
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
9832
10007
|
cdef int num_bc = c_basepoints.size()
|
|
9833
10008
|
|
|
9834
10009
|
if keep_inf:
|
|
@@ -10135,6 +10310,13 @@ cdef class _Slicer_Matrix1_i32:
|
|
|
10135
10310
|
self.truc = C_Slicer_Matrix1_i32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
10136
10311
|
self.minpres_degree = -1
|
|
10137
10312
|
|
|
10313
|
+
def to_colexical(self)->_Slicer_Matrix1_i32:
|
|
10314
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
10315
|
+
new_slicer = _Slicer_Matrix1_i32()
|
|
10316
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
10317
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
10318
|
+
return new_slicer
|
|
10319
|
+
|
|
10138
10320
|
def copy(self)->_Slicer_Matrix1_i32:
|
|
10139
10321
|
"""
|
|
10140
10322
|
Returns a copy of the slicer.
|
|
@@ -10178,7 +10360,7 @@ cdef class _Slicer_Matrix1_i32:
|
|
|
10178
10360
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
10179
10361
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
10180
10362
|
|
|
10181
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
10363
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
10182
10364
|
"""
|
|
10183
10365
|
Computes the persistence on a line L defined by
|
|
10184
10366
|
- a basepoint (num_parameters,) array
|
|
@@ -10187,7 +10369,7 @@ cdef class _Slicer_Matrix1_i32:
|
|
|
10187
10369
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
10188
10370
|
"""
|
|
10189
10371
|
self.push_to_line(basepoint,direction)
|
|
10190
|
-
self.truc.compute_persistence()
|
|
10372
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
10191
10373
|
if keep_inf:
|
|
10192
10374
|
bcs = tuple(np.asarray(stuff, dtype = np.int32) for stuff in self.truc.get_barcode())
|
|
10193
10375
|
else:
|
|
@@ -10197,7 +10379,7 @@ cdef class _Slicer_Matrix1_i32:
|
|
|
10197
10379
|
bcs = _Slicer_Matrix1_i32._bc_to_full(bcs, basepoint, direction)
|
|
10198
10380
|
return bcs
|
|
10199
10381
|
|
|
10200
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
10382
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
10201
10383
|
"""
|
|
10202
10384
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
10203
10385
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -10208,11 +10390,11 @@ cdef class _Slicer_Matrix1_i32:
|
|
|
10208
10390
|
if directions is None:
|
|
10209
10391
|
c_basepoints = basepoints
|
|
10210
10392
|
with nogil:
|
|
10211
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
10393
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
10212
10394
|
else:
|
|
10213
10395
|
c_truc = zip(basepoints,directions)
|
|
10214
10396
|
with nogil:
|
|
10215
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
10397
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
10216
10398
|
cdef int num_bc = c_basepoints.size()
|
|
10217
10399
|
|
|
10218
10400
|
if keep_inf:
|
|
@@ -10519,6 +10701,13 @@ cdef class _Slicer_Matrix0_i64:
|
|
|
10519
10701
|
self.truc = C_Slicer_Matrix0_i64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
10520
10702
|
self.minpres_degree = -1
|
|
10521
10703
|
|
|
10704
|
+
def to_colexical(self)->_Slicer_Matrix0_i64:
|
|
10705
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
10706
|
+
new_slicer = _Slicer_Matrix0_i64()
|
|
10707
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
10708
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
10709
|
+
return new_slicer
|
|
10710
|
+
|
|
10522
10711
|
def copy(self)->_Slicer_Matrix0_i64:
|
|
10523
10712
|
"""
|
|
10524
10713
|
Returns a copy of the slicer.
|
|
@@ -10562,7 +10751,7 @@ cdef class _Slicer_Matrix0_i64:
|
|
|
10562
10751
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
10563
10752
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
10564
10753
|
|
|
10565
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
10754
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
10566
10755
|
"""
|
|
10567
10756
|
Computes the persistence on a line L defined by
|
|
10568
10757
|
- a basepoint (num_parameters,) array
|
|
@@ -10571,7 +10760,7 @@ cdef class _Slicer_Matrix0_i64:
|
|
|
10571
10760
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
10572
10761
|
"""
|
|
10573
10762
|
self.push_to_line(basepoint,direction)
|
|
10574
|
-
self.truc.compute_persistence()
|
|
10763
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
10575
10764
|
if keep_inf:
|
|
10576
10765
|
bcs = tuple(np.asarray(stuff, dtype = np.int64) for stuff in self.truc.get_barcode())
|
|
10577
10766
|
else:
|
|
@@ -10581,7 +10770,7 @@ cdef class _Slicer_Matrix0_i64:
|
|
|
10581
10770
|
bcs = _Slicer_Matrix0_i64._bc_to_full(bcs, basepoint, direction)
|
|
10582
10771
|
return bcs
|
|
10583
10772
|
|
|
10584
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
10773
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
10585
10774
|
"""
|
|
10586
10775
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
10587
10776
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -10592,11 +10781,11 @@ cdef class _Slicer_Matrix0_i64:
|
|
|
10592
10781
|
if directions is None:
|
|
10593
10782
|
c_basepoints = basepoints
|
|
10594
10783
|
with nogil:
|
|
10595
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
10784
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
10596
10785
|
else:
|
|
10597
10786
|
c_truc = zip(basepoints,directions)
|
|
10598
10787
|
with nogil:
|
|
10599
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
10788
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
10600
10789
|
cdef int num_bc = c_basepoints.size()
|
|
10601
10790
|
|
|
10602
10791
|
if keep_inf:
|
|
@@ -10903,6 +11092,13 @@ cdef class _Slicer_Matrix1_i64:
|
|
|
10903
11092
|
self.truc = C_Slicer_Matrix1_i64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
10904
11093
|
self.minpres_degree = -1
|
|
10905
11094
|
|
|
11095
|
+
def to_colexical(self)->_Slicer_Matrix1_i64:
|
|
11096
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
11097
|
+
new_slicer = _Slicer_Matrix1_i64()
|
|
11098
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
11099
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
11100
|
+
return new_slicer
|
|
11101
|
+
|
|
10906
11102
|
def copy(self)->_Slicer_Matrix1_i64:
|
|
10907
11103
|
"""
|
|
10908
11104
|
Returns a copy of the slicer.
|
|
@@ -10946,7 +11142,7 @@ cdef class _Slicer_Matrix1_i64:
|
|
|
10946
11142
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
10947
11143
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
10948
11144
|
|
|
10949
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
11145
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
10950
11146
|
"""
|
|
10951
11147
|
Computes the persistence on a line L defined by
|
|
10952
11148
|
- a basepoint (num_parameters,) array
|
|
@@ -10955,7 +11151,7 @@ cdef class _Slicer_Matrix1_i64:
|
|
|
10955
11151
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
10956
11152
|
"""
|
|
10957
11153
|
self.push_to_line(basepoint,direction)
|
|
10958
|
-
self.truc.compute_persistence()
|
|
11154
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
10959
11155
|
if keep_inf:
|
|
10960
11156
|
bcs = tuple(np.asarray(stuff, dtype = np.int64) for stuff in self.truc.get_barcode())
|
|
10961
11157
|
else:
|
|
@@ -10965,7 +11161,7 @@ cdef class _Slicer_Matrix1_i64:
|
|
|
10965
11161
|
bcs = _Slicer_Matrix1_i64._bc_to_full(bcs, basepoint, direction)
|
|
10966
11162
|
return bcs
|
|
10967
11163
|
|
|
10968
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
11164
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
10969
11165
|
"""
|
|
10970
11166
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
10971
11167
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -10976,11 +11172,11 @@ cdef class _Slicer_Matrix1_i64:
|
|
|
10976
11172
|
if directions is None:
|
|
10977
11173
|
c_basepoints = basepoints
|
|
10978
11174
|
with nogil:
|
|
10979
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
11175
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
10980
11176
|
else:
|
|
10981
11177
|
c_truc = zip(basepoints,directions)
|
|
10982
11178
|
with nogil:
|
|
10983
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
11179
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
10984
11180
|
cdef int num_bc = c_basepoints.size()
|
|
10985
11181
|
|
|
10986
11182
|
if keep_inf:
|
|
@@ -11287,6 +11483,13 @@ cdef class _Slicer_Matrix0_f32:
|
|
|
11287
11483
|
self.truc = C_Slicer_Matrix0_f32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
11288
11484
|
self.minpres_degree = -1
|
|
11289
11485
|
|
|
11486
|
+
def to_colexical(self)->_Slicer_Matrix0_f32:
|
|
11487
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
11488
|
+
new_slicer = _Slicer_Matrix0_f32()
|
|
11489
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
11490
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
11491
|
+
return new_slicer
|
|
11492
|
+
|
|
11290
11493
|
def copy(self)->_Slicer_Matrix0_f32:
|
|
11291
11494
|
"""
|
|
11292
11495
|
Returns a copy of the slicer.
|
|
@@ -11330,7 +11533,7 @@ cdef class _Slicer_Matrix0_f32:
|
|
|
11330
11533
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
11331
11534
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
11332
11535
|
|
|
11333
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
11536
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
11334
11537
|
"""
|
|
11335
11538
|
Computes the persistence on a line L defined by
|
|
11336
11539
|
- a basepoint (num_parameters,) array
|
|
@@ -11339,7 +11542,7 @@ cdef class _Slicer_Matrix0_f32:
|
|
|
11339
11542
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
11340
11543
|
"""
|
|
11341
11544
|
self.push_to_line(basepoint,direction)
|
|
11342
|
-
self.truc.compute_persistence()
|
|
11545
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
11343
11546
|
if keep_inf:
|
|
11344
11547
|
bcs = tuple(np.asarray(stuff, dtype = np.float32) for stuff in self.truc.get_barcode())
|
|
11345
11548
|
else:
|
|
@@ -11349,7 +11552,7 @@ cdef class _Slicer_Matrix0_f32:
|
|
|
11349
11552
|
bcs = _Slicer_Matrix0_f32._bc_to_full(bcs, basepoint, direction)
|
|
11350
11553
|
return bcs
|
|
11351
11554
|
|
|
11352
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
11555
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
11353
11556
|
"""
|
|
11354
11557
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
11355
11558
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -11360,11 +11563,11 @@ cdef class _Slicer_Matrix0_f32:
|
|
|
11360
11563
|
if directions is None:
|
|
11361
11564
|
c_basepoints = basepoints
|
|
11362
11565
|
with nogil:
|
|
11363
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
11566
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
11364
11567
|
else:
|
|
11365
11568
|
c_truc = zip(basepoints,directions)
|
|
11366
11569
|
with nogil:
|
|
11367
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
11570
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
11368
11571
|
cdef int num_bc = c_basepoints.size()
|
|
11369
11572
|
|
|
11370
11573
|
if keep_inf:
|
|
@@ -11671,6 +11874,13 @@ cdef class _Slicer_Matrix1_f32:
|
|
|
11671
11874
|
self.truc = C_Slicer_Matrix1_f32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
11672
11875
|
self.minpres_degree = -1
|
|
11673
11876
|
|
|
11877
|
+
def to_colexical(self)->_Slicer_Matrix1_f32:
|
|
11878
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
11879
|
+
new_slicer = _Slicer_Matrix1_f32()
|
|
11880
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
11881
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
11882
|
+
return new_slicer
|
|
11883
|
+
|
|
11674
11884
|
def copy(self)->_Slicer_Matrix1_f32:
|
|
11675
11885
|
"""
|
|
11676
11886
|
Returns a copy of the slicer.
|
|
@@ -11714,7 +11924,7 @@ cdef class _Slicer_Matrix1_f32:
|
|
|
11714
11924
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
11715
11925
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
11716
11926
|
|
|
11717
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
11927
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
11718
11928
|
"""
|
|
11719
11929
|
Computes the persistence on a line L defined by
|
|
11720
11930
|
- a basepoint (num_parameters,) array
|
|
@@ -11723,7 +11933,7 @@ cdef class _Slicer_Matrix1_f32:
|
|
|
11723
11933
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
11724
11934
|
"""
|
|
11725
11935
|
self.push_to_line(basepoint,direction)
|
|
11726
|
-
self.truc.compute_persistence()
|
|
11936
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
11727
11937
|
if keep_inf:
|
|
11728
11938
|
bcs = tuple(np.asarray(stuff, dtype = np.float32) for stuff in self.truc.get_barcode())
|
|
11729
11939
|
else:
|
|
@@ -11733,7 +11943,7 @@ cdef class _Slicer_Matrix1_f32:
|
|
|
11733
11943
|
bcs = _Slicer_Matrix1_f32._bc_to_full(bcs, basepoint, direction)
|
|
11734
11944
|
return bcs
|
|
11735
11945
|
|
|
11736
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
11946
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
11737
11947
|
"""
|
|
11738
11948
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
11739
11949
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -11744,11 +11954,11 @@ cdef class _Slicer_Matrix1_f32:
|
|
|
11744
11954
|
if directions is None:
|
|
11745
11955
|
c_basepoints = basepoints
|
|
11746
11956
|
with nogil:
|
|
11747
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
11957
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
11748
11958
|
else:
|
|
11749
11959
|
c_truc = zip(basepoints,directions)
|
|
11750
11960
|
with nogil:
|
|
11751
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
11961
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
11752
11962
|
cdef int num_bc = c_basepoints.size()
|
|
11753
11963
|
|
|
11754
11964
|
if keep_inf:
|
|
@@ -12055,6 +12265,13 @@ cdef class _Slicer_Matrix0_f64:
|
|
|
12055
12265
|
self.truc = C_Slicer_Matrix0_f64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
12056
12266
|
self.minpres_degree = -1
|
|
12057
12267
|
|
|
12268
|
+
def to_colexical(self)->_Slicer_Matrix0_f64:
|
|
12269
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
12270
|
+
new_slicer = _Slicer_Matrix0_f64()
|
|
12271
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
12272
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
12273
|
+
return new_slicer
|
|
12274
|
+
|
|
12058
12275
|
def copy(self)->_Slicer_Matrix0_f64:
|
|
12059
12276
|
"""
|
|
12060
12277
|
Returns a copy of the slicer.
|
|
@@ -12098,7 +12315,7 @@ cdef class _Slicer_Matrix0_f64:
|
|
|
12098
12315
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
12099
12316
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
12100
12317
|
|
|
12101
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
12318
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
12102
12319
|
"""
|
|
12103
12320
|
Computes the persistence on a line L defined by
|
|
12104
12321
|
- a basepoint (num_parameters,) array
|
|
@@ -12107,7 +12324,7 @@ cdef class _Slicer_Matrix0_f64:
|
|
|
12107
12324
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
12108
12325
|
"""
|
|
12109
12326
|
self.push_to_line(basepoint,direction)
|
|
12110
|
-
self.truc.compute_persistence()
|
|
12327
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
12111
12328
|
if keep_inf:
|
|
12112
12329
|
bcs = tuple(np.asarray(stuff, dtype = np.float64) for stuff in self.truc.get_barcode())
|
|
12113
12330
|
else:
|
|
@@ -12117,7 +12334,7 @@ cdef class _Slicer_Matrix0_f64:
|
|
|
12117
12334
|
bcs = _Slicer_Matrix0_f64._bc_to_full(bcs, basepoint, direction)
|
|
12118
12335
|
return bcs
|
|
12119
12336
|
|
|
12120
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
12337
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
12121
12338
|
"""
|
|
12122
12339
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
12123
12340
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -12128,11 +12345,11 @@ cdef class _Slicer_Matrix0_f64:
|
|
|
12128
12345
|
if directions is None:
|
|
12129
12346
|
c_basepoints = basepoints
|
|
12130
12347
|
with nogil:
|
|
12131
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
12348
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
12132
12349
|
else:
|
|
12133
12350
|
c_truc = zip(basepoints,directions)
|
|
12134
12351
|
with nogil:
|
|
12135
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
12352
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
12136
12353
|
cdef int num_bc = c_basepoints.size()
|
|
12137
12354
|
|
|
12138
12355
|
if keep_inf:
|
|
@@ -12439,6 +12656,13 @@ cdef class _Slicer_Matrix1_f64:
|
|
|
12439
12656
|
self.truc = C_Slicer_Matrix1_f64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
12440
12657
|
self.minpres_degree = -1
|
|
12441
12658
|
|
|
12659
|
+
def to_colexical(self)->_Slicer_Matrix1_f64:
|
|
12660
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
12661
|
+
new_slicer = _Slicer_Matrix1_f64()
|
|
12662
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
12663
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
12664
|
+
return new_slicer
|
|
12665
|
+
|
|
12442
12666
|
def copy(self)->_Slicer_Matrix1_f64:
|
|
12443
12667
|
"""
|
|
12444
12668
|
Returns a copy of the slicer.
|
|
@@ -12482,7 +12706,7 @@ cdef class _Slicer_Matrix1_f64:
|
|
|
12482
12706
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
12483
12707
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
12484
12708
|
|
|
12485
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
12709
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
12486
12710
|
"""
|
|
12487
12711
|
Computes the persistence on a line L defined by
|
|
12488
12712
|
- a basepoint (num_parameters,) array
|
|
@@ -12491,7 +12715,7 @@ cdef class _Slicer_Matrix1_f64:
|
|
|
12491
12715
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
12492
12716
|
"""
|
|
12493
12717
|
self.push_to_line(basepoint,direction)
|
|
12494
|
-
self.truc.compute_persistence()
|
|
12718
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
12495
12719
|
if keep_inf:
|
|
12496
12720
|
bcs = tuple(np.asarray(stuff, dtype = np.float64) for stuff in self.truc.get_barcode())
|
|
12497
12721
|
else:
|
|
@@ -12501,7 +12725,7 @@ cdef class _Slicer_Matrix1_f64:
|
|
|
12501
12725
|
bcs = _Slicer_Matrix1_f64._bc_to_full(bcs, basepoint, direction)
|
|
12502
12726
|
return bcs
|
|
12503
12727
|
|
|
12504
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
12728
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
12505
12729
|
"""
|
|
12506
12730
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
12507
12731
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -12512,11 +12736,11 @@ cdef class _Slicer_Matrix1_f64:
|
|
|
12512
12736
|
if directions is None:
|
|
12513
12737
|
c_basepoints = basepoints
|
|
12514
12738
|
with nogil:
|
|
12515
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
12739
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
12516
12740
|
else:
|
|
12517
12741
|
c_truc = zip(basepoints,directions)
|
|
12518
12742
|
with nogil:
|
|
12519
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
12743
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
12520
12744
|
cdef int num_bc = c_basepoints.size()
|
|
12521
12745
|
|
|
12522
12746
|
if keep_inf:
|
|
@@ -12832,6 +13056,13 @@ cdef class _KSlicer_GudhiCohomology0_i32:
|
|
|
12832
13056
|
self.truc = C_KSlicer_GudhiCohomology0_i32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
12833
13057
|
self.minpres_degree = -1
|
|
12834
13058
|
|
|
13059
|
+
def to_colexical(self)->_KSlicer_GudhiCohomology0_i32:
|
|
13060
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
13061
|
+
new_slicer = _KSlicer_GudhiCohomology0_i32()
|
|
13062
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
13063
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
13064
|
+
return new_slicer
|
|
13065
|
+
|
|
12835
13066
|
def copy(self)->_KSlicer_GudhiCohomology0_i32:
|
|
12836
13067
|
"""
|
|
12837
13068
|
Returns a copy of the slicer.
|
|
@@ -12875,7 +13106,7 @@ cdef class _KSlicer_GudhiCohomology0_i32:
|
|
|
12875
13106
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
12876
13107
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
12877
13108
|
|
|
12878
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
13109
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
12879
13110
|
"""
|
|
12880
13111
|
Computes the persistence on a line L defined by
|
|
12881
13112
|
- a basepoint (num_parameters,) array
|
|
@@ -12884,7 +13115,7 @@ cdef class _KSlicer_GudhiCohomology0_i32:
|
|
|
12884
13115
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
12885
13116
|
"""
|
|
12886
13117
|
self.push_to_line(basepoint,direction)
|
|
12887
|
-
self.truc.compute_persistence()
|
|
13118
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
12888
13119
|
if keep_inf:
|
|
12889
13120
|
bcs = tuple(np.asarray(stuff, dtype = np.int32) for stuff in self.truc.get_barcode())
|
|
12890
13121
|
else:
|
|
@@ -12894,7 +13125,7 @@ cdef class _KSlicer_GudhiCohomology0_i32:
|
|
|
12894
13125
|
bcs = _KSlicer_GudhiCohomology0_i32._bc_to_full(bcs, basepoint, direction)
|
|
12895
13126
|
return bcs
|
|
12896
13127
|
|
|
12897
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
13128
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
12898
13129
|
"""
|
|
12899
13130
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
12900
13131
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -12905,11 +13136,11 @@ cdef class _KSlicer_GudhiCohomology0_i32:
|
|
|
12905
13136
|
if directions is None:
|
|
12906
13137
|
c_basepoints = basepoints
|
|
12907
13138
|
with nogil:
|
|
12908
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
13139
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
12909
13140
|
else:
|
|
12910
13141
|
c_truc = zip(basepoints,directions)
|
|
12911
13142
|
with nogil:
|
|
12912
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
13143
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
12913
13144
|
cdef int num_bc = c_basepoints.size()
|
|
12914
13145
|
|
|
12915
13146
|
if keep_inf:
|
|
@@ -13204,6 +13435,13 @@ cdef class _KSlicer_GudhiCohomology0_i64:
|
|
|
13204
13435
|
self.truc = C_KSlicer_GudhiCohomology0_i64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
13205
13436
|
self.minpres_degree = -1
|
|
13206
13437
|
|
|
13438
|
+
def to_colexical(self)->_KSlicer_GudhiCohomology0_i64:
|
|
13439
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
13440
|
+
new_slicer = _KSlicer_GudhiCohomology0_i64()
|
|
13441
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
13442
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
13443
|
+
return new_slicer
|
|
13444
|
+
|
|
13207
13445
|
def copy(self)->_KSlicer_GudhiCohomology0_i64:
|
|
13208
13446
|
"""
|
|
13209
13447
|
Returns a copy of the slicer.
|
|
@@ -13247,7 +13485,7 @@ cdef class _KSlicer_GudhiCohomology0_i64:
|
|
|
13247
13485
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
13248
13486
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
13249
13487
|
|
|
13250
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
13488
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
13251
13489
|
"""
|
|
13252
13490
|
Computes the persistence on a line L defined by
|
|
13253
13491
|
- a basepoint (num_parameters,) array
|
|
@@ -13256,7 +13494,7 @@ cdef class _KSlicer_GudhiCohomology0_i64:
|
|
|
13256
13494
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
13257
13495
|
"""
|
|
13258
13496
|
self.push_to_line(basepoint,direction)
|
|
13259
|
-
self.truc.compute_persistence()
|
|
13497
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
13260
13498
|
if keep_inf:
|
|
13261
13499
|
bcs = tuple(np.asarray(stuff, dtype = np.int64) for stuff in self.truc.get_barcode())
|
|
13262
13500
|
else:
|
|
@@ -13266,7 +13504,7 @@ cdef class _KSlicer_GudhiCohomology0_i64:
|
|
|
13266
13504
|
bcs = _KSlicer_GudhiCohomology0_i64._bc_to_full(bcs, basepoint, direction)
|
|
13267
13505
|
return bcs
|
|
13268
13506
|
|
|
13269
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
13507
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
13270
13508
|
"""
|
|
13271
13509
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
13272
13510
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -13277,11 +13515,11 @@ cdef class _KSlicer_GudhiCohomology0_i64:
|
|
|
13277
13515
|
if directions is None:
|
|
13278
13516
|
c_basepoints = basepoints
|
|
13279
13517
|
with nogil:
|
|
13280
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
13518
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
13281
13519
|
else:
|
|
13282
13520
|
c_truc = zip(basepoints,directions)
|
|
13283
13521
|
with nogil:
|
|
13284
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
13522
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
13285
13523
|
cdef int num_bc = c_basepoints.size()
|
|
13286
13524
|
|
|
13287
13525
|
if keep_inf:
|
|
@@ -13576,6 +13814,13 @@ cdef class _KSlicer_GudhiCohomology0_f32:
|
|
|
13576
13814
|
self.truc = C_KSlicer_GudhiCohomology0_f32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
13577
13815
|
self.minpres_degree = -1
|
|
13578
13816
|
|
|
13817
|
+
def to_colexical(self)->_KSlicer_GudhiCohomology0_f32:
|
|
13818
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
13819
|
+
new_slicer = _KSlicer_GudhiCohomology0_f32()
|
|
13820
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
13821
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
13822
|
+
return new_slicer
|
|
13823
|
+
|
|
13579
13824
|
def copy(self)->_KSlicer_GudhiCohomology0_f32:
|
|
13580
13825
|
"""
|
|
13581
13826
|
Returns a copy of the slicer.
|
|
@@ -13619,7 +13864,7 @@ cdef class _KSlicer_GudhiCohomology0_f32:
|
|
|
13619
13864
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
13620
13865
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
13621
13866
|
|
|
13622
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
13867
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
13623
13868
|
"""
|
|
13624
13869
|
Computes the persistence on a line L defined by
|
|
13625
13870
|
- a basepoint (num_parameters,) array
|
|
@@ -13628,7 +13873,7 @@ cdef class _KSlicer_GudhiCohomology0_f32:
|
|
|
13628
13873
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
13629
13874
|
"""
|
|
13630
13875
|
self.push_to_line(basepoint,direction)
|
|
13631
|
-
self.truc.compute_persistence()
|
|
13876
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
13632
13877
|
if keep_inf:
|
|
13633
13878
|
bcs = tuple(np.asarray(stuff, dtype = np.float32) for stuff in self.truc.get_barcode())
|
|
13634
13879
|
else:
|
|
@@ -13638,7 +13883,7 @@ cdef class _KSlicer_GudhiCohomology0_f32:
|
|
|
13638
13883
|
bcs = _KSlicer_GudhiCohomology0_f32._bc_to_full(bcs, basepoint, direction)
|
|
13639
13884
|
return bcs
|
|
13640
13885
|
|
|
13641
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
13886
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
13642
13887
|
"""
|
|
13643
13888
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
13644
13889
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -13649,11 +13894,11 @@ cdef class _KSlicer_GudhiCohomology0_f32:
|
|
|
13649
13894
|
if directions is None:
|
|
13650
13895
|
c_basepoints = basepoints
|
|
13651
13896
|
with nogil:
|
|
13652
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
13897
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
13653
13898
|
else:
|
|
13654
13899
|
c_truc = zip(basepoints,directions)
|
|
13655
13900
|
with nogil:
|
|
13656
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
13901
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
13657
13902
|
cdef int num_bc = c_basepoints.size()
|
|
13658
13903
|
|
|
13659
13904
|
if keep_inf:
|
|
@@ -13948,6 +14193,13 @@ cdef class _KSlicer_GudhiCohomology0_f64:
|
|
|
13948
14193
|
self.truc = C_KSlicer_GudhiCohomology0_f64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
13949
14194
|
self.minpres_degree = -1
|
|
13950
14195
|
|
|
14196
|
+
def to_colexical(self)->_KSlicer_GudhiCohomology0_f64:
|
|
14197
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
14198
|
+
new_slicer = _KSlicer_GudhiCohomology0_f64()
|
|
14199
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
14200
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
14201
|
+
return new_slicer
|
|
14202
|
+
|
|
13951
14203
|
def copy(self)->_KSlicer_GudhiCohomology0_f64:
|
|
13952
14204
|
"""
|
|
13953
14205
|
Returns a copy of the slicer.
|
|
@@ -13991,7 +14243,7 @@ cdef class _KSlicer_GudhiCohomology0_f64:
|
|
|
13991
14243
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
13992
14244
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
13993
14245
|
|
|
13994
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
14246
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
13995
14247
|
"""
|
|
13996
14248
|
Computes the persistence on a line L defined by
|
|
13997
14249
|
- a basepoint (num_parameters,) array
|
|
@@ -14000,7 +14252,7 @@ cdef class _KSlicer_GudhiCohomology0_f64:
|
|
|
14000
14252
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
14001
14253
|
"""
|
|
14002
14254
|
self.push_to_line(basepoint,direction)
|
|
14003
|
-
self.truc.compute_persistence()
|
|
14255
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
14004
14256
|
if keep_inf:
|
|
14005
14257
|
bcs = tuple(np.asarray(stuff, dtype = np.float64) for stuff in self.truc.get_barcode())
|
|
14006
14258
|
else:
|
|
@@ -14010,7 +14262,7 @@ cdef class _KSlicer_GudhiCohomology0_f64:
|
|
|
14010
14262
|
bcs = _KSlicer_GudhiCohomology0_f64._bc_to_full(bcs, basepoint, direction)
|
|
14011
14263
|
return bcs
|
|
14012
14264
|
|
|
14013
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
14265
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
14014
14266
|
"""
|
|
14015
14267
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
14016
14268
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -14021,11 +14273,11 @@ cdef class _KSlicer_GudhiCohomology0_f64:
|
|
|
14021
14273
|
if directions is None:
|
|
14022
14274
|
c_basepoints = basepoints
|
|
14023
14275
|
with nogil:
|
|
14024
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
14276
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
14025
14277
|
else:
|
|
14026
14278
|
c_truc = zip(basepoints,directions)
|
|
14027
14279
|
with nogil:
|
|
14028
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
14280
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
14029
14281
|
cdef int num_bc = c_basepoints.size()
|
|
14030
14282
|
|
|
14031
14283
|
if keep_inf:
|
|
@@ -14311,6 +14563,13 @@ cdef class _Slicer_GudhiCohomology0_i32:
|
|
|
14311
14563
|
self.truc = C_Slicer_GudhiCohomology0_i32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
14312
14564
|
self.minpres_degree = -1
|
|
14313
14565
|
|
|
14566
|
+
def to_colexical(self)->_Slicer_GudhiCohomology0_i32:
|
|
14567
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
14568
|
+
new_slicer = _Slicer_GudhiCohomology0_i32()
|
|
14569
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
14570
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
14571
|
+
return new_slicer
|
|
14572
|
+
|
|
14314
14573
|
def copy(self)->_Slicer_GudhiCohomology0_i32:
|
|
14315
14574
|
"""
|
|
14316
14575
|
Returns a copy of the slicer.
|
|
@@ -14354,7 +14613,7 @@ cdef class _Slicer_GudhiCohomology0_i32:
|
|
|
14354
14613
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
14355
14614
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
14356
14615
|
|
|
14357
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
14616
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
14358
14617
|
"""
|
|
14359
14618
|
Computes the persistence on a line L defined by
|
|
14360
14619
|
- a basepoint (num_parameters,) array
|
|
@@ -14363,7 +14622,7 @@ cdef class _Slicer_GudhiCohomology0_i32:
|
|
|
14363
14622
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
14364
14623
|
"""
|
|
14365
14624
|
self.push_to_line(basepoint,direction)
|
|
14366
|
-
self.truc.compute_persistence()
|
|
14625
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
14367
14626
|
if keep_inf:
|
|
14368
14627
|
bcs = tuple(np.asarray(stuff, dtype = np.int32) for stuff in self.truc.get_barcode())
|
|
14369
14628
|
else:
|
|
@@ -14373,7 +14632,7 @@ cdef class _Slicer_GudhiCohomology0_i32:
|
|
|
14373
14632
|
bcs = _Slicer_GudhiCohomology0_i32._bc_to_full(bcs, basepoint, direction)
|
|
14374
14633
|
return bcs
|
|
14375
14634
|
|
|
14376
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
14635
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
14377
14636
|
"""
|
|
14378
14637
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
14379
14638
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -14384,11 +14643,11 @@ cdef class _Slicer_GudhiCohomology0_i32:
|
|
|
14384
14643
|
if directions is None:
|
|
14385
14644
|
c_basepoints = basepoints
|
|
14386
14645
|
with nogil:
|
|
14387
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
14646
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
14388
14647
|
else:
|
|
14389
14648
|
c_truc = zip(basepoints,directions)
|
|
14390
14649
|
with nogil:
|
|
14391
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
14650
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
14392
14651
|
cdef int num_bc = c_basepoints.size()
|
|
14393
14652
|
|
|
14394
14653
|
if keep_inf:
|
|
@@ -14695,6 +14954,13 @@ cdef class _Slicer_GudhiCohomology0_i64:
|
|
|
14695
14954
|
self.truc = C_Slicer_GudhiCohomology0_i64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
14696
14955
|
self.minpres_degree = -1
|
|
14697
14956
|
|
|
14957
|
+
def to_colexical(self)->_Slicer_GudhiCohomology0_i64:
|
|
14958
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
14959
|
+
new_slicer = _Slicer_GudhiCohomology0_i64()
|
|
14960
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
14961
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
14962
|
+
return new_slicer
|
|
14963
|
+
|
|
14698
14964
|
def copy(self)->_Slicer_GudhiCohomology0_i64:
|
|
14699
14965
|
"""
|
|
14700
14966
|
Returns a copy of the slicer.
|
|
@@ -14738,7 +15004,7 @@ cdef class _Slicer_GudhiCohomology0_i64:
|
|
|
14738
15004
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
14739
15005
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
14740
15006
|
|
|
14741
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
15007
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
14742
15008
|
"""
|
|
14743
15009
|
Computes the persistence on a line L defined by
|
|
14744
15010
|
- a basepoint (num_parameters,) array
|
|
@@ -14747,7 +15013,7 @@ cdef class _Slicer_GudhiCohomology0_i64:
|
|
|
14747
15013
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
14748
15014
|
"""
|
|
14749
15015
|
self.push_to_line(basepoint,direction)
|
|
14750
|
-
self.truc.compute_persistence()
|
|
15016
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
14751
15017
|
if keep_inf:
|
|
14752
15018
|
bcs = tuple(np.asarray(stuff, dtype = np.int64) for stuff in self.truc.get_barcode())
|
|
14753
15019
|
else:
|
|
@@ -14757,7 +15023,7 @@ cdef class _Slicer_GudhiCohomology0_i64:
|
|
|
14757
15023
|
bcs = _Slicer_GudhiCohomology0_i64._bc_to_full(bcs, basepoint, direction)
|
|
14758
15024
|
return bcs
|
|
14759
15025
|
|
|
14760
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
15026
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
14761
15027
|
"""
|
|
14762
15028
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
14763
15029
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -14768,11 +15034,11 @@ cdef class _Slicer_GudhiCohomology0_i64:
|
|
|
14768
15034
|
if directions is None:
|
|
14769
15035
|
c_basepoints = basepoints
|
|
14770
15036
|
with nogil:
|
|
14771
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
15037
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
14772
15038
|
else:
|
|
14773
15039
|
c_truc = zip(basepoints,directions)
|
|
14774
15040
|
with nogil:
|
|
14775
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
15041
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
14776
15042
|
cdef int num_bc = c_basepoints.size()
|
|
14777
15043
|
|
|
14778
15044
|
if keep_inf:
|
|
@@ -15079,6 +15345,13 @@ cdef class _Slicer_GudhiCohomology0_f32:
|
|
|
15079
15345
|
self.truc = C_Slicer_GudhiCohomology0_f32(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
15080
15346
|
self.minpres_degree = -1
|
|
15081
15347
|
|
|
15348
|
+
def to_colexical(self)->_Slicer_GudhiCohomology0_f32:
|
|
15349
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
15350
|
+
new_slicer = _Slicer_GudhiCohomology0_f32()
|
|
15351
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
15352
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
15353
|
+
return new_slicer
|
|
15354
|
+
|
|
15082
15355
|
def copy(self)->_Slicer_GudhiCohomology0_f32:
|
|
15083
15356
|
"""
|
|
15084
15357
|
Returns a copy of the slicer.
|
|
@@ -15122,7 +15395,7 @@ cdef class _Slicer_GudhiCohomology0_f32:
|
|
|
15122
15395
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
15123
15396
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
15124
15397
|
|
|
15125
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
15398
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
15126
15399
|
"""
|
|
15127
15400
|
Computes the persistence on a line L defined by
|
|
15128
15401
|
- a basepoint (num_parameters,) array
|
|
@@ -15131,7 +15404,7 @@ cdef class _Slicer_GudhiCohomology0_f32:
|
|
|
15131
15404
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
15132
15405
|
"""
|
|
15133
15406
|
self.push_to_line(basepoint,direction)
|
|
15134
|
-
self.truc.compute_persistence()
|
|
15407
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
15135
15408
|
if keep_inf:
|
|
15136
15409
|
bcs = tuple(np.asarray(stuff, dtype = np.float32) for stuff in self.truc.get_barcode())
|
|
15137
15410
|
else:
|
|
@@ -15141,7 +15414,7 @@ cdef class _Slicer_GudhiCohomology0_f32:
|
|
|
15141
15414
|
bcs = _Slicer_GudhiCohomology0_f32._bc_to_full(bcs, basepoint, direction)
|
|
15142
15415
|
return bcs
|
|
15143
15416
|
|
|
15144
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
15417
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
15145
15418
|
"""
|
|
15146
15419
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
15147
15420
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -15152,11 +15425,11 @@ cdef class _Slicer_GudhiCohomology0_f32:
|
|
|
15152
15425
|
if directions is None:
|
|
15153
15426
|
c_basepoints = basepoints
|
|
15154
15427
|
with nogil:
|
|
15155
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
15428
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
15156
15429
|
else:
|
|
15157
15430
|
c_truc = zip(basepoints,directions)
|
|
15158
15431
|
with nogil:
|
|
15159
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
15432
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
15160
15433
|
cdef int num_bc = c_basepoints.size()
|
|
15161
15434
|
|
|
15162
15435
|
if keep_inf:
|
|
@@ -15463,6 +15736,13 @@ cdef class _Slicer_GudhiCohomology0_f64:
|
|
|
15463
15736
|
self.truc = C_Slicer_GudhiCohomology0_f64(c_generator_maps,c_generator_dimensions, c_filtration_values)
|
|
15464
15737
|
self.minpres_degree = -1
|
|
15465
15738
|
|
|
15739
|
+
def to_colexical(self)->_Slicer_GudhiCohomology0_f64:
|
|
15740
|
+
assert not self.is_squeezed, "Unsqueeze first"
|
|
15741
|
+
new_slicer = _Slicer_GudhiCohomology0_f64()
|
|
15742
|
+
new_slicer.truc = self.truc.colexical_rearange()
|
|
15743
|
+
new_slicer.minpres_degree = self.minpres_degree
|
|
15744
|
+
return new_slicer
|
|
15745
|
+
|
|
15466
15746
|
def copy(self)->_Slicer_GudhiCohomology0_f64:
|
|
15467
15747
|
"""
|
|
15468
15748
|
Returns a copy of the slicer.
|
|
@@ -15506,7 +15786,7 @@ cdef class _Slicer_GudhiCohomology0_f64:
|
|
|
15506
15786
|
direction = 1 if direction is None else np.asarray(direction)[None,None,:]
|
|
15507
15787
|
return tuple(bc[:,:,None]*direction + basepoint for bc in bcs)
|
|
15508
15788
|
|
|
15509
|
-
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False):
|
|
15789
|
+
def persistence_on_line(self,basepoint,direction=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
15510
15790
|
"""
|
|
15511
15791
|
Computes the persistence on a line L defined by
|
|
15512
15792
|
- a basepoint (num_parameters,) array
|
|
@@ -15515,7 +15795,7 @@ cdef class _Slicer_GudhiCohomology0_f64:
|
|
|
15515
15795
|
Warning: This is not parallelizable. Use `persitence_on_lines`.
|
|
15516
15796
|
"""
|
|
15517
15797
|
self.push_to_line(basepoint,direction)
|
|
15518
|
-
self.truc.compute_persistence()
|
|
15798
|
+
self.truc.compute_persistence(ignore_infinite_filtration_values)
|
|
15519
15799
|
if keep_inf:
|
|
15520
15800
|
bcs = tuple(np.asarray(stuff, dtype = np.float64) for stuff in self.truc.get_barcode())
|
|
15521
15801
|
else:
|
|
@@ -15525,7 +15805,7 @@ cdef class _Slicer_GudhiCohomology0_f64:
|
|
|
15525
15805
|
bcs = _Slicer_GudhiCohomology0_f64._bc_to_full(bcs, basepoint, direction)
|
|
15526
15806
|
return bcs
|
|
15527
15807
|
|
|
15528
|
-
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False):
|
|
15808
|
+
def persistence_on_lines(self, basepoints=None, directions=None, bool keep_inf=True, bool full=False, bool ignore_infinite_filtration_values = True):
|
|
15529
15809
|
"""
|
|
15530
15810
|
Same as `persistence_on_line`, but with vineyards operation between
|
|
15531
15811
|
lines if `self.is_vine`, and in parallel otherwise.
|
|
@@ -15536,11 +15816,11 @@ cdef class _Slicer_GudhiCohomology0_f64:
|
|
|
15536
15816
|
if directions is None:
|
|
15537
15817
|
c_basepoints = basepoints
|
|
15538
15818
|
with nogil:
|
|
15539
|
-
c_out = self.truc.persistence_on_lines(c_basepoints)
|
|
15819
|
+
c_out = self.truc.persistence_on_lines(c_basepoints, ignore_infinite_filtration_values)
|
|
15540
15820
|
else:
|
|
15541
15821
|
c_truc = zip(basepoints,directions)
|
|
15542
15822
|
with nogil:
|
|
15543
|
-
c_out = self.truc.persistence_on_lines(c_truc)
|
|
15823
|
+
c_out = self.truc.persistence_on_lines(c_truc, ignore_infinite_filtration_values)
|
|
15544
15824
|
cdef int num_bc = c_basepoints.size()
|
|
15545
15825
|
|
|
15546
15826
|
if keep_inf:
|
|
@@ -15851,9 +16131,9 @@ def from_function_delaunay(
|
|
|
15851
16131
|
backend : slicer backend, e.g. "matrix", "clement"
|
|
15852
16132
|
vineyard : bool, use a vineyard-compatible backend
|
|
15853
16133
|
"""
|
|
15854
|
-
from multipers.io import
|
|
16134
|
+
from multipers.io import _check_available, function_delaunay_presentation_to_slicer
|
|
15855
16135
|
s = multipers.Slicer(None, backend=backend, vineyard=vineyard, dtype=dtype)
|
|
15856
|
-
|
|
16136
|
+
assert _check_available("function_delaunay"), f"Could not find function_delaunay"
|
|
15857
16137
|
function_delaunay_presentation_to_slicer(s, points, grades, degree=degree, verbose=verbose,clear=clear)
|
|
15858
16138
|
if degree >= 0:
|
|
15859
16139
|
s.minpres_degree = degree
|
|
@@ -15897,12 +16177,12 @@ def minimal_presentation(
|
|
|
15897
16177
|
and returns it as a slicer.
|
|
15898
16178
|
Backends differents than `mpfree` are unstable.
|
|
15899
16179
|
"""
|
|
15900
|
-
from multipers.io import
|
|
16180
|
+
from multipers.io import _check_available, input_path, scc_reduce_from_str_to_slicer
|
|
15901
16181
|
if is_slicer(slicer) and slicer.is_minpres and not force:
|
|
15902
16182
|
from warnings import warn
|
|
15903
16183
|
warn(f"The slicer seems to be already reduced, from homology of degree {slicer.minpres_degree}.")
|
|
15904
16184
|
return slicer
|
|
15905
|
-
|
|
16185
|
+
assert _check_available(backend), f"Backend {backend} is not available."
|
|
15906
16186
|
if len(degrees)>0:
|
|
15907
16187
|
def todo(int degree):
|
|
15908
16188
|
return minimal_presentation(slicer, degree=degree, backend=backend, slicer_backend=slicer_backend, vineyard=vineyard, id=id, **minpres_kwargs)
|