multipers 2.4.0b1__tar.gz → 2.4.2b1__tar.gz
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.
- {multipers-2.4.0b1 → multipers-2.4.2b1}/PKG-INFO +4 -2
- {multipers-2.4.0b1 → multipers-2.4.2b1}/README.md +3 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/_tempita_grid_gen.py +9 -7
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/__init__.py +9 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/_signed_measure_meta.py +3 -2
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/_slicer_meta.py +7 -9
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/array_api/__init__.py +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/array_api/numpy.py +34 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/array_api/torch.py +33 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/filtration_conversions.pxd +294 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/filtrations/density.py +57 -54
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/filtrations/filtrations.py +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/filtrations.pxd +240 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/function_rips.pyx +0 -11
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/grids.pyx +180 -88
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/Persistence_slices_interface.h +62 -51
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Degree_rips_bifiltration.h +10 -7
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Dynamic_multi_parameter_filtration.h +18 -4
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Fields/Multi_field.h +5 -3
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Fields/Multi_field_operators.h +5 -3
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Fields/Multi_field_shared.h +5 -3
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Fields/Multi_field_small.h +5 -3
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Fields/Multi_field_small_operators.h +5 -3
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Fields/Multi_field_small_shared.h +5 -3
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Fields/Z2_field.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Fields/Zp_field.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Matrix.h +13 -13
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Multi_filtration/Multi_parameter_generator.h +10 -5
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Multi_parameter_filtered_complex.h +27 -39
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Multi_parameter_filtration.h +26 -15
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Multi_persistence/Line.h +13 -2
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Multi_persistence/Multi_parameter_filtered_complex_pcoh_interface.h +16 -31
- multipers-2.4.2b1/multipers/gudhi/gudhi/Multi_persistence/Persistence_interface_cohomology.h +211 -0
- multipers-2.4.2b1/multipers/gudhi/gudhi/Multi_persistence/Persistence_interface_homology.h +255 -0
- multipers-2.4.2b1/multipers/gudhi/gudhi/Multi_persistence/Persistence_interface_vineyard.h +138 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/Base_matrix.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/Base_matrix_with_column_compression.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/Boundary_matrix.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/Chain_matrix.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/Id_to_index_overlay.h +11 -11
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/Position_to_index_overlay.h +11 -11
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/RU_matrix.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/base_pairing.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/base_swap.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/chain_pairing.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/chain_rep_cycles.h +22 -22
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/chain_vine_swap.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/columns/chain_column_extra_properties.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/columns/column_dimension_holder.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/columns/entry_types.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/columns/heap_column.h +3 -2
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/columns/intrusive_list_column.h +3 -2
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/columns/intrusive_set_column.h +6 -4
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/columns/list_column.h +3 -2
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/columns/naive_vector_column.h +3 -2
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/columns/row_access.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/columns/set_column.h +3 -2
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/columns/unordered_set_column.h +3 -2
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/columns/vector_column.h +3 -2
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/index_mapper.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/matrix_dimension_holders.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/matrix_row_access.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/ru_pairing.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/ru_rep_cycles.h +9 -9
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/ru_vine_swap.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Projective_cover_kernel.h +7 -6
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Slicer.h +59 -104
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Thread_safe_slicer.h +21 -22
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/persistence_matrix_options.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/slicer_helpers.h +52 -37
- multipers-2.4.2b1/multipers/gudhi/gudhi/vineyard_base.h +286 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/io.pyx +42 -35
- multipers-2.4.0b1/multipers/ml/point_clouds.py → multipers-2.4.2b1/multipers/ml/filtered_complex.py +142 -101
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/ml/mma.py +10 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/ml/signed_measures.py +109 -80
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/ml/sliced_wasserstein.py +157 -29
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/mma_structures.pxd +2 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/mma_structures.pyx +1499 -80
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/mma_structures.pyx.tp +10 -3
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/multi_parameter_rank_invariant/hilbert_function.h +151 -195
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/multi_parameter_rank_invariant/persistence_slices.h +45 -49
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/multi_parameter_rank_invariant/rank_invariant.h +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/multiparameter_module_approximation/approximation.h +216 -172
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/multiparameter_module_approximation.pyx +11 -8
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/ops.pyx +20 -12
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/plots.py +126 -56
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/simplex_tree_multi.pyx +11827 -447
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/simplex_tree_multi.pyx.tp +11 -3
- multipers-2.4.2b1/multipers/slicer.pxd +5611 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/slicer.pxd.tp +6 -5
- multipers-2.4.2b1/multipers/slicer.pyx +35578 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/slicer.pyx.tp +26 -9
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers.egg-info/PKG-INFO +4 -2
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers.egg-info/SOURCES.txt +4 -5
- {multipers-2.4.0b1 → multipers-2.4.2b1}/pyproject.toml +1 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/setup.py +3 -1
- {multipers-2.4.0b1 → multipers-2.4.2b1}/tests/test_grids.py +75 -4
- {multipers-2.4.0b1 → multipers-2.4.2b1}/tests/test_mma.py +0 -2
- {multipers-2.4.0b1 → multipers-2.4.2b1}/tests/test_parallel.py +0 -2
- {multipers-2.4.0b1 → multipers-2.4.2b1}/tests/test_point_clouds.py +13 -7
- {multipers-2.4.0b1 → multipers-2.4.2b1}/tests/test_slicer.py +7 -0
- multipers-2.4.0b1/multipers/gudhi/gudhi/Multi_persistence/Persistence_interface_cohomology.h +0 -159
- multipers-2.4.0b1/multipers/gudhi/gudhi/Multi_persistence/Persistence_interface_matrix.h +0 -463
- multipers-2.4.0b1/multipers/slicer.pxd +0 -2097
- multipers-2.4.0b1/multipers/slicer.pyx +0 -13042
- multipers-2.4.0b1/multipers/torch/__init__.py +0 -1
- multipers-2.4.0b1/multipers/torch/diff_grids.py +0 -240
- multipers-2.4.0b1/multipers/torch/rips_density.py +0 -310
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/aida.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/birth_death.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/brute_force_mpm_decomposition.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/generate_decompositions.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/include/aida_interface.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/include/config.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/include/option_parser.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/include/types.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/making_examples.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/minimize_pres.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/mpfree_clone.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/presentation_to_quiver.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/presentation_to_quiver_new.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/resolution.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/src/aida_decompose.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/src/aida_decompose.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/src/aida_functions.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/src/aida_functions.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/src/aida_helpers.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/src/aida_helpers.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/src/aida_interface.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/src/block.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/src/block.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/src/config.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/src/option_parser.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/AIDA/vectorspace_decompositions.cpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/LICENSE +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/MANIFEST.in +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/bitset_algebra.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/column_types.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/dense_matrix.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/draw_hf.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/general.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/graded_linalg.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/graded_matrix.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/grid_scheduler.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/homomorphisms.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/matrix_base.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/modules.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/orders_and_graphs.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/r2graded_matrix.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/r3graded_matrix.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/sparse_matrix.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/Persistence-Algebra/include/grlina/to_quiver.hpp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/data/MOL2.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/data/UCR.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/data/__init__.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/data/graphs.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/data/immuno_regions.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/data/minimal_presentation_to_st_bf.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/data/pytorch2simplextree.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/data/shape3d.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/data/synthetic.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/distances.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/filtration_conversions.pxd.tp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/filtrations/__init__.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/filtrations.pxd.tp +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/Simplex_tree_interface.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/Simplex_tree_multi_interface.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Bitmap_cubical_complex.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Bitmap_cubical_complex_base.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Debug_utils.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Fields/Z2_field_operators.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Fields/Zp_field_operators.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Fields/Zp_field_shared.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Flag_complex_edge_collapser.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Multi_filtration/multi_filtration_conversions.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Multi_filtration/multi_filtration_utils.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Multi_persistence/Box.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Multi_persistence/Point.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Off_reader.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/allocators/entry_constructors.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_matrix/columns/column_utilities.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_on_a_line.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistence_on_rectangle.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistent_cohomology/Field_Zp.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistent_cohomology/Multi_field.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistent_cohomology/Persistent_cohomology_column.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Persistent_cohomology.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Points_off_io.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Simple_object_pool.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Simplex_tree/Simplex_tree_iterators.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Simplex_tree/Simplex_tree_siblings.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Simplex_tree/Simplex_tree_star_simplex_iterators.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Simplex_tree/filtration_value_utils.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Simplex_tree/hooks_simplex_base.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Simplex_tree/indexing_tag.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Simplex_tree/serialization_utils.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Simplex_tree/simplex_tree_options.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/Simplex_tree.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/distance_functions.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/graph_simplicial_complex.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/multi_simplex_tree_helpers.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/persistence_interval.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/reader_utils.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/gudhi/simple_mdspan.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/tmp_h0_pers/mma_interface_h0.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/gudhi/tmp_h0_pers/naive_merge_tree.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/ml/__init__.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/ml/accuracies.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/ml/invariants_with_persistable.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/ml/kernels.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/ml/one.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/ml/tools.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/multi_parameter_rank_invariant/diff_helpers.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/multi_parameter_rank_invariant/euler_characteristic.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/multi_parameter_rank_invariant/function_rips.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/multiparameter_edge_collapse.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/multiparameter_module_approximation/debug.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/multiparameter_module_approximation/format_python-cpp.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/multiparameter_module_approximation/utilities.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/pickle.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/point_measure.pyx +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/simplex_tree_multi.pxd +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/tensor/tensor.h +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/tensor.pxd +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/test.pyx +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/tests/__init__.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers/vector_interface.pxd +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers.egg-info/dependency_links.txt +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers.egg-info/requires.txt +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/multipers.egg-info/top_level.txt +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/setup.cfg +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/tests/test_aida.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/tests/test_diff_helper.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/tests/test_filtrations.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/tests/test_hilbert_function.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/tests/test_python-cpp_conversion.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/tests/test_signed_betti.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/tests/test_signed_measure.py +0 -0
- {multipers-2.4.0b1 → multipers-2.4.2b1}/tests/test_simplextreemulti.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: multipers
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.2b1
|
|
4
4
|
Summary: Multiparameter Topological Persistence for Machine Learning
|
|
5
5
|
Author-email: David Loiseaux <david.lapous@proton.me>, Hannah Schreiber <hannah.schreiber@inria.fr>
|
|
6
6
|
Maintainer-email: David Loiseaux <david.lapous@proton.me>
|
|
@@ -86,11 +86,13 @@ This library features a bunch of different functions and helpers. See below for
|
|
|
86
86
|
- [x] [[Differentiability and Optimization of Multiparameter Persistent Homology, ICML2024]](https://proceedings.mlr.press/v235/scoccola24a.html) An approach to compute a (clarke) gradient for any reasonable multiparameter persistent invariant. Currently, any `multipers` computation is auto-differentiable using this strategy, provided that the input are pytorch gradient capable tensor.
|
|
87
87
|
- [x] [[Multiparameter Persistence Landscapes, JMLR]](https://jmlr.org/papers/v21/19-054.html) A vectorization technic for multiparameter persistence modules.
|
|
88
88
|
- [x] [[Filtration-Domination in Bifiltered Graphs, ALENEX2023]](https://doi.org/10.1137/1.9781611977561.ch3) Allows for 2-parameter edge collapses for 1-critical clique complexes. Very useful to speed up, e.g., Rips-Codensity bifiltrations.
|
|
89
|
+
- [x] [[Fast free resolutions of bifiltered chain complexes]](https://arxiv.org/abs/2512.08652) One-critical representation of multicritical filtrations, using [multi_critical](https://bitbucket.org/mkerber/multi_critical).
|
|
89
90
|
- [x] [[Chunk Reduction for Multi-Parameter Persistent Homology, SoCG2019]](https://doi.org/10.4230/LIPIcs.SoCG.2019.37) Multi-filtration preprocessing algorithm for homology computations.
|
|
90
91
|
- [x] [[Computing Minimal Presentations and Bigraded Betti Numbers of 2-Parameter Persistent Homology, JAAG]](https://doi.org/10.1137/20M1388425) Minimal presentation of multiparameter persistence modules, using [mpfree](https://bitbucket.org/mkerber/mpfree/src/master/). Hilbert, Rank Decomposition Signed Measures, and MMA decompositions can be computed using the mpfree backend.
|
|
91
|
-
- [
|
|
92
|
+
- [x] [WIP] [[Decomposing Multiparameter Persistence Modules, SoCG2025]](https://doi.org/10.4230/LIPIcs.SoCG.2025.41) Using the [AIDA](https://github.com/JanJend/AIDA) and [Persistence-Algebra](https://github.com/JanJend/Persistence-Algebra/) libraries.
|
|
92
93
|
- [x] [[Delaunay Bifiltrations of Functions on Point Clouds, SODA2024]](https://epubs.siam.org/doi/10.1137/1.9781611977912.173) Provides an alternative to function rips bifiltrations, using Delaunay complexes. Very good alternative to Rips-Density like bifiltrations.
|
|
93
94
|
- [x] [[Delaunay Core Bifiltration]](https://arxiv.org/abs/2405.01214) Bifiltration for point clouds, taking into account the density. Similar to Rips-Density.
|
|
95
|
+
- [x] [[Computing the Multicover Bifiltration, SOCG2021]](https://doi.org/10.4230/LIPIcs.SoCG.2021.27) Rhomboid Tiling bifiltration. Equivalent to the multicover bifiltration, using [rhomboidtiling](https://github.com/geoo89/rhomboidtiling).
|
|
94
96
|
- [x] [[Rivet]](https://github.com/rivetTDA/rivet) Interactive two parameter persistence
|
|
95
97
|
- [x] [[Kernel Operations on the GPU, with Autodiff, without Memory Overflows, JMLR]](http://jmlr.org/papers/v22/20-275.html) Although not linked, at first glance, to persistence in any way, this library allows computing blazingly fast signed measures convolutions (and more!) with custom kernels.
|
|
96
98
|
- [ ] [Backend only] [[Projected distances for multi-parameter persistence modules]](https://arxiv.org/abs/2206.08818) Provides a strategy to estimate the convolution distance between multiparameter persistence module using projected barcodes. Implementation is a WIP.
|
|
@@ -48,11 +48,13 @@ This library features a bunch of different functions and helpers. See below for
|
|
|
48
48
|
- [x] [[Differentiability and Optimization of Multiparameter Persistent Homology, ICML2024]](https://proceedings.mlr.press/v235/scoccola24a.html) An approach to compute a (clarke) gradient for any reasonable multiparameter persistent invariant. Currently, any `multipers` computation is auto-differentiable using this strategy, provided that the input are pytorch gradient capable tensor.
|
|
49
49
|
- [x] [[Multiparameter Persistence Landscapes, JMLR]](https://jmlr.org/papers/v21/19-054.html) A vectorization technic for multiparameter persistence modules.
|
|
50
50
|
- [x] [[Filtration-Domination in Bifiltered Graphs, ALENEX2023]](https://doi.org/10.1137/1.9781611977561.ch3) Allows for 2-parameter edge collapses for 1-critical clique complexes. Very useful to speed up, e.g., Rips-Codensity bifiltrations.
|
|
51
|
+
- [x] [[Fast free resolutions of bifiltered chain complexes]](https://arxiv.org/abs/2512.08652) One-critical representation of multicritical filtrations, using [multi_critical](https://bitbucket.org/mkerber/multi_critical).
|
|
51
52
|
- [x] [[Chunk Reduction for Multi-Parameter Persistent Homology, SoCG2019]](https://doi.org/10.4230/LIPIcs.SoCG.2019.37) Multi-filtration preprocessing algorithm for homology computations.
|
|
52
53
|
- [x] [[Computing Minimal Presentations and Bigraded Betti Numbers of 2-Parameter Persistent Homology, JAAG]](https://doi.org/10.1137/20M1388425) Minimal presentation of multiparameter persistence modules, using [mpfree](https://bitbucket.org/mkerber/mpfree/src/master/). Hilbert, Rank Decomposition Signed Measures, and MMA decompositions can be computed using the mpfree backend.
|
|
53
|
-
- [
|
|
54
|
+
- [x] [WIP] [[Decomposing Multiparameter Persistence Modules, SoCG2025]](https://doi.org/10.4230/LIPIcs.SoCG.2025.41) Using the [AIDA](https://github.com/JanJend/AIDA) and [Persistence-Algebra](https://github.com/JanJend/Persistence-Algebra/) libraries.
|
|
54
55
|
- [x] [[Delaunay Bifiltrations of Functions on Point Clouds, SODA2024]](https://epubs.siam.org/doi/10.1137/1.9781611977912.173) Provides an alternative to function rips bifiltrations, using Delaunay complexes. Very good alternative to Rips-Density like bifiltrations.
|
|
55
56
|
- [x] [[Delaunay Core Bifiltration]](https://arxiv.org/abs/2405.01214) Bifiltration for point clouds, taking into account the density. Similar to Rips-Density.
|
|
57
|
+
- [x] [[Computing the Multicover Bifiltration, SOCG2021]](https://doi.org/10.4230/LIPIcs.SoCG.2021.27) Rhomboid Tiling bifiltration. Equivalent to the multicover bifiltration, using [rhomboidtiling](https://github.com/geoo89/rhomboidtiling).
|
|
56
58
|
- [x] [[Rivet]](https://github.com/rivetTDA/rivet) Interactive two parameter persistence
|
|
57
59
|
- [x] [[Kernel Operations on the GPU, with Autodiff, without Memory Overflows, JMLR]](http://jmlr.org/papers/v22/20-275.html) Although not linked, at first glance, to persistence in any way, this library allows computing blazingly fast signed measures convolutions (and more!) with custom kernels.
|
|
58
60
|
- [ ] [Backend only] [[Projected distances for multi-parameter persistence modules]](https://arxiv.org/abs/2206.08818) Provides a strategy to estimate the convolution distance between multiparameter persistence module using projected barcodes. Implementation is a WIP.
|
|
@@ -24,13 +24,13 @@ columns_name = [ # only one column is necessary
|
|
|
24
24
|
## Value types : CTYPE, PYTHON_TYPE, short
|
|
25
25
|
value_types = [
|
|
26
26
|
("int32_t", "np.int32", "i32"), # necessary
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
("int64_t", "np.int64", "i64"),
|
|
28
|
+
("float", "np.float32", "f32"),
|
|
29
29
|
("double", "np.float64", "f64"), # necessary
|
|
30
30
|
]
|
|
31
31
|
COARSENNED_VALUE_TYPE = ("int32_t", "np.int32", "i32")
|
|
32
32
|
REAL_VALUE_TYPE = ("double", "np.float64", "f64")
|
|
33
|
-
|
|
33
|
+
assert COARSENNED_VALUE_TYPE in value_types and REAL_VALUE_TYPE in value_types
|
|
34
34
|
|
|
35
35
|
## True needed for MMA, and False is default value
|
|
36
36
|
vineyards_values = [
|
|
@@ -52,7 +52,7 @@ matrix_types = [
|
|
|
52
52
|
"Matrix", # necessary
|
|
53
53
|
# "Graph",
|
|
54
54
|
# "Clement",
|
|
55
|
-
|
|
55
|
+
"GudhiCohomology",
|
|
56
56
|
]
|
|
57
57
|
|
|
58
58
|
filtration_containers = [
|
|
@@ -88,11 +88,11 @@ def check_combination(
|
|
|
88
88
|
if backend_type in ["Graph", "GudhiCohomology"]:
|
|
89
89
|
if column_type[0] != 0:
|
|
90
90
|
return False
|
|
91
|
-
if filtration_container == "
|
|
91
|
+
if filtration_container == "Degree_rips_bifiltration":
|
|
92
92
|
if not is_kcritical:
|
|
93
93
|
return False
|
|
94
|
-
if value_type[0] == "f":
|
|
95
|
-
|
|
94
|
+
# if value_type[-1][0] == "f": # needed for mma
|
|
95
|
+
# return False
|
|
96
96
|
return True
|
|
97
97
|
|
|
98
98
|
|
|
@@ -224,6 +224,8 @@ print("#----------------------")
|
|
|
224
224
|
print("Slicers")
|
|
225
225
|
print("#----------------------")
|
|
226
226
|
print("#----------------------")
|
|
227
|
+
print(*[s["PYTHON_TYPE"] for s in slicers], sep="\n")
|
|
228
|
+
print("----------------------")
|
|
227
229
|
print(*slicers, sep="\n")
|
|
228
230
|
with open("build/tmp/_slicer_names.pkl", "wb") as f:
|
|
229
231
|
pickle.dump(slicers, f)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from importlib.metadata import version as _version
|
|
2
|
+
import sys
|
|
2
3
|
|
|
3
4
|
__version__ = _version("multipers")
|
|
4
5
|
# Doc
|
|
@@ -11,12 +12,16 @@ from multipers import (
|
|
|
11
12
|
simplex_tree_multi,
|
|
12
13
|
slicer,
|
|
13
14
|
)
|
|
14
|
-
|
|
15
|
+
|
|
16
|
+
if sys.platform != "win32":
|
|
17
|
+
from multipers import ops
|
|
18
|
+
|
|
15
19
|
|
|
16
20
|
# Shortcuts
|
|
17
21
|
from multipers._slicer_meta import Slicer
|
|
18
22
|
from multipers.multiparameter_module_approximation import module_approximation
|
|
19
23
|
from multipers.simplex_tree_multi import SimplexTreeMulti
|
|
24
|
+
from multipers._signed_measure_meta import signed_measure
|
|
20
25
|
|
|
21
26
|
__all__ = [
|
|
22
27
|
"data",
|
|
@@ -31,3 +36,6 @@ __all__ = [
|
|
|
31
36
|
"module_approximation",
|
|
32
37
|
"SimplexTreeMulti",
|
|
33
38
|
]
|
|
39
|
+
|
|
40
|
+
if sys.platform != "win32":
|
|
41
|
+
__all__.append("ops")
|
|
@@ -162,7 +162,7 @@ def signed_measure(
|
|
|
162
162
|
grid = filtered_complex.filtration_grid
|
|
163
163
|
|
|
164
164
|
if mass_default is None:
|
|
165
|
-
|
|
165
|
+
pass
|
|
166
166
|
elif isinstance(mass_default, str):
|
|
167
167
|
if mass_default == "auto":
|
|
168
168
|
mass_default = np.array([1.1 * np.max(f) - 0.1 * np.min(f) for f in grid])
|
|
@@ -228,7 +228,7 @@ def signed_measure(
|
|
|
228
228
|
zero_pad=fix_mass_default,
|
|
229
229
|
# grid_shape=tuple(len(g) for g in grid),
|
|
230
230
|
ignore_inf=ignore_infinite_filtration_values,
|
|
231
|
-
verbose=verbose
|
|
231
|
+
verbose=verbose,
|
|
232
232
|
)
|
|
233
233
|
fix_mass_default = False
|
|
234
234
|
if verbose:
|
|
@@ -300,6 +300,7 @@ def signed_measure(
|
|
|
300
300
|
mass_default=mass_default,
|
|
301
301
|
degrees=degrees,
|
|
302
302
|
expand_collapse=expand_collapse,
|
|
303
|
+
n_jobs=n_jobs,
|
|
303
304
|
)
|
|
304
305
|
fix_mass_default = False
|
|
305
306
|
if verbose:
|
|
@@ -52,8 +52,7 @@ def _blocks2boundary_dimension_grades(
|
|
|
52
52
|
b[0] if len(b[0]) > 0 else np.empty((0, num_parameters))
|
|
53
53
|
for b in rblocks
|
|
54
54
|
),
|
|
55
|
-
|
|
56
|
-
)
|
|
55
|
+
).astype(filtration_type)
|
|
57
56
|
boundary = tuple(x + S[i] for i, b in enumerate(rblocks) for x in b[1])
|
|
58
57
|
dimensions = np.fromiter(
|
|
59
58
|
(i for i, b in enumerate(rblocks) for _ in range(len(b[0]))), dtype=int
|
|
@@ -62,6 +61,7 @@ def _blocks2boundary_dimension_grades(
|
|
|
62
61
|
|
|
63
62
|
|
|
64
63
|
def _slicer_from_simplextree(st, backend, vineyard):
|
|
64
|
+
backend = backend.lower() if isinstance(backend, str) else backend
|
|
65
65
|
if vineyard:
|
|
66
66
|
if backend == "matrix":
|
|
67
67
|
slicer = mps._SlicerVineSimplicial(st)
|
|
@@ -132,10 +132,6 @@ def Slicer(
|
|
|
132
132
|
- `multipers.module_approximation(this, *args)`
|
|
133
133
|
- `multipers.signed_measure(this, *args)`
|
|
134
134
|
|
|
135
|
-
Note : it is recommended and sometime required to apply
|
|
136
|
-
a minimal presentation before computing these functions !
|
|
137
|
-
`mp.slicer.minimal_presentation(slicer, *args, **kwargs)`
|
|
138
|
-
|
|
139
135
|
Input
|
|
140
136
|
-----
|
|
141
137
|
- st : SimplexTreeMulti or scc-like blocks or path to scc file
|
|
@@ -176,7 +172,7 @@ def Slicer(
|
|
|
176
172
|
else:
|
|
177
173
|
vineyard = False if vineyard is None else vineyard
|
|
178
174
|
column_type = "INTRUSIVE_SET" if column_type is None else column_type
|
|
179
|
-
backend = "
|
|
175
|
+
backend = "matrix" if backend is None else backend
|
|
180
176
|
|
|
181
177
|
_Slicer = mps.get_matrix_slicer(
|
|
182
178
|
is_vineyard=vineyard,
|
|
@@ -193,7 +189,7 @@ def Slicer(
|
|
|
193
189
|
return _Slicer()
|
|
194
190
|
elif mps.is_slicer(st):
|
|
195
191
|
slicer = _Slicer(st)
|
|
196
|
-
elif is_simplextree_multi(st) and backend == "
|
|
192
|
+
elif is_simplextree_multi(st) and backend == "graph":
|
|
197
193
|
slicer = _slicer_from_simplextree(st, backend, vineyard)
|
|
198
194
|
if st.is_squeezed:
|
|
199
195
|
slicer.filtration_grid = st.filtration_grid
|
|
@@ -222,7 +218,9 @@ You can try using `multipers.slicer.to_simplextree`."""
|
|
|
222
218
|
filtration_container,
|
|
223
219
|
)
|
|
224
220
|
if reduce:
|
|
225
|
-
|
|
221
|
+
from multipers.ops import minimal_presentation
|
|
222
|
+
|
|
223
|
+
slicer = minimal_presentation(
|
|
226
224
|
slicer,
|
|
227
225
|
backend=reduce_backend,
|
|
228
226
|
slicer_backend=backend,
|
|
@@ -24,8 +24,19 @@ searchsorted = _np.searchsorted
|
|
|
24
24
|
LazyTensor = None
|
|
25
25
|
abs = _np.abs
|
|
26
26
|
exp = _np.exp
|
|
27
|
+
log = _np.log
|
|
27
28
|
sin = _np.sin
|
|
28
29
|
cos = _np.cos
|
|
30
|
+
matmul = _np.matmul
|
|
31
|
+
einsum = _np.einsum
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def argsort(x, axis=-1):
|
|
35
|
+
return _np.argsort(x, axis=axis)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def astype(x, dtype):
|
|
39
|
+
return astensor(x).astype(dtype=dtype)
|
|
29
40
|
|
|
30
41
|
|
|
31
42
|
def clip(x, min=None, max=None):
|
|
@@ -122,3 +133,26 @@ def is_promotable(x):
|
|
|
122
133
|
|
|
123
134
|
def has_grad(_):
|
|
124
135
|
return False
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def to_device(x, device):
|
|
139
|
+
if device is None or str(device) in {"None", "cpu"}:
|
|
140
|
+
return x
|
|
141
|
+
raise ValueError(
|
|
142
|
+
f"NumPy backend only supports CPU tensors, requested device {device!r}."
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def size(x):
|
|
147
|
+
return int(_np.size(x))
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def dtype_is_float(dtype):
|
|
151
|
+
try:
|
|
152
|
+
return _np.issubdtype(_np.dtype(dtype), _np.floating)
|
|
153
|
+
except TypeError:
|
|
154
|
+
return False
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def dtype_default():
|
|
158
|
+
return _np.array(0.0).dtype
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import numpy as _np
|
|
2
2
|
import torch as _t
|
|
3
|
+
import multipers.array_api as _mpapi
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
_mpapi.available_api.append(sys.modules[__name__])
|
|
3
7
|
|
|
4
8
|
backend = _t
|
|
5
9
|
cat = _t.cat
|
|
@@ -23,8 +27,19 @@ LazyTensor = None
|
|
|
23
27
|
relu = _t.relu
|
|
24
28
|
abs = _t.abs
|
|
25
29
|
exp = _t.exp
|
|
30
|
+
log = _t.log
|
|
26
31
|
sin = _t.sin
|
|
27
32
|
cos = _t.cos
|
|
33
|
+
matmul = _t.matmul
|
|
34
|
+
einsum = _t.einsum
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def argsort(x, axis=-1):
|
|
38
|
+
return _t.argsort(x, dim=axis)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def astype(x, dtype):
|
|
42
|
+
return astensor(x).type(dtype)
|
|
28
43
|
|
|
29
44
|
|
|
30
45
|
_is_keops_available = None
|
|
@@ -34,7 +49,6 @@ def clip(x, min=None, max=None):
|
|
|
34
49
|
return _t.clamp(x, min, max)
|
|
35
50
|
|
|
36
51
|
|
|
37
|
-
|
|
38
52
|
def split_with_sizes(arr, sizes):
|
|
39
53
|
return arr.split_with_sizes(sizes)
|
|
40
54
|
|
|
@@ -131,3 +145,21 @@ def is_promotable(x):
|
|
|
131
145
|
|
|
132
146
|
def has_grad(x):
|
|
133
147
|
return x.requires_grad
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def to_device(x, device):
|
|
151
|
+
if device is None:
|
|
152
|
+
return x
|
|
153
|
+
return x.to(device)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def size(x):
|
|
157
|
+
return x.numel()
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def dtype_is_float(dtype):
|
|
161
|
+
return getattr(dtype, "is_floating_point", False)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def dtype_default():
|
|
165
|
+
return _t.get_default_dtype()
|
|
@@ -516,6 +516,158 @@ cdef inline vector[Flat_i32] python_2_vect_Flat_i32(int32_t[:,:] filtrations) no
|
|
|
516
516
|
f[j] = filtrations[i,j]
|
|
517
517
|
out.emplace_back(f)
|
|
518
518
|
return out
|
|
519
|
+
cdef inline KFlat_i64_2_python(KFlat_i64* x, bool copy=False, bool raw=False):
|
|
520
|
+
cdef Py_ssize_t k = dereference(x).num_generators()
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
cdef int num_parameters = 2
|
|
524
|
+
|
|
525
|
+
cdef int64_t[:] data_view = <int64_t[:k]>(&(dereference(x)(0,0)))
|
|
526
|
+
numpy_view = np.asarray(data_view, dtype=np.int64)
|
|
527
|
+
if raw:
|
|
528
|
+
return numpy_view
|
|
529
|
+
return np.concatenate([numpy_view[:,None], np.arange(k, dtype=np.int64)[:,None]], axis=1)
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
cdef inline vect_KFlat_i64_2_python(vector[KFlat_i64]& x, bool copy = False, bool raw=False):
|
|
533
|
+
cdef Py_ssize_t num_stuff = x.size()
|
|
534
|
+
return [KFlat_i64_2_python(&(x[i]), copy=copy, raw=raw) for i in range(num_stuff)]
|
|
535
|
+
|
|
536
|
+
cdef inline KFlat_i64 python_2_KFlat_i64(int64_t[:,:] filtrations) noexcept nogil:
|
|
537
|
+
cdef vector[double] f = vector[double](filtrations.shape[0] * filtrations.shape[1])
|
|
538
|
+
cdef int k = 0;
|
|
539
|
+
for i in range(filtrations.shape[0]):
|
|
540
|
+
for j in range(filtrations.shape[1]):
|
|
541
|
+
f[k] = filtrations[i,j]
|
|
542
|
+
k = k + 1
|
|
543
|
+
cdef KFlat_i64 out = KFlat_i64(f.begin(), f.end(), filtrations.shape[1])
|
|
544
|
+
out.simplify()
|
|
545
|
+
return out
|
|
546
|
+
|
|
547
|
+
cdef inline vector[KFlat_i64] python_2_vect_KFlat_i64(int64_t[:,:] filtrations) noexcept nogil:
|
|
548
|
+
# cdef double[:,:] filtrations = np.asarray(filtrations_, dtype=np.float64)
|
|
549
|
+
cdef vector[KFlat_i64] out
|
|
550
|
+
cdef vector[int64_t] f = vector[int64_t](filtrations.shape[1])
|
|
551
|
+
out.reserve(filtrations.shape[0])
|
|
552
|
+
for i in range(filtrations.shape[0]):
|
|
553
|
+
for j in range(filtrations.shape[1]):
|
|
554
|
+
f[j] = filtrations[i,j]
|
|
555
|
+
out.emplace_back(f)
|
|
556
|
+
return out
|
|
557
|
+
cdef inline Flat_i64_2_python(Flat_i64* x, bool copy=False, bool raw=False):
|
|
558
|
+
cdef Py_ssize_t k = dereference(x).num_generators()
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
cdef int num_parameters = 2
|
|
562
|
+
|
|
563
|
+
cdef int64_t[:] data_view = <int64_t[:k]>(&(dereference(x)(0,0)))
|
|
564
|
+
numpy_view = np.asarray(data_view, dtype=np.int64)
|
|
565
|
+
if raw:
|
|
566
|
+
return numpy_view
|
|
567
|
+
return np.concatenate([numpy_view[:,None], np.arange(k, dtype=np.int64)[:,None]], axis=1)
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
cdef inline vect_Flat_i64_2_python(vector[Flat_i64]& x, bool copy = False, bool raw=False):
|
|
571
|
+
cdef Py_ssize_t num_stuff = x.size()
|
|
572
|
+
return [Flat_i64_2_python(&(x[i]), copy=copy, raw=raw) for i in range(num_stuff)]
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
cdef inline Flat_i64 python_2_Flat_i64(int64_t[:] filtration) noexcept nogil:
|
|
577
|
+
cdef int num_parameters = filtration.shape[0]
|
|
578
|
+
cdef Flat_i64 out = Flat_i64(num_parameters)
|
|
579
|
+
cdef int64_t* x
|
|
580
|
+
for i in range(num_parameters):
|
|
581
|
+
x = &out(0,i)
|
|
582
|
+
x[0] = filtration[i]
|
|
583
|
+
return out
|
|
584
|
+
|
|
585
|
+
cdef inline vector[Flat_i64] python_2_vect_Flat_i64(int64_t[:,:] filtrations) noexcept nogil:
|
|
586
|
+
# cdef double[:,:] filtrations = np.asarray(filtrations_, dtype=np.float64)
|
|
587
|
+
cdef vector[Flat_i64] out
|
|
588
|
+
cdef vector[int64_t] f = vector[int64_t](filtrations.shape[1])
|
|
589
|
+
out.reserve(filtrations.shape[0])
|
|
590
|
+
for i in range(filtrations.shape[0]):
|
|
591
|
+
for j in range(filtrations.shape[1]):
|
|
592
|
+
f[j] = filtrations[i,j]
|
|
593
|
+
out.emplace_back(f)
|
|
594
|
+
return out
|
|
595
|
+
cdef inline KFlat_f32_2_python(KFlat_f32* x, bool copy=False, bool raw=False):
|
|
596
|
+
cdef Py_ssize_t k = dereference(x).num_generators()
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
cdef int num_parameters = 2
|
|
600
|
+
|
|
601
|
+
cdef float[:] data_view = <float[:k]>(&(dereference(x)(0,0)))
|
|
602
|
+
numpy_view = np.asarray(data_view, dtype=np.float32)
|
|
603
|
+
if raw:
|
|
604
|
+
return numpy_view
|
|
605
|
+
return np.concatenate([numpy_view[:,None], np.arange(k, dtype=np.float32)[:,None]], axis=1)
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
cdef inline vect_KFlat_f32_2_python(vector[KFlat_f32]& x, bool copy = False, bool raw=False):
|
|
609
|
+
cdef Py_ssize_t num_stuff = x.size()
|
|
610
|
+
return [KFlat_f32_2_python(&(x[i]), copy=copy, raw=raw) for i in range(num_stuff)]
|
|
611
|
+
|
|
612
|
+
cdef inline KFlat_f32 python_2_KFlat_f32(float[:,:] filtrations) noexcept nogil:
|
|
613
|
+
cdef vector[double] f = vector[double](filtrations.shape[0] * filtrations.shape[1])
|
|
614
|
+
cdef int k = 0;
|
|
615
|
+
for i in range(filtrations.shape[0]):
|
|
616
|
+
for j in range(filtrations.shape[1]):
|
|
617
|
+
f[k] = filtrations[i,j]
|
|
618
|
+
k = k + 1
|
|
619
|
+
cdef KFlat_f32 out = KFlat_f32(f.begin(), f.end(), filtrations.shape[1])
|
|
620
|
+
out.simplify()
|
|
621
|
+
return out
|
|
622
|
+
|
|
623
|
+
cdef inline vector[KFlat_f32] python_2_vect_KFlat_f32(float[:,:] filtrations) noexcept nogil:
|
|
624
|
+
# cdef double[:,:] filtrations = np.asarray(filtrations_, dtype=np.float64)
|
|
625
|
+
cdef vector[KFlat_f32] out
|
|
626
|
+
cdef vector[float] f = vector[float](filtrations.shape[1])
|
|
627
|
+
out.reserve(filtrations.shape[0])
|
|
628
|
+
for i in range(filtrations.shape[0]):
|
|
629
|
+
for j in range(filtrations.shape[1]):
|
|
630
|
+
f[j] = filtrations[i,j]
|
|
631
|
+
out.emplace_back(f)
|
|
632
|
+
return out
|
|
633
|
+
cdef inline Flat_f32_2_python(Flat_f32* x, bool copy=False, bool raw=False):
|
|
634
|
+
cdef Py_ssize_t k = dereference(x).num_generators()
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
cdef int num_parameters = 2
|
|
638
|
+
|
|
639
|
+
cdef float[:] data_view = <float[:k]>(&(dereference(x)(0,0)))
|
|
640
|
+
numpy_view = np.asarray(data_view, dtype=np.float32)
|
|
641
|
+
if raw:
|
|
642
|
+
return numpy_view
|
|
643
|
+
return np.concatenate([numpy_view[:,None], np.arange(k, dtype=np.float32)[:,None]], axis=1)
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
cdef inline vect_Flat_f32_2_python(vector[Flat_f32]& x, bool copy = False, bool raw=False):
|
|
647
|
+
cdef Py_ssize_t num_stuff = x.size()
|
|
648
|
+
return [Flat_f32_2_python(&(x[i]), copy=copy, raw=raw) for i in range(num_stuff)]
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
cdef inline Flat_f32 python_2_Flat_f32(float[:] filtration) noexcept nogil:
|
|
653
|
+
cdef int num_parameters = filtration.shape[0]
|
|
654
|
+
cdef Flat_f32 out = Flat_f32(num_parameters)
|
|
655
|
+
cdef float* x
|
|
656
|
+
for i in range(num_parameters):
|
|
657
|
+
x = &out(0,i)
|
|
658
|
+
x[0] = filtration[i]
|
|
659
|
+
return out
|
|
660
|
+
|
|
661
|
+
cdef inline vector[Flat_f32] python_2_vect_Flat_f32(float[:,:] filtrations) noexcept nogil:
|
|
662
|
+
# cdef double[:,:] filtrations = np.asarray(filtrations_, dtype=np.float64)
|
|
663
|
+
cdef vector[Flat_f32] out
|
|
664
|
+
cdef vector[float] f = vector[float](filtrations.shape[1])
|
|
665
|
+
out.reserve(filtrations.shape[0])
|
|
666
|
+
for i in range(filtrations.shape[0]):
|
|
667
|
+
for j in range(filtrations.shape[1]):
|
|
668
|
+
f[j] = filtrations[i,j]
|
|
669
|
+
out.emplace_back(f)
|
|
670
|
+
return out
|
|
519
671
|
cdef inline KFlat_f64_2_python(KFlat_f64* x, bool copy=False, bool raw=False):
|
|
520
672
|
cdef Py_ssize_t k = dereference(x).num_generators()
|
|
521
673
|
|
|
@@ -663,6 +815,148 @@ cdef inline vector[Contiguous_i32] python_2_vect_Contiguous_i32(int32_t[:,:] fil
|
|
|
663
815
|
f[j] = filtrations[i,j]
|
|
664
816
|
out.emplace_back(f)
|
|
665
817
|
return out
|
|
818
|
+
cdef inline KContiguous_i64_2_python(KContiguous_i64* x, bool copy=False, bool raw=False):
|
|
819
|
+
cdef Py_ssize_t k = dereference(x).num_generators()
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
cdef Py_ssize_t p = dereference(x).num_parameters()
|
|
823
|
+
if dereference(x).is_finite():
|
|
824
|
+
duplicate = 0
|
|
825
|
+
else:
|
|
826
|
+
duplicate = p
|
|
827
|
+
# TODO : make it contiguous
|
|
828
|
+
return [_ff21cview2_i64(&(dereference(x)(i,0)), p, duplicate, copy=copy) for i in range(k)]
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
cdef inline vect_KContiguous_i64_2_python(vector[KContiguous_i64]& x, bool copy = False, bool raw=False):
|
|
832
|
+
cdef Py_ssize_t num_stuff = x.size()
|
|
833
|
+
return [KContiguous_i64_2_python(&(x[i]), copy=copy, raw=raw) for i in range(num_stuff)]
|
|
834
|
+
|
|
835
|
+
cdef inline KContiguous_i64 python_2_KContiguous_i64(int64_t[:,:] filtrations) noexcept nogil:
|
|
836
|
+
cdef vector[double] f = vector[double](filtrations.shape[0] * filtrations.shape[1])
|
|
837
|
+
cdef int k = 0;
|
|
838
|
+
for i in range(filtrations.shape[0]):
|
|
839
|
+
for j in range(filtrations.shape[1]):
|
|
840
|
+
f[k] = filtrations[i,j]
|
|
841
|
+
k = k + 1
|
|
842
|
+
cdef KContiguous_i64 out = KContiguous_i64(f.begin(), f.end(), filtrations.shape[1])
|
|
843
|
+
out.simplify()
|
|
844
|
+
return out
|
|
845
|
+
|
|
846
|
+
cdef inline vector[KContiguous_i64] python_2_vect_KContiguous_i64(int64_t[:,:] filtrations) noexcept nogil:
|
|
847
|
+
# cdef double[:,:] filtrations = np.asarray(filtrations_, dtype=np.float64)
|
|
848
|
+
cdef vector[KContiguous_i64] out
|
|
849
|
+
cdef vector[int64_t] f = vector[int64_t](filtrations.shape[1])
|
|
850
|
+
out.reserve(filtrations.shape[0])
|
|
851
|
+
for i in range(filtrations.shape[0]):
|
|
852
|
+
for j in range(filtrations.shape[1]):
|
|
853
|
+
f[j] = filtrations[i,j]
|
|
854
|
+
out.emplace_back(f)
|
|
855
|
+
return out
|
|
856
|
+
# Assumes it's contiguous
|
|
857
|
+
cdef inline Contiguous_i64_2_python(Contiguous_i64* x, bool copy=False, bool raw=False):
|
|
858
|
+
cdef Py_ssize_t num_parameters = dereference(x).num_parameters()
|
|
859
|
+
if not dereference(x).is_finite():
|
|
860
|
+
return np.full(shape=num_parameters, fill_value=dereference(x)(0,0))
|
|
861
|
+
cdef int64_t[:] x_view = <int64_t[:num_parameters]>(&(dereference(x)(0,0)))
|
|
862
|
+
return np.array(x_view) if copy else np.asarray(x_view)
|
|
863
|
+
|
|
864
|
+
cdef inline vect_Contiguous_i64_2_python(vector[Contiguous_i64]& x, bool copy = False, bool raw=False):
|
|
865
|
+
cdef Py_ssize_t num_stuff = x.size()
|
|
866
|
+
return [Contiguous_i64_2_python(&(x[i]), copy=copy, raw=raw) for i in range(num_stuff)]
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
cdef inline Contiguous_i64 python_2_Contiguous_i64(int64_t[:] filtration) noexcept nogil:
|
|
871
|
+
cdef int num_parameters = filtration.shape[0]
|
|
872
|
+
cdef Contiguous_i64 out = Contiguous_i64(num_parameters)
|
|
873
|
+
cdef int64_t* x
|
|
874
|
+
for i in range(num_parameters):
|
|
875
|
+
x = &out(0,i)
|
|
876
|
+
x[0] = filtration[i]
|
|
877
|
+
return out
|
|
878
|
+
|
|
879
|
+
cdef inline vector[Contiguous_i64] python_2_vect_Contiguous_i64(int64_t[:,:] filtrations) noexcept nogil:
|
|
880
|
+
# cdef double[:,:] filtrations = np.asarray(filtrations_, dtype=np.float64)
|
|
881
|
+
cdef vector[Contiguous_i64] out
|
|
882
|
+
cdef vector[int64_t] f = vector[int64_t](filtrations.shape[1])
|
|
883
|
+
out.reserve(filtrations.shape[0])
|
|
884
|
+
for i in range(filtrations.shape[0]):
|
|
885
|
+
for j in range(filtrations.shape[1]):
|
|
886
|
+
f[j] = filtrations[i,j]
|
|
887
|
+
out.emplace_back(f)
|
|
888
|
+
return out
|
|
889
|
+
cdef inline KContiguous_f32_2_python(KContiguous_f32* x, bool copy=False, bool raw=False):
|
|
890
|
+
cdef Py_ssize_t k = dereference(x).num_generators()
|
|
891
|
+
|
|
892
|
+
|
|
893
|
+
cdef Py_ssize_t p = dereference(x).num_parameters()
|
|
894
|
+
if dereference(x).is_finite():
|
|
895
|
+
duplicate = 0
|
|
896
|
+
else:
|
|
897
|
+
duplicate = p
|
|
898
|
+
# TODO : make it contiguous
|
|
899
|
+
return [_ff21cview2_f32(&(dereference(x)(i,0)), p, duplicate, copy=copy) for i in range(k)]
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
cdef inline vect_KContiguous_f32_2_python(vector[KContiguous_f32]& x, bool copy = False, bool raw=False):
|
|
903
|
+
cdef Py_ssize_t num_stuff = x.size()
|
|
904
|
+
return [KContiguous_f32_2_python(&(x[i]), copy=copy, raw=raw) for i in range(num_stuff)]
|
|
905
|
+
|
|
906
|
+
cdef inline KContiguous_f32 python_2_KContiguous_f32(float[:,:] filtrations) noexcept nogil:
|
|
907
|
+
cdef vector[double] f = vector[double](filtrations.shape[0] * filtrations.shape[1])
|
|
908
|
+
cdef int k = 0;
|
|
909
|
+
for i in range(filtrations.shape[0]):
|
|
910
|
+
for j in range(filtrations.shape[1]):
|
|
911
|
+
f[k] = filtrations[i,j]
|
|
912
|
+
k = k + 1
|
|
913
|
+
cdef KContiguous_f32 out = KContiguous_f32(f.begin(), f.end(), filtrations.shape[1])
|
|
914
|
+
out.simplify()
|
|
915
|
+
return out
|
|
916
|
+
|
|
917
|
+
cdef inline vector[KContiguous_f32] python_2_vect_KContiguous_f32(float[:,:] filtrations) noexcept nogil:
|
|
918
|
+
# cdef double[:,:] filtrations = np.asarray(filtrations_, dtype=np.float64)
|
|
919
|
+
cdef vector[KContiguous_f32] out
|
|
920
|
+
cdef vector[float] f = vector[float](filtrations.shape[1])
|
|
921
|
+
out.reserve(filtrations.shape[0])
|
|
922
|
+
for i in range(filtrations.shape[0]):
|
|
923
|
+
for j in range(filtrations.shape[1]):
|
|
924
|
+
f[j] = filtrations[i,j]
|
|
925
|
+
out.emplace_back(f)
|
|
926
|
+
return out
|
|
927
|
+
# Assumes it's contiguous
|
|
928
|
+
cdef inline Contiguous_f32_2_python(Contiguous_f32* x, bool copy=False, bool raw=False):
|
|
929
|
+
cdef Py_ssize_t num_parameters = dereference(x).num_parameters()
|
|
930
|
+
if not dereference(x).is_finite():
|
|
931
|
+
return np.full(shape=num_parameters, fill_value=dereference(x)(0,0))
|
|
932
|
+
cdef float[:] x_view = <float[:num_parameters]>(&(dereference(x)(0,0)))
|
|
933
|
+
return np.array(x_view) if copy else np.asarray(x_view)
|
|
934
|
+
|
|
935
|
+
cdef inline vect_Contiguous_f32_2_python(vector[Contiguous_f32]& x, bool copy = False, bool raw=False):
|
|
936
|
+
cdef Py_ssize_t num_stuff = x.size()
|
|
937
|
+
return [Contiguous_f32_2_python(&(x[i]), copy=copy, raw=raw) for i in range(num_stuff)]
|
|
938
|
+
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
cdef inline Contiguous_f32 python_2_Contiguous_f32(float[:] filtration) noexcept nogil:
|
|
942
|
+
cdef int num_parameters = filtration.shape[0]
|
|
943
|
+
cdef Contiguous_f32 out = Contiguous_f32(num_parameters)
|
|
944
|
+
cdef float* x
|
|
945
|
+
for i in range(num_parameters):
|
|
946
|
+
x = &out(0,i)
|
|
947
|
+
x[0] = filtration[i]
|
|
948
|
+
return out
|
|
949
|
+
|
|
950
|
+
cdef inline vector[Contiguous_f32] python_2_vect_Contiguous_f32(float[:,:] filtrations) noexcept nogil:
|
|
951
|
+
# cdef double[:,:] filtrations = np.asarray(filtrations_, dtype=np.float64)
|
|
952
|
+
cdef vector[Contiguous_f32] out
|
|
953
|
+
cdef vector[float] f = vector[float](filtrations.shape[1])
|
|
954
|
+
out.reserve(filtrations.shape[0])
|
|
955
|
+
for i in range(filtrations.shape[0]):
|
|
956
|
+
for j in range(filtrations.shape[1]):
|
|
957
|
+
f[j] = filtrations[i,j]
|
|
958
|
+
out.emplace_back(f)
|
|
959
|
+
return out
|
|
666
960
|
cdef inline KContiguous_f64_2_python(KContiguous_f64* x, bool copy=False, bool raw=False):
|
|
667
961
|
cdef Py_ssize_t k = dereference(x).num_generators()
|
|
668
962
|
|