passagemath-modules 10.6.31rc3__cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of passagemath-modules might be problematic. Click here for more details.
- passagemath_modules-10.6.31rc3.dist-info/METADATA +281 -0
- passagemath_modules-10.6.31rc3.dist-info/RECORD +807 -0
- passagemath_modules-10.6.31rc3.dist-info/WHEEL +6 -0
- passagemath_modules-10.6.31rc3.dist-info/top_level.txt +2 -0
- passagemath_modules.libs/libgfortran-83c28eba.so.5.0.0 +0 -0
- passagemath_modules.libs/libgmp-6e109695.so.10.5.0 +0 -0
- passagemath_modules.libs/libgsl-cda90e79.so.28.0.0 +0 -0
- passagemath_modules.libs/libmpc-7f678fcf.so.3.3.1 +0 -0
- passagemath_modules.libs/libmpfr-82690d50.so.6.2.1 +0 -0
- passagemath_modules.libs/libopenblasp-r0-6dcb67f9.3.29.so +0 -0
- passagemath_modules.libs/libquadmath-2284e583.so.0.0.0 +0 -0
- sage/algebras/all__sagemath_modules.py +20 -0
- sage/algebras/catalog.py +148 -0
- sage/algebras/clifford_algebra.py +3107 -0
- sage/algebras/clifford_algebra_element.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/algebras/clifford_algebra_element.pxd +16 -0
- sage/algebras/clifford_algebra_element.pyx +997 -0
- sage/algebras/commutative_dga.py +4252 -0
- sage/algebras/exterior_algebra_groebner.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/algebras/exterior_algebra_groebner.pxd +55 -0
- sage/algebras/exterior_algebra_groebner.pyx +727 -0
- sage/algebras/finite_dimensional_algebras/all.py +2 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py +1029 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pxd +12 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pyx +706 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_ideal.py +196 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_morphism.py +255 -0
- sage/algebras/finite_gca.py +528 -0
- sage/algebras/group_algebra.py +232 -0
- sage/algebras/lie_algebras/abelian.py +197 -0
- sage/algebras/lie_algebras/affine_lie_algebra.py +1213 -0
- sage/algebras/lie_algebras/all.py +25 -0
- sage/algebras/lie_algebras/all__sagemath_modules.py +1 -0
- sage/algebras/lie_algebras/bch.py +177 -0
- sage/algebras/lie_algebras/bgg_dual_module.py +1184 -0
- sage/algebras/lie_algebras/bgg_resolution.py +232 -0
- sage/algebras/lie_algebras/center_uea.py +767 -0
- sage/algebras/lie_algebras/classical_lie_algebra.py +2516 -0
- sage/algebras/lie_algebras/examples.py +683 -0
- sage/algebras/lie_algebras/free_lie_algebra.py +973 -0
- sage/algebras/lie_algebras/heisenberg.py +820 -0
- sage/algebras/lie_algebras/lie_algebra.py +1562 -0
- sage/algebras/lie_algebras/lie_algebra_element.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/algebras/lie_algebras/lie_algebra_element.pxd +68 -0
- sage/algebras/lie_algebras/lie_algebra_element.pyx +2122 -0
- sage/algebras/lie_algebras/morphism.py +661 -0
- sage/algebras/lie_algebras/nilpotent_lie_algebra.py +457 -0
- sage/algebras/lie_algebras/onsager.py +1324 -0
- sage/algebras/lie_algebras/poincare_birkhoff_witt.py +816 -0
- sage/algebras/lie_algebras/quotient.py +462 -0
- sage/algebras/lie_algebras/rank_two_heisenberg_virasoro.py +355 -0
- sage/algebras/lie_algebras/representation.py +1040 -0
- sage/algebras/lie_algebras/structure_coefficients.py +459 -0
- sage/algebras/lie_algebras/subalgebra.py +967 -0
- sage/algebras/lie_algebras/symplectic_derivation.py +289 -0
- sage/algebras/lie_algebras/verma_module.py +1630 -0
- sage/algebras/lie_algebras/virasoro.py +1186 -0
- sage/algebras/octonion_algebra.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/algebras/octonion_algebra.pxd +20 -0
- sage/algebras/octonion_algebra.pyx +987 -0
- sage/algebras/orlik_solomon.py +907 -0
- sage/algebras/orlik_terao.py +779 -0
- sage/algebras/steenrod/all.py +7 -0
- sage/algebras/steenrod/steenrod_algebra.py +4258 -0
- sage/algebras/steenrod/steenrod_algebra_bases.py +1179 -0
- sage/algebras/steenrod/steenrod_algebra_misc.py +1167 -0
- sage/algebras/steenrod/steenrod_algebra_mult.py +954 -0
- sage/algebras/weyl_algebra.py +1126 -0
- sage/all__sagemath_modules.py +62 -0
- sage/calculus/all__sagemath_modules.py +19 -0
- sage/calculus/expr.py +205 -0
- sage/calculus/integration.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/calculus/integration.pyx +698 -0
- sage/calculus/interpolation.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/calculus/interpolation.pxd +13 -0
- sage/calculus/interpolation.pyx +387 -0
- sage/calculus/interpolators.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/calculus/interpolators.pyx +326 -0
- sage/calculus/ode.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/calculus/ode.pxd +5 -0
- sage/calculus/ode.pyx +610 -0
- sage/calculus/riemann.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/calculus/riemann.pyx +1521 -0
- sage/calculus/test_sympy.py +201 -0
- sage/calculus/transforms/all.py +7 -0
- sage/calculus/transforms/dft.py +844 -0
- sage/calculus/transforms/dwt.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/calculus/transforms/dwt.pxd +7 -0
- sage/calculus/transforms/dwt.pyx +160 -0
- sage/calculus/transforms/fft.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/calculus/transforms/fft.pxd +12 -0
- sage/calculus/transforms/fft.pyx +487 -0
- sage/calculus/wester.py +662 -0
- sage/coding/abstract_code.py +1108 -0
- sage/coding/ag_code.py +868 -0
- sage/coding/ag_code_decoders.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/coding/ag_code_decoders.pyx +2639 -0
- sage/coding/all.py +15 -0
- sage/coding/bch_code.py +494 -0
- sage/coding/binary_code.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/coding/binary_code.pxd +124 -0
- sage/coding/binary_code.pyx +4139 -0
- sage/coding/bounds_catalog.py +43 -0
- sage/coding/channel.py +819 -0
- sage/coding/channels_catalog.py +29 -0
- sage/coding/code_bounds.py +755 -0
- sage/coding/code_constructions.py +804 -0
- sage/coding/codes_catalog.py +111 -0
- sage/coding/cyclic_code.py +1329 -0
- sage/coding/databases.py +316 -0
- sage/coding/decoder.py +373 -0
- sage/coding/decoders_catalog.py +88 -0
- sage/coding/delsarte_bounds.py +709 -0
- sage/coding/encoder.py +390 -0
- sage/coding/encoders_catalog.py +64 -0
- sage/coding/extended_code.py +468 -0
- sage/coding/gabidulin_code.py +1058 -0
- sage/coding/golay_code.py +404 -0
- sage/coding/goppa_code.py +441 -0
- sage/coding/grs_code.py +2371 -0
- sage/coding/guava.py +107 -0
- sage/coding/guruswami_sudan/all.py +1 -0
- sage/coding/guruswami_sudan/gs_decoder.py +897 -0
- sage/coding/guruswami_sudan/interpolation.py +409 -0
- sage/coding/guruswami_sudan/utils.py +176 -0
- sage/coding/hamming_code.py +176 -0
- sage/coding/information_set_decoder.py +1032 -0
- sage/coding/kasami_codes.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/coding/kasami_codes.pyx +351 -0
- sage/coding/linear_code.py +3067 -0
- sage/coding/linear_code_no_metric.py +1354 -0
- sage/coding/linear_rank_metric.py +961 -0
- sage/coding/parity_check_code.py +353 -0
- sage/coding/punctured_code.py +719 -0
- sage/coding/reed_muller_code.py +999 -0
- sage/coding/self_dual_codes.py +942 -0
- sage/coding/source_coding/all.py +2 -0
- sage/coding/source_coding/huffman.py +553 -0
- sage/coding/subfield_subcode.py +423 -0
- sage/coding/two_weight_db.py +399 -0
- sage/combinat/all__sagemath_modules.py +7 -0
- sage/combinat/cartesian_product.py +347 -0
- sage/combinat/family.py +11 -0
- sage/combinat/free_module.py +1977 -0
- sage/combinat/root_system/all.py +147 -0
- sage/combinat/root_system/ambient_space.py +527 -0
- sage/combinat/root_system/associahedron.py +471 -0
- sage/combinat/root_system/braid_move_calculator.py +143 -0
- sage/combinat/root_system/braid_orbit.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/combinat/root_system/braid_orbit.pyx +144 -0
- sage/combinat/root_system/branching_rules.py +2301 -0
- sage/combinat/root_system/cartan_matrix.py +1245 -0
- sage/combinat/root_system/cartan_type.py +3069 -0
- sage/combinat/root_system/coxeter_group.py +162 -0
- sage/combinat/root_system/coxeter_matrix.py +1261 -0
- sage/combinat/root_system/coxeter_type.py +681 -0
- sage/combinat/root_system/dynkin_diagram.py +900 -0
- sage/combinat/root_system/extended_affine_weyl_group.py +2993 -0
- sage/combinat/root_system/fundamental_group.py +795 -0
- sage/combinat/root_system/hecke_algebra_representation.py +1203 -0
- sage/combinat/root_system/integrable_representations.py +1227 -0
- sage/combinat/root_system/non_symmetric_macdonald_polynomials.py +1965 -0
- sage/combinat/root_system/pieri_factors.py +1147 -0
- sage/combinat/root_system/plot.py +1615 -0
- sage/combinat/root_system/root_lattice_realization_algebras.py +1214 -0
- sage/combinat/root_system/root_lattice_realizations.py +4628 -0
- sage/combinat/root_system/root_space.py +487 -0
- sage/combinat/root_system/root_system.py +882 -0
- sage/combinat/root_system/type_A.py +348 -0
- sage/combinat/root_system/type_A_affine.py +227 -0
- sage/combinat/root_system/type_A_infinity.py +241 -0
- sage/combinat/root_system/type_B.py +347 -0
- sage/combinat/root_system/type_BC_affine.py +287 -0
- sage/combinat/root_system/type_B_affine.py +216 -0
- sage/combinat/root_system/type_C.py +317 -0
- sage/combinat/root_system/type_C_affine.py +188 -0
- sage/combinat/root_system/type_D.py +357 -0
- sage/combinat/root_system/type_D_affine.py +208 -0
- sage/combinat/root_system/type_E.py +641 -0
- sage/combinat/root_system/type_E_affine.py +231 -0
- sage/combinat/root_system/type_F.py +387 -0
- sage/combinat/root_system/type_F_affine.py +137 -0
- sage/combinat/root_system/type_G.py +293 -0
- sage/combinat/root_system/type_G_affine.py +132 -0
- sage/combinat/root_system/type_H.py +105 -0
- sage/combinat/root_system/type_I.py +110 -0
- sage/combinat/root_system/type_Q.py +150 -0
- sage/combinat/root_system/type_affine.py +509 -0
- sage/combinat/root_system/type_dual.py +704 -0
- sage/combinat/root_system/type_folded.py +301 -0
- sage/combinat/root_system/type_marked.py +748 -0
- sage/combinat/root_system/type_reducible.py +601 -0
- sage/combinat/root_system/type_relabel.py +730 -0
- sage/combinat/root_system/type_super_A.py +837 -0
- sage/combinat/root_system/weight_lattice_realizations.py +1188 -0
- sage/combinat/root_system/weight_space.py +639 -0
- sage/combinat/root_system/weyl_characters.py +2238 -0
- sage/crypto/__init__.py +4 -0
- sage/crypto/all.py +28 -0
- sage/crypto/block_cipher/all.py +7 -0
- sage/crypto/block_cipher/des.py +1065 -0
- sage/crypto/block_cipher/miniaes.py +2171 -0
- sage/crypto/block_cipher/present.py +909 -0
- sage/crypto/block_cipher/sdes.py +1527 -0
- sage/crypto/boolean_function.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/crypto/boolean_function.pxd +10 -0
- sage/crypto/boolean_function.pyx +1487 -0
- sage/crypto/cipher.py +78 -0
- sage/crypto/classical.py +3668 -0
- sage/crypto/classical_cipher.py +569 -0
- sage/crypto/cryptosystem.py +387 -0
- sage/crypto/key_exchange/all.py +7 -0
- sage/crypto/key_exchange/catalog.py +24 -0
- sage/crypto/key_exchange/diffie_hellman.py +323 -0
- sage/crypto/key_exchange/key_exchange_scheme.py +107 -0
- sage/crypto/lattice.py +312 -0
- sage/crypto/lfsr.py +295 -0
- sage/crypto/lwe.py +840 -0
- sage/crypto/mq/__init__.py +4 -0
- sage/crypto/mq/mpolynomialsystemgenerator.py +204 -0
- sage/crypto/mq/rijndael_gf.py +2345 -0
- sage/crypto/mq/sbox.py +7 -0
- sage/crypto/mq/sr.py +3344 -0
- sage/crypto/public_key/all.py +5 -0
- sage/crypto/public_key/blum_goldwasser.py +776 -0
- sage/crypto/sbox.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/crypto/sbox.pyx +2090 -0
- sage/crypto/sboxes.py +2090 -0
- sage/crypto/stream.py +390 -0
- sage/crypto/stream_cipher.py +297 -0
- sage/crypto/util.py +519 -0
- sage/ext/all__sagemath_modules.py +1 -0
- sage/ext/interpreters/__init__.py +1 -0
- sage/ext/interpreters/all__sagemath_modules.py +2 -0
- sage/ext/interpreters/wrapper_cc.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/ext/interpreters/wrapper_cc.pxd +30 -0
- sage/ext/interpreters/wrapper_cc.pyx +252 -0
- sage/ext/interpreters/wrapper_cdf.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/ext/interpreters/wrapper_cdf.pxd +26 -0
- sage/ext/interpreters/wrapper_cdf.pyx +245 -0
- sage/ext/interpreters/wrapper_rdf.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/ext/interpreters/wrapper_rdf.pxd +23 -0
- sage/ext/interpreters/wrapper_rdf.pyx +221 -0
- sage/ext/interpreters/wrapper_rr.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/ext/interpreters/wrapper_rr.pxd +28 -0
- sage/ext/interpreters/wrapper_rr.pyx +335 -0
- sage/geometry/all__sagemath_modules.py +5 -0
- sage/geometry/toric_lattice.py +1745 -0
- sage/geometry/toric_lattice_element.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/geometry/toric_lattice_element.pyx +432 -0
- sage/groups/abelian_gps/abelian_group.py +1925 -0
- sage/groups/abelian_gps/abelian_group_element.py +164 -0
- sage/groups/abelian_gps/all__sagemath_modules.py +5 -0
- sage/groups/abelian_gps/dual_abelian_group.py +421 -0
- sage/groups/abelian_gps/dual_abelian_group_element.py +179 -0
- sage/groups/abelian_gps/element_base.py +341 -0
- sage/groups/abelian_gps/values.py +488 -0
- sage/groups/additive_abelian/additive_abelian_group.py +476 -0
- sage/groups/additive_abelian/additive_abelian_wrapper.py +857 -0
- sage/groups/additive_abelian/all.py +4 -0
- sage/groups/additive_abelian/qmodnz.py +231 -0
- sage/groups/additive_abelian/qmodnz_element.py +349 -0
- sage/groups/affine_gps/affine_group.py +535 -0
- sage/groups/affine_gps/all.py +1 -0
- sage/groups/affine_gps/catalog.py +17 -0
- sage/groups/affine_gps/euclidean_group.py +246 -0
- sage/groups/affine_gps/group_element.py +562 -0
- sage/groups/all__sagemath_modules.py +12 -0
- sage/groups/galois_group.py +479 -0
- sage/groups/matrix_gps/all.py +4 -0
- sage/groups/matrix_gps/all__sagemath_modules.py +13 -0
- sage/groups/matrix_gps/catalog.py +26 -0
- sage/groups/matrix_gps/coxeter_group.py +927 -0
- sage/groups/matrix_gps/finitely_generated.py +487 -0
- sage/groups/matrix_gps/group_element.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/groups/matrix_gps/group_element.pxd +11 -0
- sage/groups/matrix_gps/group_element.pyx +431 -0
- sage/groups/matrix_gps/linear.py +440 -0
- sage/groups/matrix_gps/matrix_group.py +617 -0
- sage/groups/matrix_gps/named_group.py +296 -0
- sage/groups/matrix_gps/orthogonal.py +544 -0
- sage/groups/matrix_gps/symplectic.py +251 -0
- sage/groups/matrix_gps/unitary.py +436 -0
- sage/groups/misc_gps/all__sagemath_modules.py +1 -0
- sage/groups/misc_gps/argument_groups.py +1905 -0
- sage/groups/misc_gps/imaginary_groups.py +479 -0
- sage/groups/perm_gps/all__sagemath_modules.py +1 -0
- sage/groups/perm_gps/partn_ref/all__sagemath_modules.py +1 -0
- sage/groups/perm_gps/partn_ref/refinement_binary.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_binary.pxd +41 -0
- sage/groups/perm_gps/partn_ref/refinement_binary.pyx +1167 -0
- sage/groups/perm_gps/partn_ref/refinement_matrices.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_matrices.pxd +31 -0
- sage/groups/perm_gps/partn_ref/refinement_matrices.pyx +385 -0
- sage/homology/algebraic_topological_model.py +595 -0
- sage/homology/all.py +2 -0
- sage/homology/all__sagemath_modules.py +8 -0
- sage/homology/chain_complex.py +2148 -0
- sage/homology/chain_complex_homspace.py +165 -0
- sage/homology/chain_complex_morphism.py +629 -0
- sage/homology/chain_homotopy.py +604 -0
- sage/homology/chains.py +653 -0
- sage/homology/free_resolution.py +923 -0
- sage/homology/graded_resolution.py +567 -0
- sage/homology/hochschild_complex.py +756 -0
- sage/homology/homology_group.py +188 -0
- sage/homology/homology_morphism.py +422 -0
- sage/homology/homology_vector_space_with_basis.py +1454 -0
- sage/homology/koszul_complex.py +169 -0
- sage/homology/matrix_utils.py +205 -0
- sage/libs/all__sagemath_modules.py +1 -0
- sage/libs/gsl/__init__.py +1 -0
- sage/libs/gsl/airy.pxd +56 -0
- sage/libs/gsl/all.pxd +66 -0
- sage/libs/gsl/array.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/libs/gsl/array.pxd +5 -0
- sage/libs/gsl/array.pyx +102 -0
- sage/libs/gsl/bessel.pxd +208 -0
- sage/libs/gsl/blas.pxd +116 -0
- sage/libs/gsl/blas_types.pxd +34 -0
- sage/libs/gsl/block.pxd +52 -0
- sage/libs/gsl/chebyshev.pxd +37 -0
- sage/libs/gsl/clausen.pxd +12 -0
- sage/libs/gsl/combination.pxd +47 -0
- sage/libs/gsl/complex.pxd +151 -0
- sage/libs/gsl/coulomb.pxd +30 -0
- sage/libs/gsl/coupling.pxd +21 -0
- sage/libs/gsl/dawson.pxd +12 -0
- sage/libs/gsl/debye.pxd +24 -0
- sage/libs/gsl/dilog.pxd +14 -0
- sage/libs/gsl/eigen.pxd +46 -0
- sage/libs/gsl/elementary.pxd +12 -0
- sage/libs/gsl/ellint.pxd +48 -0
- sage/libs/gsl/elljac.pxd +8 -0
- sage/libs/gsl/erf.pxd +32 -0
- sage/libs/gsl/errno.pxd +26 -0
- sage/libs/gsl/exp.pxd +44 -0
- sage/libs/gsl/expint.pxd +44 -0
- sage/libs/gsl/fermi_dirac.pxd +44 -0
- sage/libs/gsl/fft.pxd +121 -0
- sage/libs/gsl/fit.pxd +50 -0
- sage/libs/gsl/gamma.pxd +94 -0
- sage/libs/gsl/gegenbauer.pxd +26 -0
- sage/libs/gsl/histogram.pxd +176 -0
- sage/libs/gsl/hyperg.pxd +52 -0
- sage/libs/gsl/integration.pxd +69 -0
- sage/libs/gsl/interp.pxd +109 -0
- sage/libs/gsl/laguerre.pxd +24 -0
- sage/libs/gsl/lambert.pxd +16 -0
- sage/libs/gsl/legendre.pxd +90 -0
- sage/libs/gsl/linalg.pxd +185 -0
- sage/libs/gsl/log.pxd +26 -0
- sage/libs/gsl/math.pxd +43 -0
- sage/libs/gsl/matrix.pxd +143 -0
- sage/libs/gsl/matrix_complex.pxd +130 -0
- sage/libs/gsl/min.pxd +67 -0
- sage/libs/gsl/monte.pxd +56 -0
- sage/libs/gsl/ntuple.pxd +32 -0
- sage/libs/gsl/odeiv.pxd +70 -0
- sage/libs/gsl/permutation.pxd +78 -0
- sage/libs/gsl/poly.pxd +40 -0
- sage/libs/gsl/pow_int.pxd +12 -0
- sage/libs/gsl/psi.pxd +28 -0
- sage/libs/gsl/qrng.pxd +29 -0
- sage/libs/gsl/random.pxd +257 -0
- sage/libs/gsl/rng.pxd +100 -0
- sage/libs/gsl/roots.pxd +72 -0
- sage/libs/gsl/sort.pxd +36 -0
- sage/libs/gsl/statistics.pxd +59 -0
- sage/libs/gsl/sum.pxd +55 -0
- sage/libs/gsl/synchrotron.pxd +16 -0
- sage/libs/gsl/transport.pxd +24 -0
- sage/libs/gsl/trig.pxd +58 -0
- sage/libs/gsl/types.pxd +137 -0
- sage/libs/gsl/vector.pxd +101 -0
- sage/libs/gsl/vector_complex.pxd +83 -0
- sage/libs/gsl/wavelet.pxd +49 -0
- sage/libs/gsl/zeta.pxd +28 -0
- sage/libs/mpc/__init__.pxd +114 -0
- sage/libs/mpc/types.pxd +28 -0
- sage/libs/mpfr/__init__.pxd +299 -0
- sage/libs/mpfr/types.pxd +26 -0
- sage/libs/mpmath/__init__.py +1 -0
- sage/libs/mpmath/all.py +27 -0
- sage/libs/mpmath/all__sagemath_modules.py +1 -0
- sage/libs/mpmath/utils.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/libs/mpmath/utils.pxd +4 -0
- sage/libs/mpmath/utils.pyx +319 -0
- sage/matrix/action.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/action.pxd +26 -0
- sage/matrix/action.pyx +596 -0
- sage/matrix/all.py +9 -0
- sage/matrix/args.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/args.pxd +144 -0
- sage/matrix/args.pyx +1668 -0
- sage/matrix/benchmark.py +1258 -0
- sage/matrix/berlekamp_massey.py +95 -0
- sage/matrix/compute_J_ideal.py +926 -0
- sage/matrix/constructor.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/constructor.pyx +750 -0
- sage/matrix/docs.py +430 -0
- sage/matrix/echelon_matrix.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/echelon_matrix.pyx +155 -0
- sage/matrix/matrix.pxd +2 -0
- sage/matrix/matrix0.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix0.pxd +68 -0
- sage/matrix/matrix0.pyx +6324 -0
- sage/matrix/matrix1.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix1.pxd +8 -0
- sage/matrix/matrix1.pyx +2851 -0
- sage/matrix/matrix2.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix2.pxd +25 -0
- sage/matrix/matrix2.pyx +20181 -0
- sage/matrix/matrix_cdv.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix_cdv.pxd +4 -0
- sage/matrix/matrix_cdv.pyx +93 -0
- sage/matrix/matrix_complex_double_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix_complex_double_dense.pxd +5 -0
- sage/matrix/matrix_complex_double_dense.pyx +98 -0
- sage/matrix/matrix_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix_dense.pxd +5 -0
- sage/matrix/matrix_dense.pyx +343 -0
- sage/matrix/matrix_domain_dense.pxd +5 -0
- sage/matrix/matrix_domain_sparse.pxd +5 -0
- sage/matrix/matrix_double_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix_double_dense.pxd +7 -0
- sage/matrix/matrix_double_dense.pyx +3906 -0
- sage/matrix/matrix_double_sparse.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix_double_sparse.pxd +6 -0
- sage/matrix/matrix_double_sparse.pyx +248 -0
- sage/matrix/matrix_generic_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix_generic_dense.pxd +7 -0
- sage/matrix/matrix_generic_dense.pyx +354 -0
- sage/matrix/matrix_generic_sparse.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix_generic_sparse.pxd +7 -0
- sage/matrix/matrix_generic_sparse.pyx +461 -0
- sage/matrix/matrix_laurent_mpolynomial_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix_laurent_mpolynomial_dense.pxd +5 -0
- sage/matrix/matrix_laurent_mpolynomial_dense.pyx +115 -0
- sage/matrix/matrix_misc.py +313 -0
- sage/matrix/matrix_numpy_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix_numpy_dense.pxd +14 -0
- sage/matrix/matrix_numpy_dense.pyx +450 -0
- sage/matrix/matrix_numpy_integer_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix_numpy_integer_dense.pxd +7 -0
- sage/matrix/matrix_numpy_integer_dense.pyx +59 -0
- sage/matrix/matrix_polynomial_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix_polynomial_dense.pxd +5 -0
- sage/matrix/matrix_polynomial_dense.pyx +5341 -0
- sage/matrix/matrix_real_double_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix_real_double_dense.pxd +7 -0
- sage/matrix/matrix_real_double_dense.pyx +122 -0
- sage/matrix/matrix_space.py +2848 -0
- sage/matrix/matrix_sparse.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix_sparse.pxd +5 -0
- sage/matrix/matrix_sparse.pyx +1222 -0
- sage/matrix/matrix_window.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/matrix_window.pxd +37 -0
- sage/matrix/matrix_window.pyx +242 -0
- sage/matrix/misc_mpfr.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/misc_mpfr.pyx +80 -0
- sage/matrix/operation_table.py +1182 -0
- sage/matrix/special.py +3666 -0
- sage/matrix/strassen.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matrix/strassen.pyx +851 -0
- sage/matrix/symplectic_basis.py +541 -0
- sage/matrix/template.pxd +6 -0
- sage/matrix/tests.py +71 -0
- sage/matroids/advanced.py +77 -0
- sage/matroids/all.py +13 -0
- sage/matroids/basis_exchange_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matroids/basis_exchange_matroid.pxd +96 -0
- sage/matroids/basis_exchange_matroid.pyx +2344 -0
- sage/matroids/basis_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matroids/basis_matroid.pxd +45 -0
- sage/matroids/basis_matroid.pyx +1217 -0
- sage/matroids/catalog.py +44 -0
- sage/matroids/chow_ring.py +473 -0
- sage/matroids/chow_ring_ideal.py +849 -0
- sage/matroids/circuit_closures_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matroids/circuit_closures_matroid.pxd +16 -0
- sage/matroids/circuit_closures_matroid.pyx +559 -0
- sage/matroids/circuits_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matroids/circuits_matroid.pxd +38 -0
- sage/matroids/circuits_matroid.pyx +947 -0
- sage/matroids/constructor.py +1086 -0
- sage/matroids/database_collections.py +365 -0
- sage/matroids/database_matroids.py +5338 -0
- sage/matroids/dual_matroid.py +583 -0
- sage/matroids/extension.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matroids/extension.pxd +34 -0
- sage/matroids/extension.pyx +519 -0
- sage/matroids/flats_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matroids/flats_matroid.pxd +28 -0
- sage/matroids/flats_matroid.pyx +715 -0
- sage/matroids/gammoid.py +600 -0
- sage/matroids/graphic_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matroids/graphic_matroid.pxd +39 -0
- sage/matroids/graphic_matroid.pyx +2024 -0
- sage/matroids/lean_matrix.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matroids/lean_matrix.pxd +126 -0
- sage/matroids/lean_matrix.pyx +3667 -0
- sage/matroids/linear_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matroids/linear_matroid.pxd +180 -0
- sage/matroids/linear_matroid.pyx +6649 -0
- sage/matroids/matroid.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matroids/matroid.pxd +243 -0
- sage/matroids/matroid.pyx +8759 -0
- sage/matroids/matroids_catalog.py +190 -0
- sage/matroids/matroids_plot_helpers.py +890 -0
- sage/matroids/minor_matroid.py +480 -0
- sage/matroids/minorfix.h +9 -0
- sage/matroids/named_matroids.py +5 -0
- sage/matroids/rank_matroid.py +268 -0
- sage/matroids/set_system.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matroids/set_system.pxd +38 -0
- sage/matroids/set_system.pyx +800 -0
- sage/matroids/transversal_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matroids/transversal_matroid.pxd +14 -0
- sage/matroids/transversal_matroid.pyx +893 -0
- sage/matroids/union_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matroids/union_matroid.pxd +20 -0
- sage/matroids/union_matroid.pyx +331 -0
- sage/matroids/unpickling.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/matroids/unpickling.pyx +843 -0
- sage/matroids/utilities.py +809 -0
- sage/misc/all__sagemath_modules.py +20 -0
- sage/misc/c3.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/misc/c3.pyx +238 -0
- sage/misc/compat.py +87 -0
- sage/misc/element_with_label.py +173 -0
- sage/misc/func_persist.py +79 -0
- sage/misc/pickle_old.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/misc/pickle_old.pyx +19 -0
- sage/misc/proof.py +7 -0
- sage/misc/replace_dot_all.py +472 -0
- sage/misc/sagedoc_conf.py +168 -0
- sage/misc/sphinxify.py +167 -0
- sage/misc/test_class_pickling.py +85 -0
- sage/modules/all.py +42 -0
- sage/modules/complex_double_vector.py +25 -0
- sage/modules/diamond_cutting.py +380 -0
- sage/modules/fg_pid/all.py +1 -0
- sage/modules/fg_pid/fgp_element.py +456 -0
- sage/modules/fg_pid/fgp_module.py +2091 -0
- sage/modules/fg_pid/fgp_morphism.py +550 -0
- sage/modules/filtered_vector_space.py +1271 -0
- sage/modules/finite_submodule_iter.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/modules/finite_submodule_iter.pxd +27 -0
- sage/modules/finite_submodule_iter.pyx +452 -0
- sage/modules/fp_graded/all.py +1 -0
- sage/modules/fp_graded/element.py +346 -0
- sage/modules/fp_graded/free_element.py +298 -0
- sage/modules/fp_graded/free_homspace.py +53 -0
- sage/modules/fp_graded/free_module.py +1060 -0
- sage/modules/fp_graded/free_morphism.py +217 -0
- sage/modules/fp_graded/homspace.py +563 -0
- sage/modules/fp_graded/module.py +1340 -0
- sage/modules/fp_graded/morphism.py +1990 -0
- sage/modules/fp_graded/steenrod/all.py +1 -0
- sage/modules/fp_graded/steenrod/homspace.py +65 -0
- sage/modules/fp_graded/steenrod/module.py +477 -0
- sage/modules/fp_graded/steenrod/morphism.py +404 -0
- sage/modules/fp_graded/steenrod/profile.py +241 -0
- sage/modules/free_module.py +8447 -0
- sage/modules/free_module_element.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/modules/free_module_element.pxd +22 -0
- sage/modules/free_module_element.pyx +5445 -0
- sage/modules/free_module_homspace.py +369 -0
- sage/modules/free_module_integer.py +896 -0
- sage/modules/free_module_morphism.py +823 -0
- sage/modules/free_module_pseudohomspace.py +352 -0
- sage/modules/free_module_pseudomorphism.py +578 -0
- sage/modules/free_quadratic_module.py +1706 -0
- sage/modules/free_quadratic_module_integer_symmetric.py +1790 -0
- sage/modules/matrix_morphism.py +1745 -0
- sage/modules/misc.py +103 -0
- sage/modules/module_functors.py +192 -0
- sage/modules/multi_filtered_vector_space.py +719 -0
- sage/modules/ore_module.py +2208 -0
- sage/modules/ore_module_element.py +178 -0
- sage/modules/ore_module_homspace.py +147 -0
- sage/modules/ore_module_morphism.py +968 -0
- sage/modules/quotient_module.py +699 -0
- sage/modules/real_double_vector.py +22 -0
- sage/modules/submodule.py +255 -0
- sage/modules/tensor_operations.py +567 -0
- sage/modules/torsion_quadratic_module.py +1352 -0
- sage/modules/tutorial_free_modules.py +248 -0
- sage/modules/vector_complex_double_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/modules/vector_complex_double_dense.pxd +6 -0
- sage/modules/vector_complex_double_dense.pyx +117 -0
- sage/modules/vector_double_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/modules/vector_double_dense.pxd +6 -0
- sage/modules/vector_double_dense.pyx +604 -0
- sage/modules/vector_integer_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/modules/vector_integer_dense.pxd +15 -0
- sage/modules/vector_integer_dense.pyx +361 -0
- sage/modules/vector_integer_sparse.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/modules/vector_integer_sparse.pxd +29 -0
- sage/modules/vector_integer_sparse.pyx +406 -0
- sage/modules/vector_modn_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/modules/vector_modn_dense.pxd +12 -0
- sage/modules/vector_modn_dense.pyx +394 -0
- sage/modules/vector_modn_sparse.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/modules/vector_modn_sparse.pxd +21 -0
- sage/modules/vector_modn_sparse.pyx +298 -0
- sage/modules/vector_numpy_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/modules/vector_numpy_dense.pxd +15 -0
- sage/modules/vector_numpy_dense.pyx +304 -0
- sage/modules/vector_numpy_integer_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/modules/vector_numpy_integer_dense.pxd +7 -0
- sage/modules/vector_numpy_integer_dense.pyx +54 -0
- sage/modules/vector_rational_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/modules/vector_rational_dense.pxd +15 -0
- sage/modules/vector_rational_dense.pyx +387 -0
- sage/modules/vector_rational_sparse.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/modules/vector_rational_sparse.pxd +30 -0
- sage/modules/vector_rational_sparse.pyx +413 -0
- sage/modules/vector_real_double_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/modules/vector_real_double_dense.pxd +6 -0
- sage/modules/vector_real_double_dense.pyx +126 -0
- sage/modules/vector_space_homspace.py +430 -0
- sage/modules/vector_space_morphism.py +989 -0
- sage/modules/with_basis/all.py +15 -0
- sage/modules/with_basis/cell_module.py +494 -0
- sage/modules/with_basis/indexed_element.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/modules/with_basis/indexed_element.pxd +13 -0
- sage/modules/with_basis/indexed_element.pyx +1058 -0
- sage/modules/with_basis/invariant.py +1075 -0
- sage/modules/with_basis/morphism.py +1636 -0
- sage/modules/with_basis/representation.py +2939 -0
- sage/modules/with_basis/subquotient.py +685 -0
- sage/numerical/all__sagemath_modules.py +6 -0
- sage/numerical/gauss_legendre.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/numerical/gauss_legendre.pyx +381 -0
- sage/numerical/optimize.py +910 -0
- sage/probability/all.py +10 -0
- sage/probability/probability_distribution.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/probability/probability_distribution.pyx +1242 -0
- sage/probability/random_variable.py +411 -0
- sage/quadratic_forms/all.py +4 -0
- sage/quadratic_forms/all__sagemath_modules.py +15 -0
- sage/quadratic_forms/binary_qf.py +2042 -0
- sage/quadratic_forms/bqf_class_group.py +748 -0
- sage/quadratic_forms/constructions.py +93 -0
- sage/quadratic_forms/count_local_2.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/quadratic_forms/count_local_2.pyx +365 -0
- sage/quadratic_forms/extras.py +195 -0
- sage/quadratic_forms/quadratic_form.py +1753 -0
- sage/quadratic_forms/quadratic_form__count_local_2.py +221 -0
- sage/quadratic_forms/quadratic_form__equivalence_testing.py +708 -0
- sage/quadratic_forms/quadratic_form__evaluate.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/quadratic_forms/quadratic_form__evaluate.pyx +139 -0
- sage/quadratic_forms/quadratic_form__local_density_congruence.py +977 -0
- sage/quadratic_forms/quadratic_form__local_field_invariants.py +1072 -0
- sage/quadratic_forms/quadratic_form__neighbors.py +424 -0
- sage/quadratic_forms/quadratic_form__reduction_theory.py +488 -0
- sage/quadratic_forms/quadratic_form__split_local_covering.py +416 -0
- sage/quadratic_forms/quadratic_form__ternary_Tornaria.py +657 -0
- sage/quadratic_forms/quadratic_form__theta.py +352 -0
- sage/quadratic_forms/quadratic_form__variable_substitutions.py +370 -0
- sage/quadratic_forms/random_quadraticform.py +209 -0
- sage/quadratic_forms/ternary.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/quadratic_forms/ternary.pyx +1154 -0
- sage/quadratic_forms/ternary_qf.py +2027 -0
- sage/rings/all__sagemath_modules.py +28 -0
- sage/rings/asymptotic/all__sagemath_modules.py +1 -0
- sage/rings/asymptotic/misc.py +1252 -0
- sage/rings/cc.py +4 -0
- sage/rings/cfinite_sequence.py +1306 -0
- sage/rings/complex_conversion.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/complex_conversion.pxd +8 -0
- sage/rings/complex_conversion.pyx +23 -0
- sage/rings/complex_double.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/complex_double.pxd +21 -0
- sage/rings/complex_double.pyx +2654 -0
- sage/rings/complex_mpc.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/complex_mpc.pxd +21 -0
- sage/rings/complex_mpc.pyx +2576 -0
- sage/rings/complex_mpfr.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/complex_mpfr.pxd +18 -0
- sage/rings/complex_mpfr.pyx +3602 -0
- sage/rings/derivation.py +2334 -0
- sage/rings/finite_rings/all__sagemath_modules.py +1 -0
- sage/rings/finite_rings/maps_finite_field.py +191 -0
- sage/rings/function_field/all__sagemath_modules.py +8 -0
- sage/rings/function_field/derivations.py +102 -0
- sage/rings/function_field/derivations_rational.py +132 -0
- sage/rings/function_field/differential.py +853 -0
- sage/rings/function_field/divisor.py +1107 -0
- sage/rings/function_field/drinfeld_modules/action.py +199 -0
- sage/rings/function_field/drinfeld_modules/all.py +1 -0
- sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py +673 -0
- sage/rings/function_field/drinfeld_modules/drinfeld_module.py +2087 -0
- sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py +1131 -0
- sage/rings/function_field/drinfeld_modules/homset.py +420 -0
- sage/rings/function_field/drinfeld_modules/morphism.py +820 -0
- sage/rings/function_field/hermite_form_polynomial.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/function_field/hermite_form_polynomial.pyx +188 -0
- sage/rings/function_field/khuri_makdisi.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/function_field/khuri_makdisi.pyx +935 -0
- sage/rings/invariants/all.py +4 -0
- sage/rings/invariants/invariant_theory.py +4597 -0
- sage/rings/invariants/reconstruction.py +395 -0
- sage/rings/polynomial/all__sagemath_modules.py +17 -0
- sage/rings/polynomial/integer_valued_polynomials.py +1230 -0
- sage/rings/polynomial/laurent_polynomial_mpair.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/polynomial/laurent_polynomial_mpair.pxd +15 -0
- sage/rings/polynomial/laurent_polynomial_mpair.pyx +2023 -0
- sage/rings/polynomial/ore_function_element.py +952 -0
- sage/rings/polynomial/ore_function_field.py +1028 -0
- sage/rings/polynomial/ore_polynomial_element.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/polynomial/ore_polynomial_element.pxd +48 -0
- sage/rings/polynomial/ore_polynomial_element.pyx +3145 -0
- sage/rings/polynomial/ore_polynomial_ring.py +1334 -0
- sage/rings/polynomial/polynomial_real_mpfr_dense.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/polynomial/polynomial_real_mpfr_dense.pyx +788 -0
- sage/rings/polynomial/q_integer_valued_polynomials.py +1264 -0
- sage/rings/polynomial/skew_polynomial_element.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/polynomial/skew_polynomial_element.pxd +9 -0
- sage/rings/polynomial/skew_polynomial_element.pyx +684 -0
- sage/rings/polynomial/skew_polynomial_finite_field.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_field.pxd +19 -0
- sage/rings/polynomial/skew_polynomial_finite_field.pyx +1093 -0
- sage/rings/polynomial/skew_polynomial_finite_order.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_order.pxd +10 -0
- sage/rings/polynomial/skew_polynomial_finite_order.pyx +567 -0
- sage/rings/polynomial/skew_polynomial_ring.py +908 -0
- sage/rings/real_double_element_gsl.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/real_double_element_gsl.pxd +8 -0
- sage/rings/real_double_element_gsl.pyx +794 -0
- sage/rings/real_field.py +58 -0
- sage/rings/real_mpfr.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/real_mpfr.pxd +29 -0
- sage/rings/real_mpfr.pyx +6122 -0
- sage/rings/ring_extension.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/ring_extension.pxd +42 -0
- sage/rings/ring_extension.pyx +2779 -0
- sage/rings/ring_extension_conversion.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/ring_extension_conversion.pxd +16 -0
- sage/rings/ring_extension_conversion.pyx +462 -0
- sage/rings/ring_extension_element.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/ring_extension_element.pxd +21 -0
- sage/rings/ring_extension_element.pyx +1635 -0
- sage/rings/ring_extension_homset.py +64 -0
- sage/rings/ring_extension_morphism.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/rings/ring_extension_morphism.pxd +35 -0
- sage/rings/ring_extension_morphism.pyx +920 -0
- sage/schemes/all__sagemath_modules.py +1 -0
- sage/schemes/projective/all__sagemath_modules.py +1 -0
- sage/schemes/projective/coherent_sheaf.py +300 -0
- sage/schemes/projective/cohomology.py +510 -0
- sage/stats/all.py +15 -0
- sage/stats/basic_stats.py +489 -0
- sage/stats/distributions/all.py +7 -0
- sage/stats/distributions/catalog.py +34 -0
- sage/stats/distributions/dgs.h +50 -0
- sage/stats/distributions/dgs.pxd +111 -0
- sage/stats/distributions/dgs_bern.h +400 -0
- sage/stats/distributions/dgs_gauss.h +614 -0
- sage/stats/distributions/dgs_misc.h +104 -0
- sage/stats/distributions/discrete_gaussian_integer.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/stats/distributions/discrete_gaussian_integer.pxd +14 -0
- sage/stats/distributions/discrete_gaussian_integer.pyx +498 -0
- sage/stats/distributions/discrete_gaussian_lattice.py +908 -0
- sage/stats/distributions/discrete_gaussian_polynomial.py +141 -0
- sage/stats/hmm/all.py +15 -0
- sage/stats/hmm/chmm.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/stats/hmm/chmm.pyx +1595 -0
- sage/stats/hmm/distributions.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/stats/hmm/distributions.pxd +29 -0
- sage/stats/hmm/distributions.pyx +531 -0
- sage/stats/hmm/hmm.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/stats/hmm/hmm.pxd +17 -0
- sage/stats/hmm/hmm.pyx +1388 -0
- sage/stats/hmm/util.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/stats/hmm/util.pxd +7 -0
- sage/stats/hmm/util.pyx +165 -0
- sage/stats/intlist.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/stats/intlist.pxd +14 -0
- sage/stats/intlist.pyx +588 -0
- sage/stats/r.py +49 -0
- sage/stats/time_series.cpython-314-x86_64-linux-gnu.so +0 -0
- sage/stats/time_series.pxd +6 -0
- sage/stats/time_series.pyx +2546 -0
- sage/tensor/all.py +2 -0
- sage/tensor/modules/all.py +8 -0
- sage/tensor/modules/alternating_contr_tensor.py +761 -0
- sage/tensor/modules/comp.py +5598 -0
- sage/tensor/modules/ext_pow_free_module.py +824 -0
- sage/tensor/modules/finite_rank_free_module.py +3589 -0
- sage/tensor/modules/format_utilities.py +333 -0
- sage/tensor/modules/free_module_alt_form.py +858 -0
- sage/tensor/modules/free_module_automorphism.py +1207 -0
- sage/tensor/modules/free_module_basis.py +1074 -0
- sage/tensor/modules/free_module_element.py +284 -0
- sage/tensor/modules/free_module_homset.py +652 -0
- sage/tensor/modules/free_module_linear_group.py +564 -0
- sage/tensor/modules/free_module_morphism.py +1581 -0
- sage/tensor/modules/free_module_tensor.py +3289 -0
- sage/tensor/modules/reflexive_module.py +386 -0
- sage/tensor/modules/tensor_free_module.py +780 -0
- sage/tensor/modules/tensor_free_submodule.py +538 -0
- sage/tensor/modules/tensor_free_submodule_basis.py +140 -0
- sage/tensor/modules/tensor_with_indices.py +1043 -0
|
@@ -0,0 +1,893 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-modules
|
|
2
|
+
# sage.doctest: needs networkx sage.graphs
|
|
3
|
+
r"""
|
|
4
|
+
Transversal matroids
|
|
5
|
+
|
|
6
|
+
A transversal matroid arises from a groundset `E` and a collection `A` of sets
|
|
7
|
+
over the groundset. This can be modeled as a bipartite graph `B`, where the
|
|
8
|
+
vertices on the left are groundset elements, the vertices on the right are the
|
|
9
|
+
sets, and edges represent containment. Then a set `X` from the groundset is
|
|
10
|
+
independent if and only if `X` has a matching in `B`.
|
|
11
|
+
|
|
12
|
+
To construct a transversal matroid, first import
|
|
13
|
+
:class:`~sage.matroids.transversal_matroid.TransversalMatroid` from
|
|
14
|
+
:mod:`sage.matroids.transversal_matroid`.
|
|
15
|
+
The input should be a set system, formatted as an iterable of iterables::
|
|
16
|
+
|
|
17
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
18
|
+
sage: sets = [[3, 4, 5, 6, 7, 8]] * 3
|
|
19
|
+
sage: M = TransversalMatroid(sets); M
|
|
20
|
+
Transversal matroid of rank 3 on 6 elements, with 3 sets
|
|
21
|
+
sage: M.groundset()
|
|
22
|
+
frozenset({3, 4, 5, 6, 7, 8})
|
|
23
|
+
sage: M.is_isomorphic(matroids.Uniform(3, 6))
|
|
24
|
+
True
|
|
25
|
+
sage: M = TransversalMatroid([[0, 1], [1, 2, 3], [3, 4, 5]],
|
|
26
|
+
....: set_labels=['1', '2', '3'])
|
|
27
|
+
sage: M.graph().vertices()
|
|
28
|
+
['1', '2', '3', 0, 1, 2, 3, 4, 5]
|
|
29
|
+
|
|
30
|
+
AUTHORS:
|
|
31
|
+
|
|
32
|
+
- Zachary Gershkoff (2017-08-07): initial version
|
|
33
|
+
|
|
34
|
+
REFERENCES:
|
|
35
|
+
|
|
36
|
+
- [Bon2017]_
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
# *****************************************************************************
|
|
40
|
+
# Copyright (C) 2017 Zachary Gershkoff <zgersh2@lsu.edu>
|
|
41
|
+
#
|
|
42
|
+
#
|
|
43
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
44
|
+
# as published by the Free Software Foundation; either version 2 of
|
|
45
|
+
# the License, or (at your option) any later version.
|
|
46
|
+
# https://www.gnu.org/licenses/
|
|
47
|
+
# *****************************************************************************
|
|
48
|
+
|
|
49
|
+
from collections import Counter
|
|
50
|
+
from copy import copy
|
|
51
|
+
from cpython.object cimport Py_EQ, Py_NE
|
|
52
|
+
import networkx as nx
|
|
53
|
+
|
|
54
|
+
from sage.graphs.digraph import DiGraph
|
|
55
|
+
from sage.graphs.bipartite_graph import BipartiteGraph
|
|
56
|
+
from sage.matroids.basis_exchange_matroid cimport BasisExchangeMatroid
|
|
57
|
+
from sage.matroids.minor_matroid import MinorMatroid
|
|
58
|
+
from sage.matroids.utilities import newlabel
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
cdef class TransversalMatroid(BasisExchangeMatroid):
|
|
62
|
+
r"""
|
|
63
|
+
The Transversal Matroid class.
|
|
64
|
+
|
|
65
|
+
INPUT:
|
|
66
|
+
|
|
67
|
+
- ``sets`` -- iterable of iterables of elements
|
|
68
|
+
- ``groundset`` -- (optional) iterable containing names of groundset
|
|
69
|
+
elements
|
|
70
|
+
- ``set_labels`` -- (optional) list of labels in 1-1 correspondence with
|
|
71
|
+
the iterables in ``sets``
|
|
72
|
+
- ``matching`` -- (optional) dictionary specifying a maximal matching
|
|
73
|
+
between elements and set labels
|
|
74
|
+
|
|
75
|
+
OUTPUT:
|
|
76
|
+
|
|
77
|
+
An instance of ``TransversalMatroid``. The sets specified in ``sets``
|
|
78
|
+
define the matroid. If ``matching`` is not specified, the constructor
|
|
79
|
+
will determine a matching to use for basis exchange.
|
|
80
|
+
|
|
81
|
+
EXAMPLES::
|
|
82
|
+
|
|
83
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
84
|
+
sage: sets = [[0, 1, 2, 3]] * 3
|
|
85
|
+
sage: M = TransversalMatroid(sets)
|
|
86
|
+
sage: M.full_rank()
|
|
87
|
+
3
|
|
88
|
+
sage: M.bases_count()
|
|
89
|
+
4
|
|
90
|
+
sage: sum(1 for b in M.bases())
|
|
91
|
+
4
|
|
92
|
+
|
|
93
|
+
::
|
|
94
|
+
|
|
95
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
96
|
+
sage: M = TransversalMatroid(sets=[['a', 'c']], groundset=['a', 'c', 'd'])
|
|
97
|
+
sage: M.loops()
|
|
98
|
+
frozenset({'d'})
|
|
99
|
+
sage: M.full_rank()
|
|
100
|
+
1
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
def __init__(self, sets, groundset=None, set_labels=None, matching=None):
|
|
104
|
+
"""
|
|
105
|
+
See the class definition for full documentation.
|
|
106
|
+
|
|
107
|
+
EXAMPLES::
|
|
108
|
+
|
|
109
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
110
|
+
sage: sets = [[0, 1, 2, 3], [1, 2], [1, 3, 4]]
|
|
111
|
+
sage: set_labels = [5, 6, 7]
|
|
112
|
+
sage: M = TransversalMatroid(sets, set_labels=set_labels)
|
|
113
|
+
sage: TestSuite(M).run()
|
|
114
|
+
|
|
115
|
+
TESTS::
|
|
116
|
+
|
|
117
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
118
|
+
sage: M = TransversalMatroid([[0, 1], [1, 2], [2, 3], [3, 4]])
|
|
119
|
+
sage: TestSuite(M).run()
|
|
120
|
+
|
|
121
|
+
sage: M = TransversalMatroid([[], [], []], groundset=range(3)); M
|
|
122
|
+
Transversal matroid of rank 0 on 3 elements, with 3 sets
|
|
123
|
+
sage: sets = [[0, 1, 2, 3, 4], [4, 5]]
|
|
124
|
+
sage: M = TransversalMatroid(sets, groundset=[0, 1, 2, 3])
|
|
125
|
+
Traceback (most recent call last):
|
|
126
|
+
...
|
|
127
|
+
ValueError: groundset and sets do not match
|
|
128
|
+
sage: M = TransversalMatroid(sets, set_labels=[1, 2, 3])
|
|
129
|
+
Traceback (most recent call last):
|
|
130
|
+
...
|
|
131
|
+
ValueError: set labels do not match sets
|
|
132
|
+
sage: M = TransversalMatroid(sets, set_labels=[1, 2])
|
|
133
|
+
Traceback (most recent call last):
|
|
134
|
+
...
|
|
135
|
+
ValueError: set labels cannot be element labels
|
|
136
|
+
|
|
137
|
+
sage: sets = [['s1', 's2'], ['s1', 's3']]
|
|
138
|
+
sage: M = TransversalMatroid(sets); M
|
|
139
|
+
Transversal matroid of rank 2 on 3 elements, with 2 sets
|
|
140
|
+
sage: M.sets()
|
|
141
|
+
[['s1', 's2'], ['s1', 's3']]
|
|
142
|
+
sage: M.set_labels()
|
|
143
|
+
['s0', 's4']
|
|
144
|
+
|
|
145
|
+
Testing the matching parameter::
|
|
146
|
+
|
|
147
|
+
sage: M = TransversalMatroid([range(5)] * 4, set_labels='abcd')
|
|
148
|
+
sage: M.full_rank()
|
|
149
|
+
4
|
|
150
|
+
sage: M.rank([0, 1, 2])
|
|
151
|
+
3
|
|
152
|
+
|
|
153
|
+
::
|
|
154
|
+
|
|
155
|
+
sage: sets = [[0, 1, 2, 3], [1, 2], [1, 3, 4]]
|
|
156
|
+
sage: set_labels = [5, 6, 7]
|
|
157
|
+
sage: m = {0: 5, 1: 6, 3: 7}
|
|
158
|
+
sage: M = TransversalMatroid(sets, set_labels=set_labels, matching=m)
|
|
159
|
+
sage: len(M.bases())
|
|
160
|
+
9
|
|
161
|
+
"""
|
|
162
|
+
contents = set([e for subset in sets for e in subset])
|
|
163
|
+
if groundset is None:
|
|
164
|
+
groundset = contents
|
|
165
|
+
elif not contents.issubset(groundset):
|
|
166
|
+
raise ValueError("groundset and sets do not match")
|
|
167
|
+
groundset = tuple(groundset)
|
|
168
|
+
|
|
169
|
+
# keep the original list as input so we don't lose order between minors etc.
|
|
170
|
+
self._sets_input = [list(s) for s in sets]
|
|
171
|
+
self._sets = Counter([frozenset(s) for s in self._sets_input])
|
|
172
|
+
|
|
173
|
+
# This might be redundant with self._idx from BasisExchangeMatroid
|
|
174
|
+
# However, BasisExchangeMatroid has not been called yet
|
|
175
|
+
element_int_map = {e: i for i, e in enumerate(groundset)}
|
|
176
|
+
int_element_map = {i: e for i, e in enumerate(groundset)}
|
|
177
|
+
|
|
178
|
+
# we need a matching and a corresponding graph
|
|
179
|
+
if set_labels:
|
|
180
|
+
if len(set_labels) != len(sets):
|
|
181
|
+
raise ValueError("set labels do not match sets")
|
|
182
|
+
if not contents.isdisjoint(set_labels):
|
|
183
|
+
raise ValueError("set labels cannot be element labels")
|
|
184
|
+
if matching:
|
|
185
|
+
matching_temp = matching
|
|
186
|
+
self._set_labels_input = list(set_labels)
|
|
187
|
+
|
|
188
|
+
else:
|
|
189
|
+
if matching:
|
|
190
|
+
raise ValueError("set labels must be provided if matching is provided")
|
|
191
|
+
self._set_labels_input = []
|
|
192
|
+
increment = 0
|
|
193
|
+
for i in range(len(sets)): # make sure "sn" is not in groundset
|
|
194
|
+
label = 's' + str(i + increment)
|
|
195
|
+
while label in groundset:
|
|
196
|
+
increment += 1
|
|
197
|
+
label = 's' + str(i + increment)
|
|
198
|
+
self._set_labels_input.append(label)
|
|
199
|
+
# for internal use with integers representing elements
|
|
200
|
+
set_labels = ['s' + str(i) for i in range(len(sets))]
|
|
201
|
+
|
|
202
|
+
if not matching:
|
|
203
|
+
B = BipartiteGraph()
|
|
204
|
+
for e in groundset:
|
|
205
|
+
B.add_vertex(element_int_map[e], left=True)
|
|
206
|
+
for i, s in enumerate(sets):
|
|
207
|
+
new_vertex = set_labels[i]
|
|
208
|
+
for e in s:
|
|
209
|
+
B.add_edge(new_vertex, element_int_map[e])
|
|
210
|
+
matching_temp = {}
|
|
211
|
+
for u, v, _ in B.matching():
|
|
212
|
+
if u in range(len(groundset)):
|
|
213
|
+
matching_temp[int_element_map[u]] = v
|
|
214
|
+
else:
|
|
215
|
+
matching_temp[int_element_map[v]] = u
|
|
216
|
+
|
|
217
|
+
self._set_labels = list(set_labels)
|
|
218
|
+
|
|
219
|
+
# determine the basis from the matching
|
|
220
|
+
basis = frozenset(matching_temp)
|
|
221
|
+
|
|
222
|
+
# This creates self._groundset attribute, among other things
|
|
223
|
+
# It takes the actual groundset labels, not the translated ones
|
|
224
|
+
BasisExchangeMatroid.__init__(self, groundset, basis)
|
|
225
|
+
|
|
226
|
+
# matching_temp uses actual groundset labels
|
|
227
|
+
# self._matching will use the translated ones
|
|
228
|
+
if matching:
|
|
229
|
+
self._matching = {self._idx[e]: self._set_labels[self._set_labels_input.index(matching_temp[e])]
|
|
230
|
+
for e in matching_temp}
|
|
231
|
+
else:
|
|
232
|
+
self._matching = {self._idx[e]: matching_temp[e] for e in matching_temp}
|
|
233
|
+
|
|
234
|
+
# Build a DiGraph for doing basis exchange
|
|
235
|
+
self._D = nx.DiGraph()
|
|
236
|
+
# Make sure we get isolated vertices, corresponding to loops
|
|
237
|
+
self._D.add_nodes_from(self._idx.itervalues())
|
|
238
|
+
# Also get isolated vertices corresponding to empty sets
|
|
239
|
+
self._D.add_nodes_from(self._set_labels)
|
|
240
|
+
|
|
241
|
+
# For sets in the matching, orient them as starting from the collections
|
|
242
|
+
matching_reversed = [(v, k) for k, v in self._matching.iteritems()]
|
|
243
|
+
self._D.add_edges_from(matching_reversed)
|
|
244
|
+
|
|
245
|
+
other_edges = []
|
|
246
|
+
for i, s in enumerate(sets):
|
|
247
|
+
for e in s:
|
|
248
|
+
if e not in matching_temp or matching_temp[e] != set_labels[i]:
|
|
249
|
+
other_edges.append((self._idx[e], set_labels[i]))
|
|
250
|
+
self._D.add_edges_from(other_edges)
|
|
251
|
+
|
|
252
|
+
cdef bint _is_exchange_pair(self, long x, long y) except -1:
|
|
253
|
+
r"""
|
|
254
|
+
Check for `M`-alternating path from `x` to `y`.
|
|
255
|
+
"""
|
|
256
|
+
return nx.has_path(self._D, y, x)
|
|
257
|
+
|
|
258
|
+
cdef int _exchange(self, long x, long y) except -1:
|
|
259
|
+
r"""
|
|
260
|
+
Replace ``self.basis() with ``self.basis() - x + y``.
|
|
261
|
+
|
|
262
|
+
Internal method, does no checks.
|
|
263
|
+
"""
|
|
264
|
+
# update the internal matching
|
|
265
|
+
sh = nx.shortest_path(self._D, y, x)
|
|
266
|
+
del self._matching[x]
|
|
267
|
+
for i in range(0, len(sh)-1, 2):
|
|
268
|
+
self._matching[sh[i]] = sh[i+1]
|
|
269
|
+
|
|
270
|
+
# update the graph to reflect this new matching
|
|
271
|
+
sh_edges = [(sh[i], sh[i + 1]) for i in xrange(len(sh) - 1)]
|
|
272
|
+
sh_edges_r = [(sh[i + 1], sh[i]) for i in xrange(len(sh) - 1)]
|
|
273
|
+
self._D.remove_edges_from(sh_edges)
|
|
274
|
+
self._D.add_edges_from(sh_edges_r)
|
|
275
|
+
|
|
276
|
+
BasisExchangeMatroid._exchange(self, x, y)
|
|
277
|
+
|
|
278
|
+
def _repr_(self):
|
|
279
|
+
"""
|
|
280
|
+
Return a string representation of ``self``.
|
|
281
|
+
|
|
282
|
+
EXAMPLES::
|
|
283
|
+
|
|
284
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
285
|
+
sage: sets = [[0, 1, 2, 3]] * 3
|
|
286
|
+
sage: M = TransversalMatroid(sets); M
|
|
287
|
+
Transversal matroid of rank 3 on 4 elements, with 3 sets
|
|
288
|
+
"""
|
|
289
|
+
return "Transversal matroid of rank {} on {} elements, with {} sets".format(
|
|
290
|
+
self.rank(), self.size(), len(self._sets_input))
|
|
291
|
+
|
|
292
|
+
cpdef list sets(self):
|
|
293
|
+
r"""
|
|
294
|
+
Return the sets of ``self``.
|
|
295
|
+
|
|
296
|
+
A transversal matroid can be viewed as a groundset with a collection
|
|
297
|
+
from its powerset. This is represented as a bipartite graph, where
|
|
298
|
+
an edge represents containment.
|
|
299
|
+
|
|
300
|
+
OUTPUT: list of lists that correspond to the sets of the transversal matroid
|
|
301
|
+
|
|
302
|
+
EXAMPLES::
|
|
303
|
+
|
|
304
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
305
|
+
sage: sets = [[0, 1, 2, 3], [1, 2], [3, 4]]
|
|
306
|
+
sage: set_labels = [5, 6, 7]
|
|
307
|
+
sage: M = TransversalMatroid(sets, set_labels=set_labels)
|
|
308
|
+
sage: sorted(M.sets()) == sorted(sets)
|
|
309
|
+
True
|
|
310
|
+
"""
|
|
311
|
+
return copy(self._sets_input)
|
|
312
|
+
|
|
313
|
+
def __richcmp__(left, right, op):
|
|
314
|
+
r"""
|
|
315
|
+
Compare two matroids.
|
|
316
|
+
|
|
317
|
+
We take a very restricted view on equality: the objects need to be of
|
|
318
|
+
the exact same type (so no subclassing) and the internal data need to
|
|
319
|
+
be the same. For transversal matroids, in particular, the presentation
|
|
320
|
+
as a bipartite graph must be the same.
|
|
321
|
+
|
|
322
|
+
.. WARNING::
|
|
323
|
+
|
|
324
|
+
This method is linked to ``__hash__``. If you override one, you
|
|
325
|
+
MUST override the other!
|
|
326
|
+
|
|
327
|
+
EXAMPLES::
|
|
328
|
+
|
|
329
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
330
|
+
sage: sets = [['a', 'b', 'c'], ['c', 'd'], ['a', 'd'], ['e']]
|
|
331
|
+
sage: M = TransversalMatroid(sets)
|
|
332
|
+
sage: M1 = TransversalMatroid(sets)
|
|
333
|
+
sage: sets2 = [['a', 'b', 'c'], ['c', 'd'], ['a', 'd', 'e'], ['e']]
|
|
334
|
+
sage: M2 = TransversalMatroid(sets2)
|
|
335
|
+
sage: M1 == M2
|
|
336
|
+
False
|
|
337
|
+
sage: M1.equals(M2)
|
|
338
|
+
True
|
|
339
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
340
|
+
sage: sets = [[0, 1, 2, 3], [1, 2], [1, 3, 4]]
|
|
341
|
+
sage: M = TransversalMatroid(sets, groundset=range(5), set_labels=[5, 6, 7])
|
|
342
|
+
sage: M2 = TransversalMatroid(sets)
|
|
343
|
+
sage: M == M2
|
|
344
|
+
True
|
|
345
|
+
|
|
346
|
+
TESTS::
|
|
347
|
+
|
|
348
|
+
sage: M = TransversalMatroid([range(5)] * 4, set_labels='abcd',
|
|
349
|
+
....: matching={0: 'a', 1: 'c'})
|
|
350
|
+
sage: N = TransversalMatroid([range(5)] * 4, set_labels='abcd')
|
|
351
|
+
sage: M == N
|
|
352
|
+
False
|
|
353
|
+
"""
|
|
354
|
+
if op not in [Py_EQ, Py_NE]:
|
|
355
|
+
return NotImplemented
|
|
356
|
+
if not isinstance(left, TransversalMatroid) or not isinstance(right, TransversalMatroid):
|
|
357
|
+
return NotImplemented
|
|
358
|
+
if left.__class__ != right.__class__: # since we have some subclasses, an extra test
|
|
359
|
+
return NotImplemented
|
|
360
|
+
if op == Py_EQ:
|
|
361
|
+
res = True
|
|
362
|
+
if op == Py_NE:
|
|
363
|
+
res = False
|
|
364
|
+
# res gets inverted if matroids are deemed different.
|
|
365
|
+
|
|
366
|
+
cdef TransversalMatroid rhs, lhs
|
|
367
|
+
rhs = <TransversalMatroid> right
|
|
368
|
+
lhs = <TransversalMatroid> left
|
|
369
|
+
|
|
370
|
+
# If either matroid is not valid, deem them different
|
|
371
|
+
if not (lhs.is_valid() and rhs.is_valid()):
|
|
372
|
+
return not res
|
|
373
|
+
if (lhs._groundset == rhs._groundset and
|
|
374
|
+
Counter([frozenset(s) for s in lhs._sets_input]) == Counter([frozenset(s) for s in rhs._sets_input])):
|
|
375
|
+
return res
|
|
376
|
+
else:
|
|
377
|
+
return not res
|
|
378
|
+
|
|
379
|
+
def __hash__(self):
|
|
380
|
+
r"""
|
|
381
|
+
Return the hash of ``self``.
|
|
382
|
+
|
|
383
|
+
The hash is based on the groundset and an internal Counter of the
|
|
384
|
+
collection of sets.
|
|
385
|
+
|
|
386
|
+
This function is called when matroids are added to a set. It is very
|
|
387
|
+
desirable to override it so it can distinguish matroids on the same
|
|
388
|
+
groundset, which is a very typical use case!
|
|
389
|
+
|
|
390
|
+
.. WARNING::
|
|
391
|
+
|
|
392
|
+
This method is linked to ``__richcmp__`` (in Cython) and
|
|
393
|
+
``__eq__`` (in Python). If you override one, you must
|
|
394
|
+
override the other!
|
|
395
|
+
|
|
396
|
+
EXAMPLES::
|
|
397
|
+
|
|
398
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
399
|
+
sage: sets1 = [[0, 1, 2, 3], [1, 2], [3, 4]]
|
|
400
|
+
sage: M1 = TransversalMatroid(sets1)
|
|
401
|
+
sage: M2 = TransversalMatroid(sets1, set_labels=[5, 6, 7])
|
|
402
|
+
sage: sets3 = [['a', 'b', 'c'], ['c', 'd'], ['a', 'd', 'e']]
|
|
403
|
+
sage: M3 = TransversalMatroid(sets3)
|
|
404
|
+
sage: hash(M1) == hash(M2)
|
|
405
|
+
True
|
|
406
|
+
sage: hash(M1) == hash(M3)
|
|
407
|
+
False
|
|
408
|
+
"""
|
|
409
|
+
return hash((self._groundset, frozenset(self._sets.items())))
|
|
410
|
+
|
|
411
|
+
cdef dict _translate_matching(self):
|
|
412
|
+
"""
|
|
413
|
+
Return a Python dictionary that can be used as input for ``__init__()``.
|
|
414
|
+
"""
|
|
415
|
+
cdef dict matching = {}
|
|
416
|
+
for x in self._matching:
|
|
417
|
+
matching[self._E[x]] = self._set_labels_input[self._set_labels.index(self._matching[x])]
|
|
418
|
+
return matching
|
|
419
|
+
|
|
420
|
+
def __reduce__(self):
|
|
421
|
+
"""
|
|
422
|
+
Save the matroid for later reloading.
|
|
423
|
+
|
|
424
|
+
OUTPUT:
|
|
425
|
+
|
|
426
|
+
A tuple ``(unpickle, (version, data))``, where ``unpickle`` is the
|
|
427
|
+
name of a function that, when called with ``(version, data)``,
|
|
428
|
+
produces a matroid isomorphic to ``self``. ``version`` is an integer
|
|
429
|
+
(currently 0) and ``data`` is a tuple ``(sets, E, name)`` where
|
|
430
|
+
``E`` is the groundset of the matroid, ``sets`` is the subsets of the
|
|
431
|
+
transversal, and ``name`` is a custom name.
|
|
432
|
+
|
|
433
|
+
EXAMPLES::
|
|
434
|
+
|
|
435
|
+
sage: from sage.matroids.transversal_matroid import *
|
|
436
|
+
sage: sets = [range(6)] * 3
|
|
437
|
+
sage: M = TransversalMatroid(sets)
|
|
438
|
+
sage: M == loads(dumps(M))
|
|
439
|
+
True
|
|
440
|
+
sage: M.rename('U36')
|
|
441
|
+
sage: loads(dumps(M))
|
|
442
|
+
U36
|
|
443
|
+
"""
|
|
444
|
+
from sage.matroids.unpickling import unpickle_transversal_matroid
|
|
445
|
+
data = (self._sets_input, self._E, self._set_labels_input, self._translate_matching(),
|
|
446
|
+
self.get_custom_name())
|
|
447
|
+
version = 0
|
|
448
|
+
return unpickle_transversal_matroid, (version, data)
|
|
449
|
+
|
|
450
|
+
def graph(self):
|
|
451
|
+
"""
|
|
452
|
+
Return a bipartite graph representing the transversal matroid.
|
|
453
|
+
|
|
454
|
+
A transversal matroid can be represented as a set system, or as a
|
|
455
|
+
bipartite graph with one color class corresponding to the groundset
|
|
456
|
+
and the other to the sets of the set system. This method returns
|
|
457
|
+
that bipartite graph.
|
|
458
|
+
|
|
459
|
+
OUTPUT: :class:`Graph`
|
|
460
|
+
|
|
461
|
+
EXAMPLES::
|
|
462
|
+
|
|
463
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
464
|
+
sage: edgedict = {5: [0, 1, 2, 3], 6: [1, 2], 7: [1, 3, 4]}
|
|
465
|
+
sage: B = BipartiteGraph(edgedict)
|
|
466
|
+
sage: M = TransversalMatroid(edgedict.values(), set_labels=edgedict.keys())
|
|
467
|
+
sage: M.graph() == B
|
|
468
|
+
True
|
|
469
|
+
sage: M2 = TransversalMatroid(edgedict.values())
|
|
470
|
+
sage: B2 = M2.graph()
|
|
471
|
+
sage: B2 == B
|
|
472
|
+
False
|
|
473
|
+
sage: B2.is_isomorphic(B)
|
|
474
|
+
True
|
|
475
|
+
"""
|
|
476
|
+
# cast the internal networkx as a sage DiGraph
|
|
477
|
+
D = DiGraph(self._D)
|
|
478
|
+
# relabel the vertices, then return as a BipartiteGraph
|
|
479
|
+
vertex_map = {i: e for i, e in enumerate(self._E)}
|
|
480
|
+
for i, l in enumerate(self._set_labels):
|
|
481
|
+
vertex_map[l] = self._set_labels_input[i]
|
|
482
|
+
D.relabel(vertex_map)
|
|
483
|
+
partition = [list(self._E), self._set_labels_input]
|
|
484
|
+
|
|
485
|
+
return BipartiteGraph(D, partition=partition)
|
|
486
|
+
|
|
487
|
+
cpdef _minor(self, contractions, deletions):
|
|
488
|
+
"""
|
|
489
|
+
Return a minor.
|
|
490
|
+
|
|
491
|
+
Deletions will yield a new transversal matroid. Contractions will
|
|
492
|
+
have to be a :class:`~sage.matroids.minor_matroid.MinorMatroid`
|
|
493
|
+
until Gammoids are implemented.
|
|
494
|
+
|
|
495
|
+
INPUT:
|
|
496
|
+
|
|
497
|
+
- ``contractions`` -- frozenset; an independent subset of the groundset
|
|
498
|
+
- ``deletions`` -- frozenset; a coindependent subset of the groundset
|
|
499
|
+
|
|
500
|
+
OUTPUT:
|
|
501
|
+
|
|
502
|
+
If ``contractions`` is the empty set, or if ``contractions``
|
|
503
|
+
consists of only coloops, an instance of
|
|
504
|
+
:class:`~sage.matroids.transversal_matroid.TransversalMatroid`.
|
|
505
|
+
Otherwise, an instance of
|
|
506
|
+
:class:`~sage.matroids.minor_matroid.MinorMatroid`.
|
|
507
|
+
|
|
508
|
+
EXAMPLES::
|
|
509
|
+
|
|
510
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
511
|
+
sage: sets = [[0, 1, 2, 3], [1, 2], [1, 3, 4]]
|
|
512
|
+
sage: M1 = TransversalMatroid(sets)
|
|
513
|
+
sage: N1 = M1.delete([2,3])
|
|
514
|
+
sage: sets2 = [[0, 1], [1], [4]]
|
|
515
|
+
sage: M2 = TransversalMatroid(sets2)
|
|
516
|
+
sage: N1.is_isomorphic(M2)
|
|
517
|
+
True
|
|
518
|
+
sage: M1._minor(deletions=set([3]), contractions=set([4]))
|
|
519
|
+
M / {4}, where M is Transversal matroid of rank 3 on 4 elements, with 3 sets
|
|
520
|
+
|
|
521
|
+
::
|
|
522
|
+
|
|
523
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
524
|
+
sage: sets = [['a', 'c'], ['e']]
|
|
525
|
+
sage: gs = ['a', 'c', 'd', 'e']
|
|
526
|
+
sage: M = TransversalMatroid(sets, groundset=gs)
|
|
527
|
+
sage: N = M.delete(['d','e']); N
|
|
528
|
+
Transversal matroid of rank 1 on 2 elements, with 1 sets
|
|
529
|
+
|
|
530
|
+
TESTS::
|
|
531
|
+
|
|
532
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
533
|
+
sage: sets = [['a', 'c'], ['e']]
|
|
534
|
+
sage: gs = ['a', 'c', 'd', 'e']
|
|
535
|
+
sage: M = TransversalMatroid(sets, groundset=gs)
|
|
536
|
+
sage: M.contract(['e'])
|
|
537
|
+
Transversal matroid of rank 1 on 3 elements, with 1 sets
|
|
538
|
+
sage: M.contract(['d', 'e'])
|
|
539
|
+
Transversal matroid of rank 1 on 2 elements, with 1 sets
|
|
540
|
+
sage: M.contract(['a', 'e'])
|
|
541
|
+
M / {'a', 'e'}, where M is Transversal matroid of rank 2 on 4 elements, with 2 sets
|
|
542
|
+
"""
|
|
543
|
+
cdef TransversalMatroid N
|
|
544
|
+
cdef list new_sets, new_set_labels, s, new_s
|
|
545
|
+
cdef size_t i
|
|
546
|
+
cdef frozenset contract = frozenset(contractions)
|
|
547
|
+
cdef frozenset delete = frozenset(deletions)
|
|
548
|
+
|
|
549
|
+
# if contractions are just coloops, we can just delete them
|
|
550
|
+
if self._corank(contract) == 0:
|
|
551
|
+
delete = delete.union(contract)
|
|
552
|
+
contract = frozenset()
|
|
553
|
+
|
|
554
|
+
if delete:
|
|
555
|
+
new_sets = []
|
|
556
|
+
new_set_labels = []
|
|
557
|
+
for i in range(len(self._sets_input)):
|
|
558
|
+
s = <list> self._sets_input[i]
|
|
559
|
+
new_s = [e for e in s if e not in delete]
|
|
560
|
+
if new_s:
|
|
561
|
+
# skip over empty buckets, and do bookkeeping with the labels
|
|
562
|
+
new_sets.append(new_s)
|
|
563
|
+
new_set_labels.append(self._set_labels_input[i])
|
|
564
|
+
groundset = self._groundset.difference(delete)
|
|
565
|
+
N = TransversalMatroid(new_sets, groundset, new_set_labels)
|
|
566
|
+
# Check if what remains is just coloops
|
|
567
|
+
return N._minor(contractions=contract, deletions=frozenset())
|
|
568
|
+
else:
|
|
569
|
+
N = self
|
|
570
|
+
|
|
571
|
+
if contractions:
|
|
572
|
+
# Until gammoids are implemented
|
|
573
|
+
return MinorMatroid(N, contractions=contract, deletions=frozenset())
|
|
574
|
+
else:
|
|
575
|
+
return N
|
|
576
|
+
|
|
577
|
+
def set_labels(self):
|
|
578
|
+
"""
|
|
579
|
+
Return the labels used for the transversal sets.
|
|
580
|
+
|
|
581
|
+
This method will return a list of the labels used of the non-ground
|
|
582
|
+
set vertices of the bipartite graph used to represent the transversal
|
|
583
|
+
matroid. This method does not set anything.
|
|
584
|
+
|
|
585
|
+
OUTPUT: list
|
|
586
|
+
|
|
587
|
+
EXAMPLES::
|
|
588
|
+
|
|
589
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
590
|
+
sage: M = TransversalMatroid([[0, 1], [1, 2, 3], [3, 4, 7]])
|
|
591
|
+
sage: M.set_labels()
|
|
592
|
+
['s0', 's1', 's2']
|
|
593
|
+
sage: M.graph().vertices()
|
|
594
|
+
['s0', 's1', 's2', 0, 1, 2, 3, 4, 7]
|
|
595
|
+
"""
|
|
596
|
+
return copy(self._set_labels_input)
|
|
597
|
+
|
|
598
|
+
cpdef reduce_presentation(self):
|
|
599
|
+
"""
|
|
600
|
+
Return an equal transversal matroid where the number of sets equals the rank.
|
|
601
|
+
|
|
602
|
+
Every transversal matroid `M` has a presentation with `r(M)` sets, and if `M`
|
|
603
|
+
has no coloops, then every presentation has `r(M)` nonempty sets. This method
|
|
604
|
+
discards extra sets if `M` has coloops.
|
|
605
|
+
|
|
606
|
+
OUTPUT: :class:`TransversalMatroid` with a reduced presentation
|
|
607
|
+
|
|
608
|
+
EXAMPLES::
|
|
609
|
+
|
|
610
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
611
|
+
sage: sets = [[0, 1], [2], [2]]
|
|
612
|
+
sage: M = TransversalMatroid(sets); M
|
|
613
|
+
Transversal matroid of rank 2 on 3 elements, with 3 sets
|
|
614
|
+
sage: N = M.reduce_presentation(); N
|
|
615
|
+
Transversal matroid of rank 2 on 3 elements, with 2 sets
|
|
616
|
+
sage: N.equals(M)
|
|
617
|
+
True
|
|
618
|
+
sage: N == M
|
|
619
|
+
False
|
|
620
|
+
sage: sets = [[0, 1], [], [], [2]]
|
|
621
|
+
sage: M1 = TransversalMatroid(sets); M1
|
|
622
|
+
Transversal matroid of rank 2 on 3 elements, with 4 sets
|
|
623
|
+
sage: M1.reduce_presentation()
|
|
624
|
+
Transversal matroid of rank 2 on 3 elements, with 2 sets
|
|
625
|
+
|
|
626
|
+
::
|
|
627
|
+
|
|
628
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
629
|
+
sage: sets = [[0, 1, 2, 3]] * 3
|
|
630
|
+
sage: M = TransversalMatroid(sets)
|
|
631
|
+
sage: N = M.reduce_presentation()
|
|
632
|
+
sage: M == N
|
|
633
|
+
True
|
|
634
|
+
|
|
635
|
+
TESTS::
|
|
636
|
+
|
|
637
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
638
|
+
sage: sets = [[4], [1, 3], [4], [0, 1], [2, 3], [1]]
|
|
639
|
+
sage: M = TransversalMatroid(sets)
|
|
640
|
+
sage: M1 = M.reduce_presentation(); M1
|
|
641
|
+
Transversal matroid of rank 5 on 5 elements, with 5 sets
|
|
642
|
+
sage: len(M1.graph().edges())
|
|
643
|
+
5
|
|
644
|
+
"""
|
|
645
|
+
cdef TransversalMatroid N
|
|
646
|
+
cdef size_t i
|
|
647
|
+
if len(self._sets_input) == self.full_rank():
|
|
648
|
+
return self
|
|
649
|
+
|
|
650
|
+
element_int_map = {e: i for i, e in enumerate(self._groundset)}
|
|
651
|
+
coloops = self.coloops()
|
|
652
|
+
cdef list coloops_to_delete = [e for e in coloops if self._D.degree(element_int_map[e]) > 1]
|
|
653
|
+
N = <TransversalMatroid?> self._minor(contractions=set(), deletions=set(coloops_to_delete))
|
|
654
|
+
cdef list sets = list(N._sets_input) # make a (shallow) copy as we will remove objects
|
|
655
|
+
# reuse the old set labels
|
|
656
|
+
# this does not respect containment
|
|
657
|
+
labels = N.set_labels()
|
|
658
|
+
# remove empty sets HERE
|
|
659
|
+
if [] in sets:
|
|
660
|
+
i = len(sets)
|
|
661
|
+
while i > 0:
|
|
662
|
+
i -= 1
|
|
663
|
+
if not sets[i]:
|
|
664
|
+
del sets[i]
|
|
665
|
+
del labels[i]
|
|
666
|
+
cdef set free_labels = set(self._set_labels_input).difference(labels)
|
|
667
|
+
for c in coloops_to_delete:
|
|
668
|
+
l = free_labels.pop()
|
|
669
|
+
sets.append([c])
|
|
670
|
+
labels.append(l)
|
|
671
|
+
return TransversalMatroid(sets, groundset=self.groundset(), set_labels=labels)
|
|
672
|
+
|
|
673
|
+
cpdef transversal_extension(self, element=None, newset=False, sets=None):
|
|
674
|
+
r"""
|
|
675
|
+
Return a :class:`TransversalMatroid` extended by an element.
|
|
676
|
+
|
|
677
|
+
This will modify the presentation of the transversal matroid by
|
|
678
|
+
adding a new element, and placing this element in the specified
|
|
679
|
+
sets. It is also possible to use this method to create a new set
|
|
680
|
+
that will have the new element as its only member, making it a coloop.
|
|
681
|
+
|
|
682
|
+
INPUT:
|
|
683
|
+
|
|
684
|
+
- ``element`` -- (optional) the name for the new element
|
|
685
|
+
- ``newset`` -- (optional) if specified, the element will be
|
|
686
|
+
given its own set
|
|
687
|
+
- ``sets`` -- iterable of labels (default: ``None``) representing the
|
|
688
|
+
sets in the current presentation that the new element will belong to
|
|
689
|
+
|
|
690
|
+
OUTPUT:
|
|
691
|
+
|
|
692
|
+
A :class:`~sage.matroids.transversal_matroids.TransversalMatroid`
|
|
693
|
+
with a groundset element added to specified sets. Note that the
|
|
694
|
+
``newset`` option will make the new element a coloop. If
|
|
695
|
+
``newset == True``, a name will be generated; otherwise the
|
|
696
|
+
value of ``newset`` will be used.
|
|
697
|
+
|
|
698
|
+
EXAMPLES::
|
|
699
|
+
|
|
700
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
701
|
+
sage: M = TransversalMatroid([['a', 'c']], groundset=['a', 'c'], set_labels=['b'])
|
|
702
|
+
sage: M1 = M.transversal_extension(element='d', newset='e')
|
|
703
|
+
sage: M2 = M.transversal_extension(element='d', newset=True)
|
|
704
|
+
sage: M1.coloops()
|
|
705
|
+
frozenset({'d'})
|
|
706
|
+
sage: True in M2.graph().vertices()
|
|
707
|
+
False
|
|
708
|
+
sage: M1.is_isomorphic(M2)
|
|
709
|
+
True
|
|
710
|
+
sage: M3 = M.transversal_extension('d', sets=['b'])
|
|
711
|
+
sage: M3.is_isomorphic(matroids.Uniform(1, 3))
|
|
712
|
+
True
|
|
713
|
+
sage: M4 = M.transversal_extension('d', sets=['a'])
|
|
714
|
+
Traceback (most recent call last):
|
|
715
|
+
...
|
|
716
|
+
ValueError: sets do not match presentation
|
|
717
|
+
sage: M4 = M.transversal_extension('a', sets=['b'])
|
|
718
|
+
Traceback (most recent call last):
|
|
719
|
+
...
|
|
720
|
+
ValueError: cannot extend by element already in groundset
|
|
721
|
+
sage: M2.transversal_extension(newset='b')
|
|
722
|
+
Traceback (most recent call last):
|
|
723
|
+
...
|
|
724
|
+
ValueError: newset is already a vertex in the presentation
|
|
725
|
+
sage: M5 = M1.transversal_extension()
|
|
726
|
+
sage: len(M5.loops())
|
|
727
|
+
1
|
|
728
|
+
sage: M2.transversal_extension(element='b')
|
|
729
|
+
Transversal matroid of rank 2 on 4 elements, with 2 sets
|
|
730
|
+
|
|
731
|
+
::
|
|
732
|
+
|
|
733
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
734
|
+
sage: sets = [[0, 1, 2, 3], [1, 2], [1, 3, 4]]
|
|
735
|
+
sage: M = TransversalMatroid(sets, groundset=range(5), set_labels=[5, 6, 7])
|
|
736
|
+
sage: N = M.delete(2)
|
|
737
|
+
sage: M1 = N.transversal_extension(element=2, sets=[5, 6])
|
|
738
|
+
sage: M1 == M
|
|
739
|
+
True
|
|
740
|
+
|
|
741
|
+
::
|
|
742
|
+
|
|
743
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
744
|
+
sage: sets = [[0, 1, 2, 3]] * 3
|
|
745
|
+
sage: M = TransversalMatroid(sets, set_labels=[4, 5, 6])
|
|
746
|
+
sage: N = M.transversal_extension(element='a', newset=True, sets=[4])
|
|
747
|
+
sage: N.graph().degree('a')
|
|
748
|
+
2
|
|
749
|
+
|
|
750
|
+
TESTS::
|
|
751
|
+
|
|
752
|
+
sage: N = TransversalMatroid(['abc', 'abd', 'cde']); N
|
|
753
|
+
Transversal matroid of rank 3 on 5 elements, with 3 sets
|
|
754
|
+
sage: Ne = N.transversal_extension(element='f', sets=['s2'])
|
|
755
|
+
"""
|
|
756
|
+
if sets is None:
|
|
757
|
+
sets = []
|
|
758
|
+
cdef set parsed_sets = set(sets)
|
|
759
|
+
if element is None:
|
|
760
|
+
element = newlabel(self._groundset)
|
|
761
|
+
elif element in self._groundset:
|
|
762
|
+
raise ValueError("cannot extend by element already in groundset")
|
|
763
|
+
cdef list labels = self._set_labels_input
|
|
764
|
+
if not parsed_sets.issubset(labels):
|
|
765
|
+
raise ValueError("sets do not match presentation")
|
|
766
|
+
|
|
767
|
+
# check for conflicts with new labels
|
|
768
|
+
labels_map = {l: l for l in labels}
|
|
769
|
+
if element in labels:
|
|
770
|
+
new_label = newlabel(self._groundset.union(labels).union([newset]))
|
|
771
|
+
labels_map[element] = new_label
|
|
772
|
+
|
|
773
|
+
# newset should not be a groundset element or existing set
|
|
774
|
+
if newset in self._E or newset in self._set_labels_input:
|
|
775
|
+
# keywords `True` and `False` give us problems here
|
|
776
|
+
if not isinstance(newset, bool):
|
|
777
|
+
raise ValueError("newset is already a vertex in the presentation")
|
|
778
|
+
|
|
779
|
+
cdef list s, new_sets = []
|
|
780
|
+
cdef size_t i
|
|
781
|
+
for i in range(len(self._sets_input)):
|
|
782
|
+
s = <list> self._sets_input[i]
|
|
783
|
+
if labels[i] in parsed_sets:
|
|
784
|
+
new_sets.append(s + [element])
|
|
785
|
+
else:
|
|
786
|
+
new_sets.append(s)
|
|
787
|
+
|
|
788
|
+
groundset = self._groundset.union([element])
|
|
789
|
+
if newset:
|
|
790
|
+
if newset is True:
|
|
791
|
+
newset = newlabel(groundset.union(labels))
|
|
792
|
+
new_sets.append([element])
|
|
793
|
+
labels = list(labels) # Make a shallow copy since we mutate it
|
|
794
|
+
labels.append(newset)
|
|
795
|
+
|
|
796
|
+
return TransversalMatroid(new_sets, groundset, labels)
|
|
797
|
+
|
|
798
|
+
def transversal_extensions(self, element=None, sets=None):
|
|
799
|
+
r"""
|
|
800
|
+
Return an iterator of extensions based on the transversal presentation.
|
|
801
|
+
|
|
802
|
+
This method will take an extension by adding an element to every possible
|
|
803
|
+
sub-collection of the collection of desired sets. No checking is done
|
|
804
|
+
for equal matroids. It is advised to make sure the presentation has as
|
|
805
|
+
few sets as possible by using
|
|
806
|
+
:meth:`reduce_presentation() <sage.matroids.transversal_matroid.TransversalMatroid.reduce_presentation>`
|
|
807
|
+
|
|
808
|
+
INPUT:
|
|
809
|
+
|
|
810
|
+
- ``element`` -- (optional) the name of the new element
|
|
811
|
+
- ``sets`` -- (optional) list containing names of sets in the matroid's
|
|
812
|
+
presentation
|
|
813
|
+
|
|
814
|
+
OUTPUT: iterator over instances of :class:`TransversalMatroid`
|
|
815
|
+
|
|
816
|
+
If ``sets`` is not specified, every set will be used.
|
|
817
|
+
|
|
818
|
+
EXAMPLES::
|
|
819
|
+
|
|
820
|
+
sage: from sage.matroids.transversal_matroid import TransversalMatroid
|
|
821
|
+
sage: sets = [[3, 4, 5, 6]] * 3
|
|
822
|
+
sage: M = TransversalMatroid(sets, set_labels=[0, 1, 2])
|
|
823
|
+
sage: len([N for N in M.transversal_extensions()])
|
|
824
|
+
8
|
|
825
|
+
sage: len([N for N in M.transversal_extensions(sets=[0, 1])])
|
|
826
|
+
4
|
|
827
|
+
sage: set(sorted([N.groundset() for N in M.transversal_extensions(element=7)]))
|
|
828
|
+
{frozenset({3, 4, 5, 6, 7})}
|
|
829
|
+
"""
|
|
830
|
+
if element is None:
|
|
831
|
+
element = newlabel(self.groundset())
|
|
832
|
+
elif element in self._groundset:
|
|
833
|
+
raise ValueError("cannot extend by element already in groundset")
|
|
834
|
+
|
|
835
|
+
labels = self._set_labels_input
|
|
836
|
+
if sets is None:
|
|
837
|
+
sets = labels
|
|
838
|
+
elif not set(sets).issubset(labels):
|
|
839
|
+
raise ValueError("sets do not match presentation")
|
|
840
|
+
|
|
841
|
+
# Adapted from the Python documentation
|
|
842
|
+
from itertools import chain, combinations
|
|
843
|
+
powerset = chain.from_iterable(combinations(sets, r) for r in range(len(sets)+1))
|
|
844
|
+
|
|
845
|
+
for collection in powerset:
|
|
846
|
+
yield self.transversal_extension(element=element, sets=collection)
|
|
847
|
+
|
|
848
|
+
cpdef is_valid(self, certificate=False):
|
|
849
|
+
"""
|
|
850
|
+
Test whether the matching in memory is a valid maximal matching.
|
|
851
|
+
|
|
852
|
+
The data for a transversal matroid is a set system, which is always valid,
|
|
853
|
+
but it is possible for a user to provide invalid input with the ``matching``
|
|
854
|
+
parameter. This checks that the matching provided is indeed a matching, fits in
|
|
855
|
+
the set system, and is maximal.
|
|
856
|
+
|
|
857
|
+
EXAMPLES::
|
|
858
|
+
|
|
859
|
+
sage: from sage.matroids.transversal_matroid import *
|
|
860
|
+
sage: sets = [[0, 1, 2, 3], [1, 2], [1, 3, 4]]
|
|
861
|
+
sage: set_labels = [5, 6, 7]
|
|
862
|
+
sage: M = TransversalMatroid(sets, set_labels=set_labels)
|
|
863
|
+
sage: M.is_valid()
|
|
864
|
+
True
|
|
865
|
+
sage: m = {0: 5, 1: 5, 3: 7} # not a matching
|
|
866
|
+
sage: TransversalMatroid(sets, set_labels=set_labels, matching=m).is_valid()
|
|
867
|
+
False
|
|
868
|
+
sage: m = {2: 6, 3: 7} # not maximal
|
|
869
|
+
sage: TransversalMatroid(sets, set_labels=set_labels, matching=m).is_valid()
|
|
870
|
+
False
|
|
871
|
+
sage: m = {0: 6, 1: 5, 3: 7} # not in the set system
|
|
872
|
+
sage: TransversalMatroid(sets, set_labels=set_labels, matching=m).is_valid()
|
|
873
|
+
False
|
|
874
|
+
"""
|
|
875
|
+
# Check that self._matching is a matching, that is, every entry appears at most once.
|
|
876
|
+
# Because of how python dictionaries work, each element appears once, but a set
|
|
877
|
+
# can appear more than once.
|
|
878
|
+
if len(self._matching) != len(set(self._matching.values())):
|
|
879
|
+
return False
|
|
880
|
+
|
|
881
|
+
# Check that every element in the matching is actually in the set that the matching
|
|
882
|
+
# specifies.
|
|
883
|
+
# Note that self._matching uses the internal set and element labels
|
|
884
|
+
for e in self._matching:
|
|
885
|
+
if e not in self._sets_input[self._set_labels.index(self._matching[e])]:
|
|
886
|
+
return False
|
|
887
|
+
|
|
888
|
+
# Check that the matching is maximal.
|
|
889
|
+
B = self.graph()
|
|
890
|
+
if len(B.matching()) != len(self._matching):
|
|
891
|
+
return False
|
|
892
|
+
|
|
893
|
+
return True
|