Add GPL License
[linpy.git] / pypol / domains.py
index 1c400bd..b529163 100644 (file)
@@ -1,3 +1,20 @@
+"""
+    This file is part of Linpy.
+
+    Linpy is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    Linpy is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Linpy.  If not, see <http://www.gnu.org/licenses/>.
+"""
+
 import ast
 import functools
 import re
 import ast
 import functools
 import re
@@ -304,20 +321,13 @@ class Domain(GeometricObject):
         islset = libisl.isl_set_lexmax(islset)
         return self._fromislset(islset, self.symbols)
 
         islset = libisl.isl_set_lexmax(islset)
         return self._fromislset(islset, self.symbols)
 
-    def num_parameters(self):
-        """
-        Return the total number of parameters, input, output or set dimensions.
-        """
-        islbset = self._toislbasicset(self.equalities, self.inequalities, self.symbols)
-        num = libisl.isl_basic_set_dim(islbset, libisl.isl_dim_set)
-        return num
 
 
-    def involves_dims(self, dims):
+    def involves_vars(self, vars):
         """
         """
-        Returns true if set depends on given dimensions.
+        Returns true if set depends on given dimensions.
         """
         islset = self._toislset(self.polyhedra, self.symbols)
         """
         islset = self._toislset(self.polyhedra, self.symbols)
-        dims = sorted(dims)
+        dims = sorted(vars)
         symbols = sorted(list(self.symbols))
         n = 0
         if len(dims)>0:
         symbols = sorted(list(self.symbols))
         n = 0
         if len(dims)>0:
@@ -392,7 +402,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
@@ -445,9 +455,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.
-    """
+        """
+        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()
@@ -529,9 +539,10 @@ 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.
-    """
+        """
+        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)
@@ -702,3 +713,5 @@ def Not(domain):
     Returns the complement of this set.
     """
     return ~domain
     Returns the complement of this set.
     """
     return ~domain
+    
+# Copyright 2014 MINES ParisTech