Added some docs
[linpy.git] / pypol / domains.py
index be9dd4b..1c400bd 100644 (file)
@@ -340,6 +340,8 @@ class Domain(GeometricObject):
         Return a list of vertices for this Polygon.
         """
         from .polyhedra import Polyhedron
         Return a list of vertices for this Polygon.
         """
         from .polyhedra import Polyhedron
+        if not self.isbounded():
+            raise ValueError('domain must be bounded')
         islbset = self._toislbasicset(self.equalities, self.inequalities, self.symbols)
         vertices = libisl.isl_basic_set_compute_vertices(islbset);
         vertices = islhelper.isl_vertices_vertices(vertices)
         islbset = self._toislbasicset(self.equalities, self.inequalities, self.symbols)
         vertices = libisl.isl_basic_set_compute_vertices(islbset);
         vertices = islhelper.isl_vertices_vertices(vertices)
@@ -390,7 +392,7 @@ class Domain(GeometricObject):
                 coordinates[symbol] = coordinate
             points.append(Point(coordinates))
         return points
                 coordinates[symbol] = coordinate
             points.append(Point(coordinates))
         return points
-
+    
     @classmethod
     def _polygon_inner_point(cls, points):
         symbols = points[0].symbols
     @classmethod
     def _polygon_inner_point(cls, points):
         symbols = points[0].symbols
@@ -443,6 +445,9 @@ class Domain(GeometricObject):
         return sorted(points, key=angles.get)
 
     def faces(self):
         return sorted(points, key=angles.get)
 
     def faces(self):
+    """
+    Returns the vertices of the faces of a polyhedra.
+    """
         faces = []
         for polyhedron in self.polyhedra:
             vertices = polyhedron.vertices()
         faces = []
         for polyhedron in self.polyhedra:
             vertices = polyhedron.vertices()
@@ -503,6 +508,7 @@ class Domain(GeometricObject):
         axes.set_zlim(zmin, zmax)
         return axes
 
         axes.set_zlim(zmin, zmax)
         return axes
 
+
     def plot(self, plot=None, **kwargs):
         """
         Display plot of this set.
     def plot(self, plot=None, **kwargs):
         """
         Display plot of this set.
@@ -523,6 +529,9 @@ class Domain(GeometricObject):
         return False
 
     def subs(self, symbol, expression=None):
         return False
 
     def subs(self, symbol, expression=None):
+    """
+    Subsitute the given value into an expression and return the resulting expression.
+    """
         polyhedra = [polyhedron.subs(symbol, expression)
             for polyhedron in self.polyhedra]
         return Domain(*polyhedra)
         polyhedra = [polyhedron.subs(symbol, expression)
             for polyhedron in self.polyhedra]
         return Domain(*polyhedra)