示例#1
0
 def __init__(self, surface, polygon_dictionary=None, glue_dictionary=None, base_label=None, ring=None):
     r"""
     
     Warning: No checks are made to make sure the surface is reasonable.
     
     PARAMETERS::
         surface: The surface this is based on.
         polygon_dictionary: A dictionary mapping labels to polygons which will override whatever was on the original surface.
         glue_dictionary: A dictionary mapping edges to edges, which will override whatever was on the original surface. It will automatically be made symmetric.
         base_label: A label representing the base_label on the new surface.
         ring: A new ring containing the vertices.
     """
     self._s=surface
     if polygon_dictionary is None:
         self._pdict={}
     else:
         self._pdict=dict(polygon_dictionary)
     self._gdict={}
     if not glue_dictionary is None:
         for edge1,edge2 in glue_dictionary.iteritems():
             self._gdict[edge1]=edge2
             self._gdict[edge2]=edge1
     if base_label is None:
         self._base_label = surface.base_label()
     else:
         self._base_label = base_label
     if ring is None:
         self._ring = surface.base_ring()
     else:
         self._ring = ring
     self._is_finite = surface.is_finite()
     Surface.__init__(self)
示例#2
0
 def __init__(self, surface, base_label):
     r"""
     Construct a copy of the provided surface with a new base label.
     """
     self._s=surface
     self._base_label = base_label
     Surface.__init__(self)
示例#3
0
    def __init__(self, similarity_surface, direction=None, relabel=True):
        r"""
        Construct a lazy Delaunay triangulation of the provided similarity_surface.
        
        """
        if similarity_surface.underlying_surface().is_mutable():
            raise ValueError("Surface must be immutable.")

        # This surface will converge to the Delaunay Decomposition
        self._s = similarity_surface.copy(relabel=relabel, lazy=True, mutable=True)

        self._setup_direction(direction)

        # Set of labels corresponding to known delaunay polygons
        self._certified_labels=set()
        self._decomposition_certified_labels=set()

        base_label=self._s.base_label()

        # We will now try to get the base_polygon.
        # Certify the base polygon (or apply flips...)
        while not self._certify_or_improve(base_label):
            pass
        self._certify_decomposition(base_label)

        
        
        Surface.__init__(self, self._s.base_ring(), base_label, \
            finite=self._s.is_finite(), mutable=False)
    def __init__(self, surface, m, ring=None):

        if surface.is_mutable():
            if surface.is_finite():
                self._s=surface.copy()
            else:
                raise ValueError("Can not apply matrix to mutable infinite surface.")
        else:
            self._s=surface

        det = m.determinant()

        if det>0:
            self._det_sign=1
        elif det<0:
            self._det_sign=-1
        else:
            raise ValueError("Can not apply matrix with zero determinant to surface.")

        self._m=m

        if ring is None:
            if m.base_ring() == self._s.base_ring():
                base_ring = self._s.base_ring()
            else:
                from sage.structure.element import get_coercion_model
                cm = get_coercion_model()
                base_ring = cm.common_parent(m.base_ring(), self._s.base_ring())
        else:
            base_ring=ring

        self._P=Polygons(base_ring)

        Surface.__init__(self, base_ring, self._s.base_label(), finite=self._s.is_finite())
示例#5
0
    def __init__(self, surface, m, ring=None):

        if surface.is_mutable():
            if surface.is_finite():
                self._s=surface.copy()
            else:
                raise ValueError("Can not apply matrix to mutable infinite surface.")
        else:
            self._s=surface

        det = m.determinant()

        if det>0:
            self._det_sign=1
        elif det<0:
            self._det_sign=-1
        else:
            raise ValueError("Can not apply matrix with zero determinant to surface.")

        self._m=m

        if ring is None:
            if m.base_ring() == self._s.base_ring():
                base_ring = self._s.base_ring()
            else:
                from sage.structure.element import get_coercion_model
                cm = get_coercion_model()
                base_ring = cm.common_parent(m.base_ring(), self._s.base_ring())
        else:
            base_ring=ring

        self._P = ConvexPolygons(base_ring)

        Surface.__init__(self, base_ring, self._s.base_label(), finite=self._s.is_finite())
