@@ -560,7 +560,7 @@ def __contains__(self, point):
560
560
False
561
561
"""
562
562
return self ._contains (point )
563
-
563
+
564
564
def __eq__ (self , other ):
565
565
r"""
566
566
Compare ``self`` with ``other``.
@@ -755,8 +755,7 @@ def _compute_facets(self):
755
755
constants = (constants [1 ], constants [0 ])
756
756
self .is_reflexive .set_cache (all (c == 1 for c in constants ))
757
757
if self .is_reflexive ():
758
- polar = LatticePolytope (
759
- normals , compute_vertices = False , lattice = N )
758
+ polar = LatticePolytope (normals , compute_vertices = False , lattice = N )
760
759
polar .dim .set_cache (self .dim ())
761
760
polar .is_reflexive .set_cache (True )
762
761
polar ._polar = self
@@ -798,20 +797,17 @@ def _contains(self, point, region='whole polytope'):
798
797
799
798
INPUT:
800
799
801
- - ``point`` -- anything. An attempt will be made to convert it into a
802
- single element of the ambient space of ``self``. If it fails,
803
- ``False`` is returned;
800
+ - ``point`` -- an attempt will be made to convert it into a
801
+ single element of the ambient space of ``self``; if it fails,
802
+ ``False`` is returned
804
803
805
- - ``region`` -- string. Can be either 'whole polytope' (default),
806
- 'interior', or 'relative interior'.
804
+ - ``region`` -- string; can be either `` 'whole polytope'`` (default),
805
+ `` 'interior'`` , or `` 'relative interior'``
807
806
808
807
OUTPUT:
809
808
810
809
- ``True`` if ``point`` is contained in the specified ``region`` of
811
- ``self``, ``False`` otherwise.
812
-
813
- Raises a ``ValueError`` if ``region`` is not one of the
814
- three allowed values.
810
+ ``self``, ``False`` otherwise
815
811
816
812
TESTS::
817
813
@@ -822,9 +818,9 @@ def _contains(self, point, region='whole polytope'):
822
818
try :
823
819
point = _ambient_space_point (self , point )
824
820
except TypeError as ex :
825
- if str (ex ).endswith ("have incompatible lattices! " ):
821
+ if str (ex ).endswith ("have incompatible lattices" ):
826
822
warnings .warn ("you have checked if a cone contains a point "
827
- "from an incompatible lattice, this is False! " ,
823
+ "from an incompatible lattice, this is False" ,
828
824
stacklevel = 3 )
829
825
return False
830
826
@@ -1666,14 +1662,14 @@ def contains(self, *args):
1666
1662
1667
1663
INPUT:
1668
1664
1669
- - anything. An attempt will be made to convert all arguments into a
1670
- single element of the ambient space of ``self``. If it fails,
1671
- ``False`` will be returned.
1665
+ - an attempt will be made to convert all arguments into a
1666
+ single element of the ambient space of ``self``; if it fails,
1667
+ ``False`` will be returned
1672
1668
1673
1669
OUTPUT:
1674
1670
1675
1671
- ``True`` if the given point is contained in ``self``, ``False``
1676
- otherwise.
1672
+ otherwise
1677
1673
1678
1674
EXAMPLES::
1679
1675
@@ -1697,8 +1693,9 @@ def dim(self):
1697
1693
r"""
1698
1694
Return the dimension of this polytope.
1699
1695
1700
- EXAMPLES: We create a 3-dimensional octahedron and check its
1701
- dimension::
1696
+ EXAMPLES:
1697
+
1698
+ We create a 3-dimensional octahedron and check its dimension::
1702
1699
1703
1700
sage: o = lattice_polytope.cross_polytope(3)
1704
1701
sage: o.dim()
@@ -1763,9 +1760,9 @@ def distances(self, point=None):
1763
1760
[0 2 2 0 1]
1764
1761
sage: p.distances((1/2, 3, 0))
1765
1762
(9/2, -3/2, -5/2, 7/2)
1766
-
1763
+
1767
1764
This point is not even in the affine subspace of the polytope::
1768
-
1765
+
1769
1766
sage: p.distances((1, 1, 1))
1770
1767
(3, 1, -1, 1)
1771
1768
"""
@@ -2121,24 +2118,24 @@ def faces(self, dim=None, codim=None):
2121
2118
def facet_constant (self , i ):
2122
2119
r"""
2123
2120
Return the constant in the ``i``-th facet inequality of this polytope.
2124
-
2125
- This is equivalent to ``facet_constants()[i]``
2121
+
2122
+ This is equivalent to ``facet_constants()[i]``.
2126
2123
2127
2124
INPUT:
2128
2125
2129
- - ``i`` - integer, the index of the facet
2126
+ - ``i`` -- integer; the index of the facet
2130
2127
2131
2128
OUTPUT:
2132
2129
2133
2130
- integer -- the constant in the ``i``-th facet inequality.
2134
2131
2135
2132
.. SEEALSO::
2136
-
2133
+
2137
2134
:meth:`facet_constants`,
2138
2135
:meth:`facet_normal`,
2139
2136
:meth:`facet_normals`,
2140
2137
:meth:`facets`.
2141
-
2138
+
2142
2139
EXAMPLES::
2143
2140
2144
2141
sage: o = lattice_polytope.cross_polytope(3)
@@ -2158,15 +2155,15 @@ def facet_constants(self):
2158
2155
2159
2156
OUTPUT:
2160
2157
2161
- - an integer vector.
2158
+ - an integer vector
2162
2159
2163
2160
.. SEEALSO::
2164
-
2161
+
2165
2162
:meth:`facet_constant`,
2166
2163
:meth:`facet_normal`,
2167
2164
:meth:`facet_normals`,
2168
2165
:meth:`facets`.
2169
-
2166
+
2170
2167
EXAMPLES:
2171
2168
2172
2169
For reflexive polytopes all constants are 1::
@@ -2207,23 +2204,23 @@ def facet_normal(self, i):
2207
2204
r"""
2208
2205
Return the inner normal to the ``i``-th facet of this polytope.
2209
2206
2210
- This is equivalent to ``facet_normals()[i]``
2207
+ This is equivalent to ``facet_normals()[i]``.
2211
2208
2212
2209
INPUT:
2213
2210
2214
- - ``i`` -- integer, the index of the facet
2211
+ - ``i`` -- integer; the index of the facet
2215
2212
2216
2213
OUTPUT:
2217
2214
2218
2215
- a vector
2219
-
2216
+
2220
2217
.. SEEALSO::
2221
-
2218
+
2222
2219
:meth:`facet_constant`,
2223
2220
:meth:`facet_constants`,
2224
2221
:meth:`facet_normals`,
2225
2222
:meth:`facets`.
2226
-
2223
+
2227
2224
EXAMPLES::
2228
2225
2229
2226
sage: o = lattice_polytope.cross_polytope(3)
@@ -2247,12 +2244,12 @@ def facet_normals(self):
2247
2244
:meth:`dual_lattice` of ``self``.
2248
2245
2249
2246
.. SEEALSO::
2250
-
2247
+
2251
2248
:meth:`facet_constant`,
2252
2249
:meth:`facet_constants`,
2253
2250
:meth:`facet_normal`,
2254
2251
:meth:`facets`.
2255
-
2252
+
2256
2253
EXAMPLES:
2257
2254
2258
2255
Normals to facets of an octahedron are vertices of a cube::
0 commit comments