summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTara Fife <fi.tara@gmail.com>2016-05-28 14:47:12 -0500
committerTara Fife <fi.tara@gmail.com>2016-05-28 14:47:12 -0500
commita584a6e0b6c84e8c7aff4d2258dfc479a8053235 (patch)
treede861dd86935cca898e45c46b47b9140d1ae2877
parentChanged cert to certificate (diff)
Fixed errors from comment
-rw-r--r--src/sage/matroids/basis_exchange_matroid.pxd2
-rw-r--r--src/sage/matroids/basis_exchange_matroid.pyx8
-rw-r--r--src/sage/matroids/basis_matroid.pxd2
-rw-r--r--src/sage/matroids/basis_matroid.pyx8
-rw-r--r--src/sage/matroids/circuit_closures_matroid.pxd2
-rw-r--r--src/sage/matroids/circuit_closures_matroid.pyx10
-rw-r--r--src/sage/matroids/linear_matroid.pxd8
-rw-r--r--src/sage/matroids/linear_matroid.pyx49
-rw-r--r--src/sage/matroids/matroid.pxd4
-rw-r--r--src/sage/matroids/matroid.pyx14
10 files changed, 69 insertions, 38 deletions
diff --git a/src/sage/matroids/basis_exchange_matroid.pxd b/src/sage/matroids/basis_exchange_matroid.pxd
index 9537d43..e7dca68 100644
--- a/src/sage/matroids/basis_exchange_matroid.pxd
+++ b/src/sage/matroids/basis_exchange_matroid.pxd
@@ -89,7 +89,7 @@ cdef class BasisExchangeMatroid(Matroid):
cdef _flush(self)
cpdef _equitable_partition(self, P=*)
- cpdef _is_isomorphic(self, other, cert=*)
+ cpdef _is_isomorphic(self, other, certificate=*)
cpdef _isomorphism(self, other)
cpdef _is_isomorphism(self, other, morphism)
cdef bint __is_isomorphism(self, BasisExchangeMatroid other, morphism)
diff --git a/src/sage/matroids/basis_exchange_matroid.pyx b/src/sage/matroids/basis_exchange_matroid.pyx
index 774ab63..c62247a 100644
--- a/src/sage/matroids/basis_exchange_matroid.pyx
+++ b/src/sage/matroids/basis_exchange_matroid.pyx
@@ -2250,13 +2250,13 @@ cdef class BasisExchangeMatroid(Matroid):
INPUT:
- - ``other`` -- A matroid,
+ - ``other`` -- A matroid,
- optional parameter ``certificate`` -- Boolean.
OUTPUT:
- Boolean,
- and, if certificate = True, a dictionary or None
+ Boolean,
+ and, if certificate = True, a dictionary giving the isomophism or None
.. NOTE::
@@ -2269,6 +2269,8 @@ cdef class BasisExchangeMatroid(Matroid):
sage: M2 = matroids.CompleteGraphic(4)
sage: M1._is_isomorphic(M2)
True
+ sage: M1._is_isomorphic(M2, certificate=True)
+ (True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4})
sage: M1._is_isomorphic(M2, True)
(True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4})
sage: M1 = BasisMatroid(matroids.named_matroids.Fano())
diff --git a/src/sage/matroids/basis_matroid.pxd b/src/sage/matroids/basis_matroid.pxd
index 1e0d21b..4f53e89 100644
--- a/src/sage/matroids/basis_matroid.pxd
+++ b/src/sage/matroids/basis_matroid.pxd
@@ -38,7 +38,7 @@ cdef class BasisMatroid(BasisExchangeMatroid):
cpdef _is_relaxation(self, M, morphism)
cpdef _is_isomorphism(self, M, morphism)
cpdef _isomorphism(self, other)
- cpdef _is_isomorphic(self, other, cert=*)
+ cpdef _is_isomorphic(self, other, certificate=*)
cdef binom_init(long n, long k)
diff --git a/src/sage/matroids/basis_matroid.pyx b/src/sage/matroids/basis_matroid.pyx
index 9175f9d..8784bc1 100644
--- a/src/sage/matroids/basis_matroid.pyx
+++ b/src/sage/matroids/basis_matroid.pyx
@@ -1033,13 +1033,13 @@ cdef class BasisMatroid(BasisExchangeMatroid):
INPUT:
- - ``other`` -- A matroid,
+ - ``other`` -- A matroid,
- optional parameter ``certificate`` -- Boolean.
OUTPUT:
- Boolean,
- and, if certificate = True, a dictionary or None
+ Boolean,
+ and, if certificate = True, a dictionary giving the isomophism or None
.. NOTE::
@@ -1052,6 +1052,8 @@ cdef class BasisMatroid(BasisExchangeMatroid):
sage: N = BasisMatroid(matroids.named_matroids.Fano())
sage: M._is_isomorphic(N)
False
+ sage: M._is_isomorphic(N, certificate=True)
+ (False, None)
sage: M._is_isomorphic(N, True)
(False, None)
"""
diff --git a/src/sage/matroids/circuit_closures_matroid.pxd b/src/sage/matroids/circuit_closures_matroid.pxd
index 5af62ba..fc139ed 100644
--- a/src/sage/matroids/circuit_closures_matroid.pxd
+++ b/src/sage/matroids/circuit_closures_matroid.pxd
@@ -11,4 +11,4 @@ cdef class CircuitClosuresMatroid(Matroid):
cpdef _max_independent(self, F)
cpdef _circuit(self, F)
cpdef circuit_closures(self)
- cpdef _is_isomorphic(self, other, cert=*)
+ cpdef _is_isomorphic(self, other, certificate=*)
diff --git a/src/sage/matroids/circuit_closures_matroid.pyx b/src/sage/matroids/circuit_closures_matroid.pyx
index 063cd31..116c68d 100644
--- a/src/sage/matroids/circuit_closures_matroid.pyx
+++ b/src/sage/matroids/circuit_closures_matroid.pyx
@@ -363,13 +363,13 @@ cdef class CircuitClosuresMatroid(Matroid):
NPUT:
- - ``other`` -- A matroid,
+ - ``other`` -- A matroid,
- optional parameter ``certificate`` -- Boolean.
OUTPUT:
- Boolean,
- and, if certificate = True, a dictionary or None
+ Boolean,
+ and, if certificate = True, a dictionary giving the isomophism or None
.. NOTE::
@@ -382,12 +382,16 @@ cdef class CircuitClosuresMatroid(Matroid):
sage: M2 = matroids.CompleteGraphic(4)
sage: M1._is_isomorphic(M2)
True
+ sage: M1._is_isomorphic(M2, certificate=True)
+ (True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4})
sage: M1._is_isomorphic(M2, True)
(True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4})
sage: M1 = CircuitClosuresMatroid(matroids.named_matroids.Fano())
sage: M2 = matroids.named_matroids.NonFano()
sage: M1._is_isomorphic(M2)
False
+ sage: M1._is_isomorphic(M2, Certificate=True)
+ (False, None)
sage: M1._is_isomorphic(M2, True)
(False, None)
diff --git a/src/sage/matroids/linear_matroid.pxd b/src/sage/matroids/linear_matroid.pxd
index 887b948..51b8181 100644
--- a/src/sage/matroids/linear_matroid.pxd
+++ b/src/sage/matroids/linear_matroid.pxd
@@ -79,7 +79,7 @@ cdef class BinaryMatroid(LinearMatroid):
cdef __fundamental_cocircuit(self, bitset_t, long x)
- cpdef _is_isomorphic(self, other, cert=*)
+ cpdef _is_isomorphic(self, other, certificate=*)
cpdef _minor(self, contractions, deletions)
@@ -110,7 +110,7 @@ cdef class TernaryMatroid(LinearMatroid):
cdef __fundamental_cocircuit(self, bitset_t, long x)
- cpdef _is_isomorphic(self, other, cert=*)
+ cpdef _is_isomorphic(self, other, certificate=*)
cpdef _minor(self, contractions, deletions)
@@ -138,7 +138,7 @@ cdef class QuaternaryMatroid(LinearMatroid):
cdef __fundamental_cocircuit(self, bitset_t, long x)
- cpdef _is_isomorphic(self, other, cert=*)
+ cpdef _is_isomorphic(self, other, certificate=*)
cpdef _minor(self, contractions, deletions)
@@ -158,7 +158,7 @@ cdef class RegularMatroid(LinearMatroid):
cpdef base_ring(self)
cpdef characteristic(self)
- cpdef _is_isomorphic(self, other, cert=*)
+ cpdef _is_isomorphic(self, other, certificate=*)
cpdef _invariant(self)
cpdef _fast_isom_test(self, other)
diff --git a/src/sage/matroids/linear_matroid.pyx b/src/sage/matroids/linear_matroid.pyx
index d2c4744..90d9e45 100644
--- a/src/sage/matroids/linear_matroid.pyx
+++ b/src/sage/matroids/linear_matroid.pyx
@@ -2694,7 +2694,7 @@ cdef class LinearMatroid(BasisExchangeMatroid):
return False, cert
return False
if certificate:
- return True, None
+ return True,None
return True
cpdef _is_4connected_shifting(self, certificate=False):
@@ -3273,13 +3273,13 @@ cdef class BinaryMatroid(LinearMatroid):
NPUT:
- - ``other`` -- A matroid,
+ - ``other`` -- A matroid,
- optional parameter ``certificate`` -- Boolean.
OUTPUT:
- Boolean,
- and, if certificate = True, a dictionary or None
+ Boolean,
+ and, if certificate = True, a dictionary giving the isomophism or None
.. NOTE::
@@ -3292,13 +3292,26 @@ cdef class BinaryMatroid(LinearMatroid):
....: reduced_matrix=[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 0, 1]])
sage: M1._is_isomorphic(M2)
True
+ sage: M1._is_isomorphic(M2, certificate=True)
+ (True, {'a': 0, 'b': 1, 'c': 2, 'd': 4, 'e': 3, 'f': 5, 'g': 6})
+ sage: M1._is_isomorphic(M2, True)
+ (True, {'a': 0, 'b': 1, 'c': 2, 'd': 4, 'e': 3, 'f': 5, 'g': 6})
sage: M1 = matroids.named_matroids.Fano().delete('a')
sage: M2 = matroids.Whirl(3)
sage: M1._is_isomorphic(M2)
False
+ sage: M1._is_isomorphic(M2, certificate=True)
+ (False, None)
+ sage: M1._is_isomorphic(M2, True)
+ (False, None)
sage: M1._is_isomorphic(matroids.Wheel(3))
True
+ sage: M1._is_isomorphic(matroids.Wheel(3), certificate=True)
+ (True, {'b': 1, 'c': 2, 'd': 4, 'e': 3, 'f': 5, 'g': 0})
+ sage: M1._is_isomorphic(matroids.Wheel(3), True)
+ (True, {'b': 1, 'c': 2, 'd': 4, 'e': 3, 'f': 5, 'g': 0})
+
"""
if certificate:
return self._is_isomorphic(other), self._isomorphism(other)
@@ -4320,20 +4333,20 @@ cdef class TernaryMatroid(LinearMatroid):
# isomorphism
- cpdef _is_isomorphic(self, other, cert=False):
+ cpdef _is_isomorphic(self, other, certificate=False):
"""
Test if ``self`` is isomorphic to ``other``. Internal version that
performs no checks on input.
NPUT:
- - ``other`` -- A matroid,
- - optional parameter ``cert`` -- Boolean.
+ - ``other`` -- A matroid,
+ - optional parameter ``certificate`` -- Boolean.
OUTPUT:
- Boolean,
- and, if cert = True, a dictionary or None
+ Boolean,
+ and, if certificate = True, a dictionary giving the isomophism or None
.. NOTE::
@@ -4350,7 +4363,7 @@ cdef class TernaryMatroid(LinearMatroid):
sage: M1._is_isomorphic(M2)
False
"""
- if cert:
+ if certificate:
return self._is_isomorphic(other), self._isomorphism(other)
if type(other) == TernaryMatroid:
return self.is_field_isomorphic(other)
@@ -5957,7 +5970,7 @@ cdef class RegularMatroid(LinearMatroid):
# self._r_hypergraph = self._r_hypergraph.max_refined()
# return self._r_hypergraph
- cpdef _is_isomorphic(self, other, cert=False):
+ cpdef _is_isomorphic(self, other, certificate=False):
"""
Test if ``self`` is isomorphic to ``other``.
@@ -5965,13 +5978,13 @@ cdef class RegularMatroid(LinearMatroid):
NPUT:
- - ``other`` -- A matroid,
- - optional parameter ``cert`` -- Boolean.
+ - ``other`` -- A matroid,
+ - optional parameter ``certificate`` -- Boolean.
OUTPUT:
- Boolean,
- and, if cert = True, a dictionary or None
+ Boolean,
+ and, if certificate = True, a dictionary giving the isomophism or None
.. NOTE::
@@ -5983,6 +5996,8 @@ cdef class RegularMatroid(LinearMatroid):
sage: M2 = matroids.CompleteGraphic(4)
sage: M1._is_isomorphic(M2)
True
+ sage: M1._is_isomorphic(M2, certificate=True)
+ (True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4})
sage: M1._is_isomorphic(M2, True)
(True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4})
@@ -5992,6 +6007,8 @@ cdef class RegularMatroid(LinearMatroid):
False
sage: M1._is_isomorphic(M2.delete('a'))
True
+ sage: M1._is_isomorphic(M2.delete('a'), certificate=True)
+ (True, {0: 'g', 1: 'b', 2: 'c', 3: 'e', 4: 'd', 5: 'f'})
sage: M1._is_isomorphic(M2.delete('a'), True)
(True, {0: 'g', 1: 'b', 2: 'c', 3: 'e', 4: 'd', 5: 'f'})
@@ -6017,7 +6034,7 @@ cdef class RegularMatroid(LinearMatroid):
sage: len(Mnew.circuits()) == len(Nnew.circuits())
False
"""
- if cert:
+ if certificate:
return self._is_isomorphic(other), self._isomorphism(other)
if type(other) == RegularMatroid:
return self.is_field_isomorphic(other)
diff --git a/src/sage/matroids/matroid.pxd b/src/sage/matroids/matroid.pxd
index e488b6a..71bf59c 100644
--- a/src/sage/matroids/matroid.pxd
+++ b/src/sage/matroids/matroid.pxd
@@ -103,8 +103,8 @@ cdef class Matroid(SageObject):
cpdef no_broken_circuits_sets(self, ordering=*)
# isomorphism
- cpdef is_isomorphic(self, other, cert=*)
- cpdef _is_isomorphic(self, other, cert=*)
+ cpdef is_isomorphic(self, other, certificate=*)
+ cpdef _is_isomorphic(self, other, certificate=*)
cpdef isomorphism(self, other)
cpdef _isomorphism(self, other)
cpdef equals(self, other)
diff --git a/src/sage/matroids/matroid.pyx b/src/sage/matroids/matroid.pyx
index 152d246..21a1db1 100644
--- a/src/sage/matroids/matroid.pyx
+++ b/src/sage/matroids/matroid.pyx
@@ -3080,12 +3080,12 @@ cdef class Matroid(SageObject):
INPUT:
- - ``other`` -- A matroid,
+ - ``other`` -- A matroid,
- optional parameter ``certificate`` -- Boolean.
OUTPUT:
- Boolean,
+ Boolean,
and, if certificate = True, a dictionary or None
EXAMPLES::
@@ -3094,6 +3094,8 @@ cdef class Matroid(SageObject):
sage: M2 = matroids.CompleteGraphic(4)
sage: M1.is_isomorphic(M2)
True
+ sage: M1.is_isomorphic(M2, certificate=True)
+ (True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4})
sage: M1.is_isomorphic(M2, True)
(True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4})
sage: G3 = graphs.CompleteGraph(4)
@@ -3107,6 +3109,8 @@ cdef class Matroid(SageObject):
sage: M2 = matroids.named_matroids.NonFano()
sage: M1.is_isomorphic(M2)
False
+ sage: M1.is_isomorphic(M2, certificate=True)
+ (False, None)
sage: M1.is_isomorphic(M2, True)
(False, None)
"""
@@ -3123,12 +3127,12 @@ cdef class Matroid(SageObject):
INPUT:
- ``other`` -- A matroid,
- - optional parameter ``cert`` -- Boolean.
+ - optional parameter ``certificate`` -- Boolean.
OUTPUT:
Boolean,
- and, if cert = True, a dictionary or None
+ and, if certificate = True, a dictionary giving the isomophism or None
.. NOTE::
@@ -3140,6 +3144,8 @@ cdef class Matroid(SageObject):
sage: M2 = matroids.CompleteGraphic(4)
sage: M1._is_isomorphic(M2)
True
+ sage: M1._is_isomorphic(M2, certificate=True)
+ (True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4})
sage: M1._is_isomorphic(M2, True)
(True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4})