示例#6
0
 def __init__(self, surface, matrix_function, ring=None):
     self._s=surface
     self._m=matrix_function
     if ring is None:
         self._base_ring = self._s.base_ring()
     else:
         self._base_ring=ring
     self._P=Polygons(self._base_ring)
     Surface.__init__(self)
示例#7
0
 def __init__(self, surface, matrix_function, ring=None):
     self._s = surface
     self._m = matrix_function
     if ring is None:
         self._base_ring = self._s.base_ring()
     else:
         self._base_ring = ring
     self._P = ConvexPolygons(self._base_ring)
     Surface.__init__(self)
示例#8
0
 def __init__(self, s, reindexmapping,new_base_label=None):
     r"""
     Represents a reindexed similarity surface.
     """
     self._s=s
     self._r=reindexmapping
     if new_base_label is None:
         self._base_label=self._r._f[self._s.base_label()]
     else:
         self._base_label=new_base_label
     Surface.__init__(self)
示例#9
0
    def __init__(self, similarity_surface, relabel=True):

        if similarity_surface.is_mutable():
            raise ValueError("Surface must be immutable.")
        
        # This surface will converge to the Delaunay Triangulation
        self._s = similarity_surface.copy(relabel=relabel, lazy=True, \
            mutable=True)

        Surface.__init__(self, self._s.base_ring(), self._s.base_label(), \
            mutable=False, finite=self._s.is_finite())
示例#10
0
 def __init__(self, s, reindexmapping, new_base_label=None):
     r"""
     Represents a reindexed similarity surface.
     """
     if not s.is_finite():
         raise ValueError("Only works for finite surfaces.")
     if s.is_mutable():
         raise ValueError("Only works for immutable surfaces.")
     self._s=s
     self._r=reindexmapping
     if new_base_label is None:
         new_base_label=self._r._f[self._s.base_label()]
     Surface.__init__(self, self._s.base_ring(), new_base_label, finite=True)
    def __init__(self, w=ZZ_1, r=ZZ_2, h1=ZZ_1, h2=ZZ_1):
        from sage.structure.sequence import Sequence
        from sage.combinat.words.words import Words

        self._field = Sequence([w,r,h1,h2]).universe()
        if not self._field.is_field():
            self._field = self._field.fraction_field()
        self._w = self._field(w)
        self._r = self._field(r)
        self._h1 = self._field(h1)
        self._h2 = self._field(h2)
        self._words = Words('LR', finite=True, infinite=False)
        self._wL = self._words('L')
        self._wR = self._words('R')
        Surface.__init__(self)
 def __init__(self, surface, m, ring=None):
     self._s=surface
     if m.determinant()<=0:
         raise ValueError("Currently only works with matrices of positive determinant.""")
     self._m=m
     if ring is None:
         if m.base_ring() == self._s.base_ring():
             self._base_ring = self._s.base_ring()
         else:
             from sage.structure.element import get_coercion_model
             cm = get_coercion_model()
             self._base_ring = cm.common_parent(m.base_ring(), self._s.base_ring())
     else:
         self._base_ring=ring
     self._P=Polygons(self._base_ring)
     Surface.__init__(self)
 def __init__(self,lambda_squared=None, field=None):
     TranslationSurface_generic.__init__(self)
     if lambda_squared==None:
         from sage.rings.number_field.number_field import NumberField
         from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
         R=PolynomialRing(ZZ,'x')
         x = R.gen()
         from sage.rings.qqbar import AA
         self._field=NumberField(x**3-ZZ(5)*x**2+ZZ(4)*x-ZZ(1), 'r', embedding=AA(ZZ(4)))
         self._l=self._field.gen()
     else:
         if field is None:
             self._l=lambda_squared
             self._field=lambda_squared.parent()
         else:
             self._field=field
             self._l=field(lambda_squared)
     Surface.__init__(self)
示例#14
0
 def __init__(self, alpha):
     self._p = ChamanaraPolygon(alpha)
     self._field = alpha.parent()
     self.rename('Chamanara surface with parameter {}'.format(alpha))
     Surface.__init__(self)
 def __init__(self):
     Surface.__init__(self)