Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge #30469
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed May 16, 2021
2 parents c0c7631 + 479f743 commit ab9d41e
Show file tree
Hide file tree
Showing 26 changed files with 467 additions and 59 deletions.
8 changes: 4 additions & 4 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"description": "Mirror of the Sage https://sagemath.org/ source tree",
"license": "other-open",
"title": "sagemath/sage: 9.3.rc5",
"version": "9.3.rc5",
"title": "sagemath/sage: 9.3",
"version": "9.3",
"upload_type": "software",
"publication_date": "2021-04-30",
"publication_date": "2021-05-09",
"creators": [
{
"affiliation": "SageMath.org",
Expand All @@ -15,7 +15,7 @@
"related_identifiers": [
{
"scheme": "url",
"identifier": "https://github.com/sagemath/sage/tree/9.3.rc5",
"identifier": "https://github.com/sagemath/sage/tree/9.3",
"relation": "isSupplementTo"
},
{
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SageMath version 9.3.rc5, Release Date: 2021-04-30
SageMath version 9.3, Release Date: 2021-05-09
3 changes: 2 additions & 1 deletion build/pkgs/brial/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SAGE_SPKG_CONFIGURE([brial], [
SAGE_SPKG_DEPCHECK([boost m4ri], [
dnl Trac #31624: Avoid C++ ABI issues
SAGE_SPKG_DEPCHECK([gcc boost m4ri], [
# If we're using the system m4ri and boost, ensure that we can
# compile and run an executable linked against both libbrial and
# libbrial_groebner (both are used by SageMath).
Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=4a3ebd8c296607fb48548489fd6f45c6c1c0ca64
md5=0d839b97966e72b83522932b05be89ea
cksum=481169191
sha1=2d5d2d8a2a6dbc721935f6b3d3ada9a6bd977e19
md5=d84b8fcb2ddd6949d3461f49fae01702
cksum=2508666370
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b570ac37fdb82f0c3525ce24c8ee6ab7afbbbf8e
3f4547f2cc40338ba42329d53f7fb48c31ff9fc8
2 changes: 1 addition & 1 deletion build/pkgs/fplll/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SAGE_SPKG_CONFIGURE([fplll], [
SAGE_SPKG_DEPCHECK([mpfr], [
SAGE_SPKG_DEPCHECK([gcc mpfr], [
dnl If we're using the system mpfr, use pkgconfig to determine
dnl if there's a usable system copy of fplll. Unless there's
dnl a system that ships fplll without fplll.pc file, falling
Expand Down
5 changes: 5 additions & 0 deletions build/pkgs/fplll/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ if [ "x$SAGE_DEBUG" = "xyes" ]; then
CONFIGUREFLAGS="$CONFIGUREFLAGS --enable-debug"
fi

if [ -x "$SAGE_LOCAL"/bin/gcc ]; then
# Trac #31624: Avoid C++ ABI issues
CONFIGUREFLAGS="$CONFIGUREFLAGS --without-qd"
fi

export CXXFLAGS="$CXXFLAGS"
export CPPFLAGS="$CPPFLAGS"
export CXX="$CXX"
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/freetype/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SAGE_SPKG_CONFIGURE([freetype], [
SAGE_SPKG_DEPCHECK([libpng], [
SAGE_SPKG_DEPCHECK([gcc libpng], [
dnl freetype versions are libtool's ones, cf trac #30014
PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 16.1], [], [sage_spkg_install_freetype=yes])
])
Expand Down
21 changes: 3 additions & 18 deletions build/pkgs/libgd/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
SAGE_SPKG_CONFIGURE([libgd], [
AC_REQUIRE([SAGE_SPKG_CONFIGURE_LIBPNG])
AC_REQUIRE([SAGE_SPKG_CONFIGURE_FREETYPE])
AC_MSG_CHECKING([Installing freetype? ])
if test x$sage_spkg_install_freetype = xyes; then
AC_MSG_RESULT([Yes. Install libgd as well.])
sage_spkg_install_libgd=yes
else
dnl do not just rely on libpng being a dependency of freetype
AC_MSG_CHECKING([Installing libpng? ])
if test x$sage_spkg_install_libpng = xyes; then
AC_MSG_RESULT([Yes. Install libgd as well.])
sage_spkg_install_libgd=yes
else
AC_MSG_RESULT([No.])
dnl Trac #31624: Avoid C++ ABI issues
SAGE_SPKG_DEPCHECK([gcc libpng freetype], [
PKG_CHECK_MODULES([LIBGD], [gdlib >= 2.1], [], [sage_spkg_install_libgd=yes])
fi
fi
])
])


14 changes: 2 additions & 12 deletions build/pkgs/ntl/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
SAGE_SPKG_CONFIGURE([ntl], [
AC_REQUIRE([SAGE_SPKG_CONFIGURE_GMP])
AC_MSG_CHECKING([installing gmp/mpir? ])
if test x$sage_spkg_install_mpir = xyes -o x$sage_spkg_install_gmp = xyes; then
AC_MSG_RESULT([yes; install ntl as well])
sage_spkg_install_ntl=yes
else
AC_MSG_RESULT([no])
fi
m4_pushdef(SAGE_NTL_VERSION_MAJOR, [10])
m4_pushdef(SAGE_NTL_VERSION_MINOR, [3])
if test x$sage_spkg_install_ntl != xyes; then
SAGE_SPKG_DEPCHECK([gmp mpir gcc], [
AC_CHECK_HEADER([NTL/ZZ.h], [], [sage_spkg_install_ntl=yes])
AC_MSG_CHECKING([whether we can link a program using NTL])
NTL_SAVED_LIBS=$LIBS
Expand Down Expand Up @@ -40,7 +30,7 @@ SAGE_SPKG_CONFIGURE([ntl], [
AC_MSG_RESULT([no])
sage_spkg_install_ntl=yes
])
fi
])
m4_popdef([SAGE_NTL_VERSION_MAJOR])
m4_popdef([SAGE_NTL_VERSION_MINOR])
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/ppl/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SAGE_SPKG_CONFIGURE([ppl], [
SAGE_SPKG_DEPCHECK([glpk gmp mpir], [
SAGE_SPKG_DEPCHECK([gcc glpk gmp mpir], [
# If our dependencies come from the system, then we can use the
# system ppl, too. This macro works sort-of like the
# PKG_CHECK_MODULES macro, defining e.g. PPL_CFLAGS when a
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/sagelib/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.3.rc5
9.3
5 changes: 4 additions & 1 deletion build/pkgs/zeromq/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
SAGE_SPKG_CONFIGURE([zeromq], [
AX_ZMQ([4.2.5], [], [sage_spkg_install_zeromq=yes])
dnl Trac #31624: Avoid C++ ABI issues
SAGE_SPKG_DEPCHECK([gcc], [
AX_ZMQ([4.2.5], [], [sage_spkg_install_zeromq=yes])
])
])
2 changes: 1 addition & 1 deletion src/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.3.rc5
9.3
6 changes: 3 additions & 3 deletions src/bin/sage-version.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Sage version information for shell scripts
# This file is auto-generated by the sage-update-version script, do not edit!
SAGE_VERSION='9.3.rc5'
SAGE_RELEASE_DATE='2021-04-30'
SAGE_VERSION_BANNER='SageMath version 9.3.rc5, Release Date: 2021-04-30'
SAGE_VERSION='9.3'
SAGE_RELEASE_DATE='2021-05-09'
SAGE_VERSION_BANNER='SageMath version 9.3, Release Date: 2021-05-09'
52 changes: 48 additions & 4 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,10 +1024,10 @@ def plot(self,
sage: fcube = polytopes.hypercube(4)
sage: tfcube = fcube.face_truncation(fcube.faces(0)[0])
sage: sp = tfcube.schlegel_projection()
sage: for face in tfcube.faces(2):
....: vertices = face.ambient_Vrepresentation()
....: indices = [sp.coord_index_of(vector(x)) for x in vertices]
....: projected_vertices = [sp.transformed_coords[i] for i in indices]
sage: for face in tfcube.faces(2):
....: vertices = face.ambient_Vrepresentation()
....: indices = [sp.coord_index_of(vector(x)) for x in vertices]
....: projected_vertices = [sp.transformed_coords[i] for i in indices]
....: assert Polyhedron(projected_vertices).dim() == 2
"""
def merge_options(*opts):
Expand Down Expand Up @@ -6891,6 +6891,50 @@ def facets(self):
return ()
return self.faces(self.dimension()-1)

def _test_combinatorial_face_as_combinatorial_polyhedron(self, tester=None, **options):
"""
Run tests on obtaining the combinatorial face as combinatorial polyhedron.
TESTS::
sage: polytopes.cross_polytope(3)._test_combinatorial_face_as_combinatorial_polyhedron()
"""
if not self.is_compact():
return
if self.dim() > 7 or self.n_vertices() > 100 or self.n_facets() > 100:
# Avoid very long tests.
return
if self.dim() < 1:
# Avoid trivial cases.
return

from sage.misc.prandom import random

if tester is None:
tester = self._tester(**options)

it = self.face_generator()
_ = next(it), next(it) # get rid of non_proper faces
C1 = self.combinatorial_polyhedron()
it1 = C1.face_iter()
C2 = C1.dual()
it2 = C2.face_iter(dual=not it1.dual)

for f in it:
f1 = next(it1)
f2 = next(it2)
if random() < 0.95:
# Only test a random 5 percent of the faces.
continue

P = f.as_polyhedron()
D1 = f1.as_combinatorial_polyhedron()
D2 = f2.as_combinatorial_polyhedron(quotient=True).dual()
D1._test_bitsets(tester, **options)
D2._test_bitsets(tester, **options)
tester.assertTrue(P.combinatorial_polyhedron().vertex_facet_graph().is_isomorphic(D1.vertex_facet_graph()))
tester.assertTrue(P.combinatorial_polyhedron().vertex_facet_graph().is_isomorphic(D2.vertex_facet_graph()))

@cached_method(do_pickle=True)
def f_vector(self):
r"""
Expand Down
18 changes: 18 additions & 0 deletions src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,24 @@ cdef class CombinatorialPolyhedron(Element):
return (CombinatorialPolyhedron, (self.facets(),
self.Vrepresentation(), self.Hrepresentation()))

def _test_bitsets(self, tester=None, **options):
"""
Test if the bitsets are consistent.
TESTS::
sage: P = polytopes.cube()
sage: C = CombinatorialPolyhedron(P)
sage: C._test_bitsets()
"""
if tester is None:
tester = self._tester(**options)

cdef ListOfFaces facets = self.bitrep_facets()
cdef ListOfFaces Vrep = self.bitrep_Vrep()

tester.assertEqual(facets.matrix(), Vrep.matrix().transpose())

def Vrepresentation(self):
r"""
Return a list of names of ``[vertices, rays, lines]``.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ cdef class CombinatorialFace(SageObject):

# some copies from ``CombinatorialPolyhedron``
cdef tuple _ambient_Vrep, _ambient_facets, _equalities
cdef bint _ambient_bounded

# Atoms and coatoms are the vertices/facets of the Polyedron.
# If ``dual == 0``, then coatoms are facets, atoms vertices and vice versa.
Expand Down
Loading

0 comments on commit ab9d41e

Please sign in to comment.