passagemath-modules 10.5.46__cp310-cp310-macosx_14_0_arm64.whl → 10.6.20__cp310-cp310-macosx_14_0_arm64.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.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/METADATA +49 -44
- {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/RECORD +320 -314
- passagemath_modules.dylibs/libmpc.3.dylib +0 -0
- passagemath_modules.dylibs/libopenblasp-r0.3.29.dylib +0 -0
- sage/algebras/clifford_algebra.py +2 -2
- sage/algebras/clifford_algebra_element.cpython-310-darwin.so +0 -0
- sage/algebras/clifford_algebra_element.pyx +4 -2
- sage/algebras/exterior_algebra_groebner.cpython-310-darwin.so +0 -0
- sage/algebras/exterior_algebra_groebner.pyx +2 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py +83 -5
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.cpython-310-darwin.so +0 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pxd +2 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pyx +28 -3
- sage/algebras/finite_gca.py +1 -1
- sage/algebras/lie_algebras/bgg_dual_module.py +18 -11
- sage/algebras/lie_algebras/classical_lie_algebra.py +3 -3
- sage/algebras/lie_algebras/examples.py +2 -2
- sage/algebras/lie_algebras/free_lie_algebra.py +1 -1
- sage/algebras/lie_algebras/heisenberg.py +4 -4
- sage/algebras/lie_algebras/lie_algebra.py +1 -1
- sage/algebras/lie_algebras/lie_algebra_element.cpython-310-darwin.so +0 -0
- sage/algebras/lie_algebras/lie_algebra_element.pyx +63 -27
- sage/algebras/lie_algebras/quotient.py +40 -29
- sage/algebras/lie_algebras/subalgebra.py +76 -53
- sage/algebras/lie_algebras/verma_module.py +1 -3
- sage/algebras/octonion_algebra.cpython-310-darwin.so +0 -0
- sage/algebras/octonion_algebra.pyx +1 -1
- sage/algebras/orlik_solomon.py +4 -4
- sage/algebras/orlik_terao.py +4 -4
- sage/algebras/steenrod/steenrod_algebra.py +37 -30
- sage/algebras/steenrod/steenrod_algebra_bases.py +2 -2
- sage/algebras/steenrod/steenrod_algebra_misc.py +4 -4
- sage/algebras/steenrod/steenrod_algebra_mult.py +2 -2
- sage/all__sagemath_modules.py +1 -0
- sage/calculus/integration.cpython-310-darwin.so +0 -0
- sage/calculus/integration.pyx +6 -5
- sage/calculus/interpolation.cpython-310-darwin.so +0 -0
- sage/calculus/interpolators.cpython-310-darwin.so +0 -0
- sage/calculus/ode.cpython-310-darwin.so +0 -0
- sage/calculus/ode.pxd +2 -2
- sage/calculus/ode.pyx +6 -4
- sage/calculus/riemann.cpython-310-darwin.so +0 -0
- sage/calculus/riemann.pyx +68 -48
- sage/calculus/transforms/dwt.cpython-310-darwin.so +0 -0
- sage/calculus/transforms/fft.cpython-310-darwin.so +0 -0
- sage/coding/ag_code_decoders.cpython-310-darwin.so +0 -0
- sage/coding/ag_code_decoders.pyx +31 -31
- sage/coding/binary_code.cpython-310-darwin.so +0 -0
- sage/coding/binary_code.pxd +6 -6
- sage/coding/binary_code.pyx +212 -173
- sage/coding/guruswami_sudan/utils.py +3 -5
- sage/coding/kasami_codes.cpython-310-darwin.so +0 -0
- sage/coding/kasami_codes.pyx +20 -24
- sage/coding/linear_code.py +2 -2
- sage/coding/linear_code_no_metric.py +5 -5
- sage/coding/linear_rank_metric.py +81 -19
- sage/combinat/free_module.py +22 -2
- sage/combinat/root_system/ambient_space.py +1 -1
- sage/combinat/root_system/associahedron.py +4 -4
- sage/combinat/root_system/braid_move_calculator.py +1 -1
- sage/combinat/root_system/braid_orbit.cpython-310-darwin.so +0 -0
- sage/combinat/root_system/branching_rules.py +2 -2
- sage/combinat/root_system/cartan_type.py +14 -14
- sage/combinat/root_system/coxeter_group.py +2 -2
- sage/combinat/root_system/coxeter_type.py +11 -0
- sage/combinat/root_system/extended_affine_weyl_group.py +8 -8
- sage/combinat/root_system/fundamental_group.py +2 -4
- sage/combinat/root_system/hecke_algebra_representation.py +1 -1
- sage/combinat/root_system/pieri_factors.py +2 -2
- sage/combinat/root_system/root_lattice_realization_algebras.py +1 -1
- sage/combinat/root_system/root_lattice_realizations.py +1 -1
- sage/combinat/root_system/type_folded.py +3 -3
- sage/combinat/root_system/type_reducible.py +8 -7
- sage/combinat/root_system/type_super_A.py +2 -2
- sage/combinat/root_system/weight_lattice_realizations.py +9 -8
- sage/combinat/root_system/weyl_characters.py +1 -1
- sage/crypto/__init__.py +1 -0
- sage/crypto/block_cipher/des.py +1 -1
- sage/crypto/block_cipher/miniaes.py +3 -3
- sage/crypto/block_cipher/present.py +3 -3
- sage/crypto/block_cipher/sdes.py +3 -3
- sage/crypto/boolean_function.cpython-310-darwin.so +0 -0
- sage/crypto/boolean_function.pyx +22 -23
- sage/crypto/key_exchange/diffie_hellman.py +4 -9
- sage/crypto/mq/sr.py +1 -1
- sage/crypto/public_key/blum_goldwasser.py +3 -3
- sage/crypto/sbox.cpython-310-darwin.so +0 -0
- sage/crypto/sbox.pyx +1 -1
- sage/crypto/sboxes.py +22 -0
- sage/crypto/util.py +4 -6
- sage/ext/interpreters/__init__.py +1 -1
- sage/ext/interpreters/all__sagemath_modules.py +1 -1
- sage/ext/interpreters/wrapper_cc.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_cc.pxd +5 -5
- sage/ext/interpreters/wrapper_cc.pyx +1 -1
- sage/ext/interpreters/wrapper_cdf.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_cdf.pxd +5 -7
- sage/ext/interpreters/wrapper_cdf.pyx +4 -10
- sage/ext/interpreters/wrapper_rdf.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_rdf.pxd +1 -1
- sage/ext/interpreters/wrapper_rdf.pyx +1 -1
- sage/ext/interpreters/wrapper_rr.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_rr.pxd +5 -5
- sage/ext/interpreters/wrapper_rr.pyx +1 -2
- sage/geometry/toric_lattice.py +3 -3
- sage/geometry/toric_lattice_element.cpython-310-darwin.so +0 -0
- sage/groups/additive_abelian/additive_abelian_group.py +1 -1
- sage/groups/additive_abelian/qmodnz.py +4 -4
- sage/groups/matrix_gps/coxeter_group.py +17 -4
- sage/groups/matrix_gps/group_element.cpython-310-darwin.so +0 -0
- sage/groups/misc_gps/argument_groups.py +2 -2
- sage/groups/misc_gps/imaginary_groups.py +4 -4
- sage/groups/perm_gps/partn_ref/refinement_binary.cpython-310-darwin.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_matrices.cpython-310-darwin.so +0 -0
- sage/homology/chain_complex.py +0 -2
- sage/homology/hochschild_complex.py +3 -3
- sage/homology/homology_morphism.py +6 -6
- sage/homology/homology_vector_space_with_basis.py +1 -1
- sage/libs/gsl/array.cpython-310-darwin.so +0 -0
- sage/libs/mpmath/utils.cpython-310-darwin.so +0 -0
- sage/matrix/action.cpython-310-darwin.so +0 -0
- sage/matrix/args.cpython-310-darwin.so +0 -0
- sage/matrix/args.pyx +25 -10
- sage/matrix/benchmark.py +8 -4
- sage/matrix/compute_J_ideal.py +2 -2
- sage/matrix/constructor.cpython-310-darwin.so +0 -0
- sage/matrix/echelon_matrix.cpython-310-darwin.so +0 -0
- sage/matrix/echelon_matrix.pyx +1 -1
- sage/matrix/matrix0.cpython-310-darwin.so +0 -0
- sage/matrix/matrix0.pxd +3 -3
- sage/matrix/matrix0.pyx +7 -5
- sage/matrix/matrix1.cpython-310-darwin.so +0 -0
- sage/matrix/matrix1.pyx +87 -48
- sage/matrix/matrix2.cpython-310-darwin.so +0 -0
- sage/matrix/matrix2.pxd +3 -3
- sage/matrix/matrix2.pyx +758 -75
- sage/matrix/matrix_cdv.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_complex_double_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_complex_double_dense.pyx +1 -1
- sage/matrix/matrix_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_dense.pyx +2 -3
- sage/matrix/matrix_double_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_double_dense.pyx +11 -5
- sage/matrix/matrix_double_sparse.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_generic_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_generic_sparse.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_generic_sparse.pyx +1 -1
- sage/matrix/matrix_laurent_mpolynomial_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_numpy_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_numpy_integer_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_polynomial_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_polynomial_dense.pyx +952 -261
- sage/matrix/matrix_real_double_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_sparse.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_sparse.pyx +2 -3
- sage/matrix/matrix_window.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_window.pyx +2 -2
- sage/matrix/misc_mpfr.cpython-310-darwin.so +0 -0
- sage/matrix/operation_table.py +0 -2
- sage/matrix/special.py +4 -0
- sage/matrix/strassen.cpython-310-darwin.so +0 -0
- sage/matrix/strassen.pyx +1 -1
- sage/matroids/basis_exchange_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/basis_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/chow_ring.py +68 -65
- sage/matroids/chow_ring_ideal.py +41 -38
- sage/matroids/circuit_closures_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/circuits_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/database_matroids.py +16 -5
- sage/matroids/dual_matroid.py +2 -2
- sage/matroids/extension.cpython-310-darwin.so +0 -0
- sage/matroids/flats_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/gammoid.py +1 -1
- sage/matroids/graphic_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/graphic_matroid.pyx +3 -3
- sage/matroids/lean_matrix.cpython-310-darwin.so +0 -0
- sage/matroids/lean_matrix.pyx +22 -22
- sage/matroids/linear_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/linear_matroid.pyx +13 -13
- sage/matroids/matroid.cpython-310-darwin.so +0 -0
- sage/matroids/matroid.pyx +15 -15
- sage/matroids/matroids_plot_helpers.py +48 -46
- sage/matroids/minor_matroid.py +2 -2
- sage/matroids/set_system.cpython-310-darwin.so +0 -0
- sage/matroids/transversal_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/transversal_matroid.pyx +3 -3
- sage/matroids/union_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/union_matroid.pyx +3 -0
- sage/matroids/unpickling.cpython-310-darwin.so +0 -0
- sage/matroids/utilities.py +2 -2
- sage/misc/c3.cpython-310-darwin.so +0 -0
- sage/misc/compat.py +1 -2
- sage/misc/pickle_old.cpython-310-darwin.so +0 -0
- sage/modules/diamond_cutting.py +117 -30
- sage/modules/fg_pid/fgp_module.py +3 -3
- sage/modules/filtered_vector_space.py +4 -4
- sage/modules/finite_submodule_iter.cpython-310-darwin.so +0 -0
- sage/modules/fp_graded/free_module.py +2 -2
- sage/modules/fp_graded/module.py +2 -2
- sage/modules/fp_graded/morphism.py +4 -4
- sage/modules/fp_graded/steenrod/morphism.py +1 -1
- sage/modules/free_module.py +144 -15
- sage/modules/free_module_element.cpython-310-darwin.so +0 -0
- sage/modules/free_module_element.pyx +4 -4
- sage/modules/free_module_integer.py +2 -2
- sage/modules/free_module_morphism.py +3 -3
- sage/modules/free_module_pseudohomspace.py +352 -0
- sage/modules/free_module_pseudomorphism.py +578 -0
- sage/modules/free_quadratic_module_integer_symmetric.py +24 -13
- sage/modules/matrix_morphism.py +9 -9
- sage/modules/multi_filtered_vector_space.py +4 -4
- 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 +11 -1
- sage/modules/submodule.py +1 -1
- sage/modules/torsion_quadratic_module.py +1 -1
- sage/modules/vector_complex_double_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_double_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_integer_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_integer_sparse.cpython-310-darwin.so +0 -0
- sage/modules/vector_integer_sparse.pyx +4 -4
- sage/modules/vector_modn_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_modn_sparse.cpython-310-darwin.so +0 -0
- sage/modules/vector_numpy_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_numpy_integer_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_rational_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_rational_dense.pyx +1 -1
- sage/modules/vector_rational_sparse.cpython-310-darwin.so +0 -0
- sage/modules/vector_rational_sparse.pyx +5 -5
- sage/modules/vector_real_double_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_space_morphism.py +2 -2
- sage/modules/with_basis/cell_module.py +17 -0
- sage/modules/with_basis/indexed_element.cpython-310-darwin.so +0 -0
- sage/modules/with_basis/indexed_element.pyx +1 -1
- sage/modules/with_basis/invariant.py +1 -1
- sage/modules/with_basis/representation.py +0 -1
- sage/modules/with_basis/subquotient.py +2 -2
- sage/numerical/gauss_legendre.cpython-310-darwin.so +0 -0
- sage/probability/probability_distribution.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/binary_qf.py +7 -7
- sage/quadratic_forms/bqf_class_group.py +26 -92
- sage/quadratic_forms/count_local_2.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/extras.py +1 -1
- sage/quadratic_forms/quadratic_form.py +5 -4
- sage/quadratic_forms/quadratic_form__equivalence_testing.py +7 -4
- sage/quadratic_forms/quadratic_form__evaluate.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/quadratic_form__local_field_invariants.py +10 -10
- sage/quadratic_forms/quadratic_form__ternary_Tornaria.py +2 -2
- sage/quadratic_forms/ternary.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/ternary_qf.py +50 -83
- sage/rings/complex_conversion.cpython-310-darwin.so +0 -0
- sage/rings/complex_double.cpython-310-darwin.so +0 -0
- sage/rings/complex_double.pxd +1 -0
- sage/rings/complex_double.pyx +37 -32
- sage/rings/complex_mpc.cpython-310-darwin.so +0 -0
- sage/rings/complex_mpc.pyx +27 -23
- sage/rings/complex_mpfr.cpython-310-darwin.so +0 -0
- sage/rings/complex_mpfr.pyx +11 -9
- sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py +277 -21
- sage/rings/function_field/drinfeld_modules/drinfeld_module.py +10 -1
- sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py +1 -1
- sage/rings/function_field/drinfeld_modules/homset.py +1 -2
- sage/rings/function_field/drinfeld_modules/morphism.py +2 -2
- sage/rings/function_field/hermite_form_polynomial.cpython-310-darwin.so +0 -0
- sage/rings/function_field/khuri_makdisi.cpython-310-darwin.so +0 -0
- sage/rings/function_field/khuri_makdisi.pyx +27 -25
- sage/rings/invariants/invariant_theory.py +61 -60
- sage/rings/invariants/reconstruction.py +8 -8
- sage/rings/polynomial/laurent_polynomial_mpair.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/ore_function_element.py +1 -1
- sage/rings/polynomial/ore_polynomial_element.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/ore_polynomial_element.pyx +8 -8
- sage/rings/polynomial/ore_polynomial_ring.py +134 -17
- sage/rings/polynomial/polynomial_real_mpfr_dense.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_element.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_field.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_field.pyx +3 -4
- sage/rings/polynomial/skew_polynomial_finite_order.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_order.pyx +2 -5
- sage/rings/real_double_element_gsl.cpython-310-darwin.so +0 -0
- sage/rings/real_mpfr.cpython-310-darwin.so +0 -0
- sage/rings/real_mpfr.pyx +25 -7
- sage/rings/ring_extension.cpython-310-darwin.so +0 -0
- sage/rings/ring_extension.pyx +4 -2
- sage/rings/ring_extension_conversion.cpython-310-darwin.so +0 -0
- sage/rings/ring_extension_element.cpython-310-darwin.so +0 -0
- sage/rings/ring_extension_element.pyx +42 -0
- sage/rings/ring_extension_morphism.cpython-310-darwin.so +0 -0
- sage/schemes/projective/cohomology.py +2 -2
- sage/stats/basic_stats.py +9 -6
- sage/stats/distributions/dgs_misc.h +11 -4
- sage/stats/distributions/discrete_gaussian_integer.cpython-310-darwin.so +0 -0
- sage/stats/distributions/discrete_gaussian_integer.pyx +9 -7
- sage/stats/hmm/chmm.cpython-310-darwin.so +0 -0
- sage/stats/hmm/chmm.pyx +13 -13
- sage/stats/hmm/distributions.cpython-310-darwin.so +0 -0
- sage/stats/hmm/distributions.pxd +3 -3
- sage/stats/hmm/distributions.pyx +3 -3
- sage/stats/hmm/hmm.cpython-310-darwin.so +0 -0
- sage/stats/hmm/hmm.pxd +3 -3
- sage/stats/hmm/hmm.pyx +6 -6
- sage/stats/hmm/util.cpython-310-darwin.so +0 -0
- sage/stats/hmm/util.pyx +6 -6
- sage/stats/intlist.cpython-310-darwin.so +0 -0
- sage/stats/intlist.pxd +3 -3
- sage/stats/time_series.cpython-310-darwin.so +0 -0
- sage/tensor/modules/alternating_contr_tensor.py +3 -3
- sage/tensor/modules/comp.py +3 -3
- sage/tensor/modules/ext_pow_free_module.py +3 -3
- sage/tensor/modules/format_utilities.py +3 -3
- sage/tensor/modules/free_module_linear_group.py +3 -3
- sage/tensor/modules/free_module_morphism.py +0 -1
- sage/tensor/modules/tensor_free_module.py +3 -3
- sage/tensor/modules/tensor_free_submodule.py +1 -1
- sage/tensor/modules/tensor_free_submodule_basis.py +1 -1
- sage/tensor/modules/tensor_with_indices.py +5 -5
- {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/WHEEL +0 -0
- {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/top_level.txt +0 -0
|
Binary file
|
sage/matroids/lean_matrix.pyx
CHANGED
|
@@ -167,7 +167,7 @@ cdef class LeanMatrix:
|
|
|
167
167
|
cdef long i, j
|
|
168
168
|
cdef LeanMatrix A = type(self)(self.nrows(), self.ncols() + self.nrows())
|
|
169
169
|
for i in range(self.nrows()):
|
|
170
|
-
A.set_unsafe(i, i, self.base_ring()(
|
|
170
|
+
A.set_unsafe(i, i, self.base_ring().one())
|
|
171
171
|
for j in range(self.ncols()):
|
|
172
172
|
A.set_unsafe(i, self.nrows() + j, self.get_unsafe(i, j))
|
|
173
173
|
return A
|
|
@@ -209,9 +209,9 @@ cdef class LeanMatrix:
|
|
|
209
209
|
sage: A.base_ring()
|
|
210
210
|
Traceback (most recent call last):
|
|
211
211
|
...
|
|
212
|
-
NotImplementedError: subclasses need to implement this
|
|
212
|
+
NotImplementedError: subclasses need to implement this
|
|
213
213
|
"""
|
|
214
|
-
raise NotImplementedError("subclasses need to implement this
|
|
214
|
+
raise NotImplementedError("subclasses need to implement this")
|
|
215
215
|
|
|
216
216
|
cpdef characteristic(self):
|
|
217
217
|
"""
|
|
@@ -358,7 +358,7 @@ cdef class LeanMatrix:
|
|
|
358
358
|
and compatible dimensions.
|
|
359
359
|
"""
|
|
360
360
|
cdef LeanMatrix A = type(self)(self.nrows(), other.ncols())
|
|
361
|
-
cdef i, j, k
|
|
361
|
+
cdef long i, j, k
|
|
362
362
|
for i in range(self.nrows()):
|
|
363
363
|
for j in range(other.ncols()):
|
|
364
364
|
for k in range(self.ncols()):
|
|
@@ -488,9 +488,9 @@ cdef class LeanMatrix:
|
|
|
488
488
|
sage: A == loads(dumps(A)) # indirect doctest
|
|
489
489
|
Traceback (most recent call last):
|
|
490
490
|
...
|
|
491
|
-
NotImplementedError: subclasses need to implement this
|
|
491
|
+
NotImplementedError: subclasses need to implement this
|
|
492
492
|
"""
|
|
493
|
-
raise NotImplementedError("subclasses need to implement this
|
|
493
|
+
raise NotImplementedError("subclasses need to implement this")
|
|
494
494
|
|
|
495
495
|
cdef shifting_all(self, P_rows, P_cols, Q_rows, Q_cols, int m):
|
|
496
496
|
r"""
|
|
@@ -697,8 +697,8 @@ cdef class GenericMatrix(LeanMatrix):
|
|
|
697
697
|
# Default:
|
|
698
698
|
if self._base_ring is None:
|
|
699
699
|
self._base_ring = ZZ
|
|
700
|
-
self._zero = self._base_ring(
|
|
701
|
-
self._one = self._base_ring(
|
|
700
|
+
self._zero = self._base_ring.zero()
|
|
701
|
+
self._one = self._base_ring.one()
|
|
702
702
|
self._entries = [self._zero] * nrows * ncols
|
|
703
703
|
if M is not None:
|
|
704
704
|
if isinstance(M, GenericMatrix):
|
|
@@ -996,8 +996,8 @@ cdef class BinaryMatrix(LeanMatrix):
|
|
|
996
996
|
global GF2, GF2_zero, GF2_one, GF2_not_defined
|
|
997
997
|
if GF2_not_defined:
|
|
998
998
|
GF2 = GF(2)
|
|
999
|
-
GF2_zero = GF2(
|
|
1000
|
-
GF2_one = GF2(
|
|
999
|
+
GF2_zero = GF2.zero()
|
|
1000
|
+
GF2_one = GF2.one()
|
|
1001
1001
|
GF2_not_defined = False
|
|
1002
1002
|
if M is not None:
|
|
1003
1003
|
if isinstance(M, BinaryMatrix):
|
|
@@ -1434,7 +1434,7 @@ cdef class BinaryMatrix(LeanMatrix):
|
|
|
1434
1434
|
if s_eq.nrows() != o_eq.nrows():
|
|
1435
1435
|
return False
|
|
1436
1436
|
if s_eq.nrows() == s_eq.ncols(): # s_eq and o_eq partition into singletons
|
|
1437
|
-
morph = [0 for
|
|
1437
|
+
morph = [0 for _ in range(self._nrows)]
|
|
1438
1438
|
for i in range(self._nrows):
|
|
1439
1439
|
morph[bitset_first(s_eq._M[i])] = bitset_first(o_eq._M[i])
|
|
1440
1440
|
for i in range(self._nrows):
|
|
@@ -1581,8 +1581,8 @@ cdef class TernaryMatrix(LeanMatrix):
|
|
|
1581
1581
|
global GF3, GF3_zero, GF3_one, GF3_minus_one, GF3_not_defined
|
|
1582
1582
|
if GF3_not_defined:
|
|
1583
1583
|
GF3 = GF(3)
|
|
1584
|
-
GF3_zero = GF3(
|
|
1585
|
-
GF3_one = GF3(
|
|
1584
|
+
GF3_zero = GF3.zero()
|
|
1585
|
+
GF3_one = GF3.one()
|
|
1586
1586
|
GF3_minus_one = GF3(2)
|
|
1587
1587
|
GF3_not_defined = False
|
|
1588
1588
|
|
|
@@ -2171,8 +2171,8 @@ cdef class QuaternaryMatrix(LeanMatrix):
|
|
|
2171
2171
|
if M is not None:
|
|
2172
2172
|
if isinstance(M, QuaternaryMatrix):
|
|
2173
2173
|
self._gf4 = (<QuaternaryMatrix>M)._gf4
|
|
2174
|
-
self._zero = self._gf4(
|
|
2175
|
-
self._one = self._gf4(
|
|
2174
|
+
self._zero = self._gf4.zero()
|
|
2175
|
+
self._one = self._gf4.one()
|
|
2176
2176
|
self._x_zero = self._gf4.gens()[0]
|
|
2177
2177
|
self._x_one = self._x_zero + self._one
|
|
2178
2178
|
for i in range((<QuaternaryMatrix>M)._nrows):
|
|
@@ -2180,8 +2180,8 @@ cdef class QuaternaryMatrix(LeanMatrix):
|
|
|
2180
2180
|
bitset_copy(self._M1[i], (<QuaternaryMatrix>M)._M1[i])
|
|
2181
2181
|
elif isinstance(M, LeanMatrix):
|
|
2182
2182
|
self._gf4 = (<LeanMatrix>M).base_ring()
|
|
2183
|
-
self._zero = self._gf4(
|
|
2184
|
-
self._one = self._gf4(
|
|
2183
|
+
self._zero = self._gf4.zero()
|
|
2184
|
+
self._one = self._gf4.one()
|
|
2185
2185
|
self._x_zero = self._gf4.gens()[0]
|
|
2186
2186
|
self._x_one = self._x_zero + self._one
|
|
2187
2187
|
for i in range(M.nrows()):
|
|
@@ -2189,19 +2189,19 @@ cdef class QuaternaryMatrix(LeanMatrix):
|
|
|
2189
2189
|
self.set(i, j, (<LeanMatrix>M).get_unsafe(i, j))
|
|
2190
2190
|
elif isinstance(M, Matrix):
|
|
2191
2191
|
self._gf4 = (<Matrix>M).base_ring()
|
|
2192
|
-
self._zero = self._gf4(
|
|
2193
|
-
self._one = self._gf4(
|
|
2192
|
+
self._zero = self._gf4.zero()
|
|
2193
|
+
self._one = self._gf4.one()
|
|
2194
2194
|
self._x_zero = self._gf4.gens()[0]
|
|
2195
2195
|
self._x_one = self._x_zero + self._one
|
|
2196
2196
|
for i in range(M.nrows()):
|
|
2197
2197
|
for j in range(M.ncols()):
|
|
2198
2198
|
self.set(i, j, (<Matrix>M).get_unsafe(i, j))
|
|
2199
2199
|
else:
|
|
2200
|
-
raise TypeError("unrecognized input type
|
|
2200
|
+
raise TypeError("unrecognized input type")
|
|
2201
2201
|
else:
|
|
2202
2202
|
self._gf4 = ring
|
|
2203
|
-
self._zero = self._gf4(
|
|
2204
|
-
self._one = self._gf4(
|
|
2203
|
+
self._zero = self._gf4.zero()
|
|
2204
|
+
self._one = self._gf4.one()
|
|
2205
2205
|
self._x_zero = self._gf4.gens()[0]
|
|
2206
2206
|
self._x_one = self._x_zero + self._one
|
|
2207
2207
|
|
|
Binary file
|
sage/matroids/linear_matroid.pyx
CHANGED
|
@@ -879,8 +879,8 @@ cdef class LinearMatroid(BasisExchangeMatroid):
|
|
|
879
879
|
try:
|
|
880
880
|
if GF2_not_defined:
|
|
881
881
|
GF2 = GF(2)
|
|
882
|
-
GF2_zero = GF2(
|
|
883
|
-
GF2_one = GF2(
|
|
882
|
+
GF2_zero = GF2.zero()
|
|
883
|
+
GF2_one = GF2.one()
|
|
884
884
|
GF2_not_defined = False
|
|
885
885
|
except ImportError:
|
|
886
886
|
pass
|
|
@@ -1333,8 +1333,8 @@ cdef class LinearMatroid(BasisExchangeMatroid):
|
|
|
1333
1333
|
sage: M = Matroid(groundset='abcdefgh', ring=GF(5),
|
|
1334
1334
|
....: reduced_matrix=[[2, 1, 1, 0],
|
|
1335
1335
|
....: [1, 1, 0, 1], [1, 0, 1, 1], [0, 1, 1, 2]])
|
|
1336
|
-
sage: N = M._minor(contractions=set(['a']), deletions=set(
|
|
1337
|
-
sage: N._minor(contractions=set(
|
|
1336
|
+
sage: N = M._minor(contractions=set(['a']), deletions=set())
|
|
1337
|
+
sage: N._minor(contractions=set(), deletions=set(['b', 'c']))
|
|
1338
1338
|
Linear matroid of rank 3 on 5 elements represented over the Finite
|
|
1339
1339
|
Field of size 5
|
|
1340
1340
|
"""
|
|
@@ -2848,7 +2848,7 @@ cdef class LinearMatroid(BasisExchangeMatroid):
|
|
|
2848
2848
|
if sol:
|
|
2849
2849
|
if certificate:
|
|
2850
2850
|
(certX, certY) = cert_pair
|
|
2851
|
-
cert = set(
|
|
2851
|
+
cert = set()
|
|
2852
2852
|
for x in certX:
|
|
2853
2853
|
cert.add(dX[x])
|
|
2854
2854
|
for y in certY:
|
|
@@ -3101,8 +3101,8 @@ cdef class BinaryMatroid(LinearMatroid):
|
|
|
3101
3101
|
global GF2, GF2_zero, GF2_one, GF2_not_defined
|
|
3102
3102
|
if GF2_not_defined:
|
|
3103
3103
|
GF2 = GF(2)
|
|
3104
|
-
GF2_zero = GF2(
|
|
3105
|
-
GF2_one = GF2(
|
|
3104
|
+
GF2_zero = GF2.zero()
|
|
3105
|
+
GF2_one = GF2.one()
|
|
3106
3106
|
GF2_not_defined = False
|
|
3107
3107
|
|
|
3108
3108
|
# Setup representation; construct displayed basis
|
|
@@ -3785,8 +3785,8 @@ cdef class BinaryMatroid(LinearMatroid):
|
|
|
3785
3785
|
EXAMPLES::
|
|
3786
3786
|
|
|
3787
3787
|
sage: M = matroids.catalog.Fano()
|
|
3788
|
-
sage: N = M._minor(contractions=set(['a']), deletions=set(
|
|
3789
|
-
sage: N._minor(contractions=set(
|
|
3788
|
+
sage: N = M._minor(contractions=set(['a']), deletions=set())
|
|
3789
|
+
sage: N._minor(contractions=set(), deletions=set(['b', 'c']))
|
|
3790
3790
|
Binary matroid of rank 2 on 4 elements, type (0, 6)
|
|
3791
3791
|
"""
|
|
3792
3792
|
self._move_current_basis(contractions, deletions)
|
|
@@ -4820,8 +4820,8 @@ cdef class TernaryMatroid(LinearMatroid):
|
|
|
4820
4820
|
EXAMPLES::
|
|
4821
4821
|
|
|
4822
4822
|
sage: M = matroids.catalog.P8()
|
|
4823
|
-
sage: N = M._minor(contractions=set(['a']), deletions=set(
|
|
4824
|
-
sage: N._minor(contractions=set(
|
|
4823
|
+
sage: N = M._minor(contractions=set(['a']), deletions=set())
|
|
4824
|
+
sage: N._minor(contractions=set(), deletions=set(['b', 'c']))
|
|
4825
4825
|
Ternary matroid of rank 3 on 5 elements, type 0-
|
|
4826
4826
|
"""
|
|
4827
4827
|
self._move_current_basis(contractions, deletions)
|
|
@@ -5588,8 +5588,8 @@ cdef class QuaternaryMatroid(LinearMatroid):
|
|
|
5588
5588
|
EXAMPLES::
|
|
5589
5589
|
|
|
5590
5590
|
sage: M = matroids.catalog.Q10() # needs sage.rings.finite_rings
|
|
5591
|
-
sage: N = M._minor(contractions=set(['a']), deletions=set(
|
|
5592
|
-
sage: N._minor(contractions=set(
|
|
5591
|
+
sage: N = M._minor(contractions=set(['a']), deletions=set()) # needs sage.rings.finite_rings
|
|
5592
|
+
sage: N._minor(contractions=set(), deletions=set(['b', 'c'])) # needs sage.rings.finite_rings
|
|
5593
5593
|
Quaternary matroid of rank 4 on 7 elements
|
|
5594
5594
|
"""
|
|
5595
5595
|
self._move_current_basis(contractions, deletions)
|
|
Binary file
|
sage/matroids/matroid.pyx
CHANGED
|
@@ -906,7 +906,7 @@ cdef class Matroid(SageObject):
|
|
|
906
906
|
True
|
|
907
907
|
"""
|
|
908
908
|
cdef set XX = set(X)
|
|
909
|
-
cdef set res = set(
|
|
909
|
+
cdef set res = set()
|
|
910
910
|
cdef int r = self._rank(frozenset(X))
|
|
911
911
|
for e in Y:
|
|
912
912
|
XX.add(e)
|
|
@@ -1167,8 +1167,8 @@ cdef class Matroid(SageObject):
|
|
|
1167
1167
|
EXAMPLES::
|
|
1168
1168
|
|
|
1169
1169
|
sage: M = matroids.catalog.Vamos()
|
|
1170
|
-
sage: N = M._minor(contractions=set(['a']), deletions=set(
|
|
1171
|
-
sage: N._minor(contractions=set(
|
|
1170
|
+
sage: N = M._minor(contractions=set(['a']), deletions=set())
|
|
1171
|
+
sage: N._minor(contractions=set(), deletions=set(['b', 'c']))
|
|
1172
1172
|
M / {'a'} \ {'b', 'c'}, where M is Vamos:
|
|
1173
1173
|
Matroid of rank 4 on 8 elements with circuit-closures
|
|
1174
1174
|
{3: {{'a', 'b', 'c', 'd'}, {'a', 'b', 'e', 'f'},
|
|
@@ -2615,7 +2615,7 @@ cdef class Matroid(SageObject):
|
|
|
2615
2615
|
sage: [sorted(X) for X in CC[3]]
|
|
2616
2616
|
[['a', 'b', 'c', 'd', 'e', 'f', 'g']]
|
|
2617
2617
|
"""
|
|
2618
|
-
CC = [set(
|
|
2618
|
+
CC = [set() for r in range(self.rank() + 1)]
|
|
2619
2619
|
for C in self.circuits_iterator():
|
|
2620
2620
|
CC[len(C) - 1].add(self.closure(C))
|
|
2621
2621
|
return {r: CC[r] for r in range(self.rank() + 1) if CC[r]}
|
|
@@ -2646,7 +2646,7 @@ cdef class Matroid(SageObject):
|
|
|
2646
2646
|
...
|
|
2647
2647
|
KeyError: 3
|
|
2648
2648
|
"""
|
|
2649
|
-
CC = [set(
|
|
2649
|
+
CC = [set() for r in range(self.rank() + 1)]
|
|
2650
2650
|
for C in self.nonspanning_circuits_iterator():
|
|
2651
2651
|
CC[len(C) - 1].add(self.closure(C))
|
|
2652
2652
|
return {r: CC[r] for r in range(self.rank() + 1) if CC[r]}
|
|
@@ -4960,7 +4960,7 @@ cdef class Matroid(SageObject):
|
|
|
4960
4960
|
"""
|
|
4961
4961
|
E = set(self.groundset())
|
|
4962
4962
|
E.difference_update(self._closure(frozenset())) # groundset minus loops
|
|
4963
|
-
res = set(
|
|
4963
|
+
res = set()
|
|
4964
4964
|
|
|
4965
4965
|
while E:
|
|
4966
4966
|
e = E.pop()
|
|
@@ -4996,7 +4996,7 @@ cdef class Matroid(SageObject):
|
|
|
4996
4996
|
"""
|
|
4997
4997
|
E = set(self.groundset())
|
|
4998
4998
|
E.difference_update(self._coclosure(frozenset())) # groundset minus coloops
|
|
4999
|
-
res = set(
|
|
4999
|
+
res = set()
|
|
5000
5000
|
|
|
5001
5001
|
while E:
|
|
5002
5002
|
e = E.pop()
|
|
@@ -5428,7 +5428,7 @@ cdef class Matroid(SageObject):
|
|
|
5428
5428
|
for R1 in map(set, combinations(R, r2)):
|
|
5429
5429
|
R2 = R - R1
|
|
5430
5430
|
# F is the set of elements cannot be in the extension of Q1
|
|
5431
|
-
F = set(
|
|
5431
|
+
F = set()
|
|
5432
5432
|
U = E - R
|
|
5433
5433
|
# if Q1|R1 is full
|
|
5434
5434
|
if m-len(Q1)-len(R1) == 0:
|
|
@@ -5941,14 +5941,14 @@ cdef class Matroid(SageObject):
|
|
|
5941
5941
|
....: [0,0,0,0,1,1,1,1,0,0,1,1],
|
|
5942
5942
|
....: [0,0,0,0,0,0,0,0,1,1,1,1]])
|
|
5943
5943
|
sage: M._shifting_all(M.basis(),
|
|
5944
|
-
....: set([0,1]), set([0,1]), set(
|
|
5944
|
+
....: set([0,1]), set([0,1]), set(), set(), 3)
|
|
5945
5945
|
(False, None)
|
|
5946
5946
|
sage: M = Matroid(field=GF(2), reduced_matrix=[[1,0,1,1,1],
|
|
5947
5947
|
....: [1,1,1,1,0],
|
|
5948
5948
|
....: [0,1,1,1,0],
|
|
5949
5949
|
....: [0,0,0,1,1]])
|
|
5950
5950
|
sage: M._shifting_all(M.basis(),
|
|
5951
|
-
....: set([0,1]), set([5,8]), set(
|
|
5951
|
+
....: set([0,1]), set([5,8]), set(), set(), 3)[0]
|
|
5952
5952
|
True
|
|
5953
5953
|
"""
|
|
5954
5954
|
Y = self.groundset()-X
|
|
@@ -6002,14 +6002,14 @@ cdef class Matroid(SageObject):
|
|
|
6002
6002
|
....: [0,0,0,0,1,1,1,1,0,0,1,1],
|
|
6003
6003
|
....: [0,0,0,0,0,0,0,0,1,1,1,1]])
|
|
6004
6004
|
sage: M._shifting(M.basis(),
|
|
6005
|
-
....: set([0,1]), set([0,1]), set(
|
|
6005
|
+
....: set([0,1]), set([0,1]), set(), set(), 3)
|
|
6006
6006
|
(False, None)
|
|
6007
6007
|
sage: M = Matroid(field=GF(2), reduced_matrix=[[1,0,1,1,1],
|
|
6008
6008
|
....: [1,1,1,1,0],
|
|
6009
6009
|
....: [0,1,1,1,0],
|
|
6010
6010
|
....: [0,0,0,1,1]])
|
|
6011
6011
|
sage: M._shifting(M.basis(),
|
|
6012
|
-
....: set([0,1]), set([5,8]), set(
|
|
6012
|
+
....: set([0,1]), set([5,8]), set(), set([4]), 3)[0]
|
|
6013
6013
|
True
|
|
6014
6014
|
"""
|
|
6015
6015
|
|
|
@@ -7039,7 +7039,7 @@ cdef class Matroid(SageObject):
|
|
|
7039
7039
|
raise ValueError("nonnegative weights were expected.")
|
|
7040
7040
|
wt = sorted(wt, reverse=True)
|
|
7041
7041
|
Y = [e for (w, e) in wt]
|
|
7042
|
-
res = set(
|
|
7042
|
+
res = set()
|
|
7043
7043
|
r = 0
|
|
7044
7044
|
for e in Y:
|
|
7045
7045
|
res.add(e)
|
|
@@ -8018,8 +8018,8 @@ cdef class Matroid(SageObject):
|
|
|
8018
8018
|
a = x
|
|
8019
8019
|
b = y
|
|
8020
8020
|
R = ZZ['x, y']
|
|
8021
|
-
x, y = R.
|
|
8022
|
-
T = R(
|
|
8021
|
+
x, y = R.gens()
|
|
8022
|
+
T = R.zero()
|
|
8023
8023
|
for B in self.bases_iterator():
|
|
8024
8024
|
T += x ** len(self._internal(B)) * y ** len(self._external(B))
|
|
8025
8025
|
if a is not None and b is not None:
|
|
@@ -72,17 +72,16 @@ EXAMPLES::
|
|
|
72
72
|
# https://www.gnu.org/licenses/
|
|
73
73
|
# *****************************************************************************
|
|
74
74
|
|
|
75
|
-
import
|
|
76
|
-
import scipy.interpolate
|
|
77
|
-
import numpy as np
|
|
75
|
+
from sage.matroids.advanced import newlabel
|
|
78
76
|
from sage.misc.lazy_import import lazy_import
|
|
79
|
-
lazy_import("sage.plot.all", ["Graphics", "line", "text", "polygon2d", "point", "points"])
|
|
80
|
-
lazy_import("sage.plot.colors", "Color")
|
|
81
77
|
from sage.sets.set import Set
|
|
82
|
-
from sage.matroids.advanced import newlabel
|
|
83
78
|
|
|
79
|
+
lazy_import("sage.plot.all", ["Graphics", "line", "text",
|
|
80
|
+
"polygon2d", "point", "points"])
|
|
81
|
+
lazy_import("sage.plot.colors", "Color")
|
|
84
82
|
|
|
85
|
-
|
|
83
|
+
|
|
84
|
+
def it(M, B1, nB1, lps) -> tuple[dict, list, list, list]:
|
|
86
85
|
r"""
|
|
87
86
|
Return points on and off the triangle and lines to be drawn for a rank 3
|
|
88
87
|
matroid.
|
|
@@ -179,7 +178,7 @@ def it(M, B1, nB1, lps):
|
|
|
179
178
|
return pts, trilines, nontripts, curvedlines
|
|
180
179
|
|
|
181
180
|
|
|
182
|
-
def trigrid(tripts):
|
|
181
|
+
def trigrid(tripts) -> list[list]:
|
|
183
182
|
"""
|
|
184
183
|
Return a grid of 4 points inside given 3 points as a list.
|
|
185
184
|
|
|
@@ -206,7 +205,7 @@ def trigrid(tripts):
|
|
|
206
205
|
|
|
207
206
|
.. NOTE::
|
|
208
207
|
|
|
209
|
-
|
|
208
|
+
This method does NOT do any checks.
|
|
210
209
|
"""
|
|
211
210
|
pairs = [[0, 1], [1, 2], [0, 2]]
|
|
212
211
|
cpt = [float(tripts[0][0] + tripts[1][0] + tripts[2][0]) / 3,
|
|
@@ -219,7 +218,7 @@ def trigrid(tripts):
|
|
|
219
218
|
return grid
|
|
220
219
|
|
|
221
220
|
|
|
222
|
-
def addnontripts(tripts_labels, nontripts_labels, ptsdict):
|
|
221
|
+
def addnontripts(tripts_labels, nontripts_labels, ptsdict) -> dict:
|
|
223
222
|
"""
|
|
224
223
|
Return modified ``ptsdict`` with additional keys and values corresponding
|
|
225
224
|
to ``nontripts``.
|
|
@@ -261,16 +260,16 @@ def addnontripts(tripts_labels, nontripts_labels, ptsdict):
|
|
|
261
260
|
|
|
262
261
|
.. NOTE::
|
|
263
262
|
|
|
264
|
-
|
|
263
|
+
This method does NOT do any checks.
|
|
265
264
|
"""
|
|
266
265
|
tripts = [list(ptsdict[p]) for p in tripts_labels]
|
|
267
266
|
pairs = [[0, 1], [1, 2], [0, 2]]
|
|
268
267
|
q = [tripts]
|
|
269
268
|
num = len(nontripts_labels)
|
|
270
|
-
gridpts = [[float((tripts[0][0]+tripts[1][0]+tripts[2][0])/3),
|
|
271
|
-
float(tripts[0][1]+tripts[1][1]+tripts[2][1])/3]]
|
|
269
|
+
gridpts = [[float((tripts[0][0] + tripts[1][0] + tripts[2][0]) / 3),
|
|
270
|
+
float(tripts[0][1] + tripts[1][1] + tripts[2][1]) / 3]]
|
|
272
271
|
n = 0
|
|
273
|
-
while n < num+1:
|
|
272
|
+
while n < num + 1:
|
|
274
273
|
g = trigrid(q[0])
|
|
275
274
|
q.extend([[g[0], q[0][pairs[0][0]], q[0][pairs[0][1]]],
|
|
276
275
|
[g[0], q[0][pairs[1][0]], q[0][pairs[1][1]]],
|
|
@@ -286,7 +285,7 @@ def addnontripts(tripts_labels, nontripts_labels, ptsdict):
|
|
|
286
285
|
return ptsdict
|
|
287
286
|
|
|
288
287
|
|
|
289
|
-
def createline(ptsdict, ll, lineorders2=None):
|
|
288
|
+
def createline(ptsdict, ll, lineorders2=None) -> tuple[list, list, list, list]:
|
|
290
289
|
"""
|
|
291
290
|
Return ordered lists of coordinates of points to be traversed to draw a
|
|
292
291
|
2D line.
|
|
@@ -335,8 +334,12 @@ def createline(ptsdict, ll, lineorders2=None):
|
|
|
335
334
|
|
|
336
335
|
.. NOTE::
|
|
337
336
|
|
|
338
|
-
|
|
337
|
+
This method does NOT do any checks.
|
|
339
338
|
"""
|
|
339
|
+
import scipy
|
|
340
|
+
import scipy.interpolate
|
|
341
|
+
import numpy as np
|
|
342
|
+
|
|
340
343
|
x, lo = line_hasorder(ll, lineorders2)
|
|
341
344
|
flip = False
|
|
342
345
|
if not x:
|
|
@@ -368,7 +371,7 @@ def createline(ptsdict, ll, lineorders2=None):
|
|
|
368
371
|
return sortedx, sortedy, x_i, y_i
|
|
369
372
|
|
|
370
373
|
|
|
371
|
-
def slp(M1, pos_dict=None, B=None):
|
|
374
|
+
def slp(M1, pos_dict=None, B=None) -> tuple:
|
|
372
375
|
"""
|
|
373
376
|
Return simple matroid, loops and parallel elements of given matroid.
|
|
374
377
|
|
|
@@ -396,7 +399,7 @@ def slp(M1, pos_dict=None, B=None):
|
|
|
396
399
|
sage: M1 = Matroid(ring=GF(2), matrix=[[1, 0, 0, 0, 1, 1, 1,0,1,0,1],
|
|
397
400
|
....: [0, 1, 0, 1, 0, 1, 1,0,0,1,0],
|
|
398
401
|
....: [0, 0, 1, 1, 1, 0, 1,0,0,0,0]])
|
|
399
|
-
sage:
|
|
402
|
+
sage: M, L, P = matroids_plot_helpers.slp(M1) # needs sage.rings.finite_rings
|
|
400
403
|
sage: M.is_simple() # needs sage.rings.finite_rings
|
|
401
404
|
True
|
|
402
405
|
sage: setprint([L,P]) # needs sage.rings.finite_rings
|
|
@@ -406,7 +409,7 @@ def slp(M1, pos_dict=None, B=None):
|
|
|
406
409
|
....: [0, 0, 1, 1, 1, 0, 1,0,0,0,0]])
|
|
407
410
|
sage: posdict = {8: (0, 0), 1: (2, 0), 2: (1, 2), 3: (1.5, 1.0),
|
|
408
411
|
....: 4: (0.5, 1.0), 5: (1.0, 0.0), 6: (1.0, 0.6666666666666666)}
|
|
409
|
-
sage:
|
|
412
|
+
sage: M, L, P = matroids_plot_helpers.slp(M1, pos_dict=posdict) # needs sage.rings.finite_rings
|
|
410
413
|
sage: M.is_simple() # needs sage.rings.finite_rings
|
|
411
414
|
True
|
|
412
415
|
sage: setprint([L,P]) # needs sage.rings.finite_rings
|
|
@@ -414,23 +417,23 @@ def slp(M1, pos_dict=None, B=None):
|
|
|
414
417
|
|
|
415
418
|
.. NOTE::
|
|
416
419
|
|
|
417
|
-
|
|
420
|
+
This method does NOT do any checks.
|
|
418
421
|
"""
|
|
419
422
|
L = set(M1.loops())
|
|
420
423
|
nP = L | set(M1.simplify().groundset())
|
|
421
|
-
P = set(M1.groundset())-nP
|
|
424
|
+
P = set(M1.groundset()) - nP
|
|
422
425
|
if P:
|
|
423
426
|
if pos_dict is not None:
|
|
424
|
-
pcls = list(
|
|
425
|
-
|
|
427
|
+
pcls = list({frozenset(set(M1.closure([p])) - L)
|
|
428
|
+
for p in list(P)})
|
|
426
429
|
newP = []
|
|
427
430
|
for pcl in pcls:
|
|
428
431
|
pcl_in_dict = [p for p in list(pcl) if p in pos_dict.keys()]
|
|
429
|
-
newP.extend(list(pcl-set([pcl_in_dict[0]])))
|
|
432
|
+
newP.extend(list(pcl - set([pcl_in_dict[0]])))
|
|
430
433
|
return [M1.delete(L | set(newP)), L, set(newP)]
|
|
431
434
|
elif B is not None:
|
|
432
|
-
pcls = list(
|
|
433
|
-
|
|
435
|
+
pcls = list({frozenset(set(M1.closure([p])) - L)
|
|
436
|
+
for p in list(P)})
|
|
434
437
|
newP = []
|
|
435
438
|
for pcl in pcls:
|
|
436
439
|
pcl_list = list(pcl)
|
|
@@ -446,7 +449,7 @@ def slp(M1, pos_dict=None, B=None):
|
|
|
446
449
|
return [M1.delete(L | P), L, P]
|
|
447
450
|
|
|
448
451
|
|
|
449
|
-
def addlp(M, M1, L, P, ptsdict, G=None, limits=None):
|
|
452
|
+
def addlp(M, M1, L, P, ptsdict, G=None, limits=None) -> tuple:
|
|
450
453
|
"""
|
|
451
454
|
Return a graphics object containing loops (in inset) and parallel elements
|
|
452
455
|
of matroid.
|
|
@@ -477,13 +480,13 @@ def addlp(M, M1, L, P, ptsdict, G=None, limits=None):
|
|
|
477
480
|
sage: M = Matroid(ring=GF(2), matrix=[[1, 0, 0, 0, 1, 1, 1,0,1],
|
|
478
481
|
....: [0, 1, 0, 1, 0, 1, 1,0,0],
|
|
479
482
|
....: [0, 0, 1, 1, 1, 0, 1,0,0]])
|
|
480
|
-
sage:
|
|
483
|
+
sage: M1, L, P = matroids_plot_helpers.slp(M) # needs sage.rings.finite_rings
|
|
481
484
|
sage: G, lims = matroids_plot_helpers.addlp(M,M1,L,P,{0:(0,0)}) # needs sage.plot sage.rings.finite_rings
|
|
482
485
|
sage: G.show(axes=False) # needs sage.plot sage.rings.finite_rings
|
|
483
486
|
|
|
484
487
|
.. NOTE::
|
|
485
488
|
|
|
486
|
-
|
|
489
|
+
This method does NOT do any checks.
|
|
487
490
|
"""
|
|
488
491
|
if G is None:
|
|
489
492
|
G = Graphics()
|
|
@@ -552,7 +555,7 @@ def addlp(M, M1, L, P, ptsdict, G=None, limits=None):
|
|
|
552
555
|
return G, limits
|
|
553
556
|
|
|
554
557
|
|
|
555
|
-
def line_hasorder(l, lodrs=None):
|
|
558
|
+
def line_hasorder(l, lodrs=None) -> tuple[bool, list]:
|
|
556
559
|
"""
|
|
557
560
|
Determine if an order is specified for a line.
|
|
558
561
|
|
|
@@ -582,7 +585,7 @@ def line_hasorder(l, lodrs=None):
|
|
|
582
585
|
|
|
583
586
|
.. NOTE::
|
|
584
587
|
|
|
585
|
-
|
|
588
|
+
This method does NOT do any checks.
|
|
586
589
|
"""
|
|
587
590
|
if lodrs is not None:
|
|
588
591
|
set_l = Set(l)
|
|
@@ -593,7 +596,7 @@ def line_hasorder(l, lodrs=None):
|
|
|
593
596
|
return False, []
|
|
594
597
|
|
|
595
598
|
|
|
596
|
-
def lineorders_union(lineorders1, lineorders2):
|
|
599
|
+
def lineorders_union(lineorders1, lineorders2) -> list:
|
|
597
600
|
"""
|
|
598
601
|
Return a list of ordered lists of ground set elements that corresponds to
|
|
599
602
|
union of two sets of ordered lists of ground set elements in a sense.
|
|
@@ -634,7 +637,7 @@ def lineorders_union(lineorders1, lineorders2):
|
|
|
634
637
|
return None
|
|
635
638
|
|
|
636
639
|
|
|
637
|
-
def posdict_is_sane(M1, pos_dict):
|
|
640
|
+
def posdict_is_sane(M1, pos_dict) -> bool:
|
|
638
641
|
"""
|
|
639
642
|
Return a boolean establishing sanity of ``posdict`` wrt matroid ``M``.
|
|
640
643
|
|
|
@@ -666,25 +669,24 @@ def posdict_is_sane(M1, pos_dict):
|
|
|
666
669
|
|
|
667
670
|
.. NOTE::
|
|
668
671
|
|
|
669
|
-
|
|
670
|
-
|
|
672
|
+
This method does NOT do any checks. ``M1`` is assumed to be a
|
|
673
|
+
matroid and ``posdict`` is assumed to be a dictionary.
|
|
671
674
|
"""
|
|
672
675
|
L = set(M1.loops())
|
|
673
676
|
nP = L | set(M1.simplify().groundset())
|
|
674
|
-
P = set(M1.groundset())-nP
|
|
675
|
-
pcls = list(
|
|
677
|
+
P = set(M1.groundset()) - nP
|
|
678
|
+
pcls = list({frozenset(set(M1.closure([p])) - L) for p in list(P)})
|
|
676
679
|
for pcl in pcls:
|
|
677
|
-
|
|
678
|
-
if not any(x in pos_dict for x in pcl_list):
|
|
680
|
+
if not any(x in pos_dict for x in pcl):
|
|
679
681
|
return False
|
|
680
682
|
allP = []
|
|
681
683
|
for pcl in pcls:
|
|
682
|
-
allP.extend(
|
|
684
|
+
allP.extend(pcl)
|
|
683
685
|
return all(x in pos_dict
|
|
684
686
|
for x in list(set(M1.groundset()) - (L | set(allP))))
|
|
685
687
|
|
|
686
688
|
|
|
687
|
-
def tracklims(lims, x_i=[], y_i=[]):
|
|
689
|
+
def tracklims(lims, x_i=[], y_i=[]) -> list:
|
|
688
690
|
"""
|
|
689
691
|
Return modified limits list.
|
|
690
692
|
|
|
@@ -705,12 +707,12 @@ def tracklims(lims, x_i=[], y_i=[]):
|
|
|
705
707
|
|
|
706
708
|
.. NOTE::
|
|
707
709
|
|
|
708
|
-
|
|
710
|
+
This method does NOT do any checks.
|
|
709
711
|
"""
|
|
710
712
|
if lims is not None and lims[0] is not None and lims[1] is not None and \
|
|
711
713
|
lims[2] is not None and lims[3] is not None:
|
|
712
|
-
lims = [min(
|
|
713
|
-
min(
|
|
714
|
+
lims = [min(*x_i, lims[0]), max(*x_i, lims[1]),
|
|
715
|
+
min(*y_i, lims[2]), max(*y_i, lims[3])]
|
|
714
716
|
else:
|
|
715
717
|
lims = [min(x_i), max(x_i), min(y_i), max(y_i)]
|
|
716
718
|
return lims
|
|
@@ -753,11 +755,11 @@ def geomrep(M1, B1=None, lineorders1=None, pd=None, sp=False):
|
|
|
753
755
|
|
|
754
756
|
.. NOTE::
|
|
755
757
|
|
|
756
|
-
|
|
758
|
+
This method does NOT do any checks.
|
|
757
759
|
"""
|
|
758
760
|
G = Graphics()
|
|
759
761
|
# create lists of loops and parallel elements and simplify given matroid
|
|
760
|
-
|
|
762
|
+
M, L, P = slp(M1, pos_dict=pd, B=B1)
|
|
761
763
|
if B1 is None:
|
|
762
764
|
B1 = list(M.basis())
|
|
763
765
|
M._cached_info = M1._cached_info
|
sage/matroids/minor_matroid.py
CHANGED
|
@@ -325,8 +325,8 @@ class MinorMatroid(Matroid):
|
|
|
325
325
|
|
|
326
326
|
sage: from sage.matroids.advanced import *
|
|
327
327
|
sage: M = MinorMatroid(matroids.catalog.Vamos(), contractions=set('c'), deletions={'b', 'f'})
|
|
328
|
-
sage: N = M._minor(contractions=set(['a']), deletions=set(
|
|
329
|
-
sage: N._minor(contractions=set(
|
|
328
|
+
sage: N = M._minor(contractions=set(['a']), deletions=set())
|
|
329
|
+
sage: N._minor(contractions=set(), deletions=set(['d']))
|
|
330
330
|
M / {'a', 'c'} \ {'b', 'd', 'f'}, where M is Vamos:
|
|
331
331
|
Matroid of rank 4 on 8 elements with circuit-closures
|
|
332
332
|
{3: {{'a', 'b', 'c', 'd'}, {'a', 'b', 'e', 'f'},
|
|
Binary file
|
|
Binary file
|
|
@@ -43,19 +43,19 @@ REFERENCES:
|
|
|
43
43
|
# Distributed under the terms of the GNU General Public License (GPL)
|
|
44
44
|
# as published by the Free Software Foundation; either version 2 of
|
|
45
45
|
# the License, or (at your option) any later version.
|
|
46
|
-
#
|
|
46
|
+
# https://www.gnu.org/licenses/
|
|
47
47
|
# *****************************************************************************
|
|
48
48
|
|
|
49
49
|
from collections import Counter
|
|
50
50
|
from copy import copy
|
|
51
51
|
from cpython.object cimport Py_EQ, Py_NE
|
|
52
|
-
|
|
52
|
+
import networkx as nx
|
|
53
|
+
|
|
53
54
|
from sage.graphs.digraph import DiGraph
|
|
54
55
|
from sage.graphs.bipartite_graph import BipartiteGraph
|
|
55
56
|
from sage.matroids.basis_exchange_matroid cimport BasisExchangeMatroid
|
|
56
57
|
from sage.matroids.minor_matroid import MinorMatroid
|
|
57
58
|
from sage.matroids.utilities import newlabel
|
|
58
|
-
import networkx as nx
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
cdef class TransversalMatroid(BasisExchangeMatroid):
|
|
Binary file
|
sage/matroids/union_matroid.pyx
CHANGED
|
Binary file
|