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

Commit 4a24902

Browse files
author
Jonathan Kliem
committed
fixed deprecated affine_hull; improved doc
1 parent 56f54d8 commit 4a24902

File tree

1 file changed

+4
-4
lines changed
  • src/sage/geometry/polyhedron

1 file changed

+4
-4
lines changed

src/sage/geometry/polyhedron/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2755,6 +2755,9 @@ def centroid(self, engine='auto', **kwds):
27552755
The mass is taken with respect to the induced Lebesgue measure,
27562756
see :meth:`volume`.
27572757
2758+
If the polyhedron is not compact, a ``NotImplementedError`` is
2759+
raised.
2760+
27582761
INPUT:
27592762
27602763
- ``engine`` -- either 'auto' (default), 'internal',
@@ -2768,9 +2771,6 @@ def centroid(self, engine='auto', **kwds):
27682771
27692772
OUTPUT: The centroid as vector.
27702773
2771-
If the polyhedron is not compact, a ``NotImplementedError`` is
2772-
raised.
2773-
27742774
ALGORITHM:
27752775
27762776
We triangulate the polytope and find the barycenter of the simplices.
@@ -2823,7 +2823,7 @@ def centroid(self, engine='auto', **kwds):
28232823
pc = triangulation.point_configuration()
28242824
else:
28252825
from sage.geometry.triangulation.point_configuration import PointConfiguration
2826-
A,b = self.affine_hull(as_affine_map=True, orthogonal=True, orthonormal=True, extend=True)
2826+
A,b = self.affine_hull_projection(as_affine_map=True, orthogonal=True, orthonormal=True, extend=True)
28272827
pc = PointConfiguration((A(v.vector()) for v in self.Vrep_generator()))
28282828

28292829
barycenters = [sum(self.Vrepresentation(i).vector() for i in simplex)/(self.dim() + 1) for simplex in triangulation]

0 commit comments

Comments
 (0)