Package sage :: Package geometry :: Module lattice_polytope :: Class _PolytopeFace
[hide private]
[frames] | no frames]

Class _PolytopeFace

source code

                      object --+    
                               |    
structure.sage_object.SageObject --+
                                   |
                                  _PolytopeFace


_PolytopeFace(polytope, vertices, facets)

Construct a polytope face.

POLYTOPE FACES SHOULD NOT BE CONSTRUCTED OUTSIDE OF LATTICE POLYTOPES!

INPUT:
    polytope -- a polytope whose face is being constructed.
    vertices -- a sequence of indices of generating vertices.
    facets -- a sequence of indices of facets containing this face.



Instance Methods [hide private]
 
__init__(polytope, vertices, facets)
Construct a face.
source code
 
__reduce__(self)
Reduction function.
source code
 
_repr_(self)
Return a string representation of this face.
source code
 
boundary_points(self)
Return a sequence of indices of boundary lattice points of this face.
source code
 
facets(self)
Return a sequence of indices of facets containing this face.
source code
 
interior_points(self)
Return a sequence of indices of interior lattice points of this face.
source code
 
nboundary_points(self)
Return the number of boundary lattice points of this face.
source code
 
nfacets(self)
Return the number of facets containing this face.
source code
 
ninterior_points(self)
Return the number of interior lattice points of this face.
source code
 
npoints(self)
Return the number of lattice points of this face.
source code
 
nvertices(self)
Return the number of vertices generating this face.
source code
 
ordered_points(self)
Return the list of indices of lattice points on the edge in their geometric order, from one vertex to other.
source code
 
points(self)
Return a sequence of indices of lattice points of this face.
source code
 
traverse_boundary(self)
Return a list of indices of vertices of a 2-face in their boundary order.
source code
 
vertices(self)
Return a sequence of indices of vertices generating this face.
source code

Inherited from structure.sage_object.SageObject: __hash__, __new__, __repr__, _axiom_, _axiom_init_, _gap_, _gap_init_, _gp_, _gp_init_, _interface_, _interface_init_, _interface_is_cached_, _kash_, _kash_init_, _macaulay2_, _macaulay2_init_, _magma_, _magma_init_, _maple_, _maple_init_, _mathematica_, _mathematica_init_, _maxima_, _maxima_init_, _octave_, _octave_init_, _pari_, _pari_init_, _r_init_, _sage_, _singular_, _singular_init_, category, db, dump, dumps, plot, rename, reset_name, save, version

Inherited from object: __delattr__, __getattribute__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(polytope, vertices, facets)
(Constructor)

source code 

Construct a face.

TESTS:
    sage: o = lattice_polytope.octahedron(2)
    sage: o.faces()
    [
    [[3], [0], [2], [1]],
    [[0, 3], [2, 3], [0, 1], [1, 2]]
    ]

Overrides: object.__init__

__reduce__(self)

source code 

Reduction function. Does not store data that can be relatively fast
recomputed.

TESTS:
    sage: o = lattice_polytope.octahedron(2)
    sage: f = o.facets()[0]
    sage: fl = loads(f.dumps())
    sage: f.vertices() == fl.vertices()
    True
    sage: f.facets() == fl.facets()
    True

Overrides: object.__reduce__

_repr_(self)

source code 

Return a string representation of this face.

TESTS:
    sage: o = lattice_polytope.octahedron(3)
    sage: f = o.facets()[0]
    sage: f._repr_()
    '[0, 1, 5]'

boundary_points(self)

source code 

Return a sequence of indices of boundary lattice points of this face.

EXAMPLES:
Boundary lattice points of one of the facets of the 3-dimensional cube:
    sage: o = lattice_polytope.octahedron(3)
    sage: cube = o.polar()
    sage: face = cube.facets()[0]
    sage: face.boundary_points()
    [0, 1, 2, 3, 11, 15, 21, 25]

facets(self)

source code 

Return a sequence of indices of facets containing this face.

EXAMPLES:
Facets containing one of the edges of the 3-dimensional octahedron:
    sage: o = lattice_polytope.octahedron(3)
    sage: edge = o.faces(dim=1)[0]
    sage: edge.facets()
    [0, 1]

Thus \code{edge} is the intersection of facets 0 and 1:
    sage: edge
    [1, 5]
    sage: o.facets()[0]
    [0, 1, 5]
    sage: o.facets()[1]
    [1, 3, 5]

interior_points(self)

source code 

Return a sequence of indices of interior lattice points of this face.

EXAMPLES:
Interior lattice points of one of the facets of the 3-dimensional cube:
    sage: o = lattice_polytope.octahedron(3)
    sage: cube = o.polar()
    sage: face = cube.facets()[0]
    sage: face.interior_points()
    [18]

nboundary_points(self)

source code 

Return the number of boundary lattice points of this face.

EXAMPLES:
The number of boundary lattice points of one of the facets of
the 3-dimensional cube:
    sage: o = lattice_polytope.octahedron(3)
    sage: cube = o.polar()
    sage: face = cube.facets()[0]
    sage: face.nboundary_points()
    8

nfacets(self)

source code 

Return the number of facets containing this face.

EXAMPLES:
The number of facets containing one of the edges of
the 3-dimensional octahedron:
    sage: o = lattice_polytope.octahedron(3)
    sage: edge = o.faces(dim=1)[0]
    sage: edge.nfacets()
    2

ninterior_points(self)

source code 

Return the number of interior lattice points of this face.

EXAMPLES:
The number of interior lattice points of one of the facets of
the 3-dimensional cube:
    sage: o = lattice_polytope.octahedron(3)
    sage: cube = o.polar()
    sage: face = cube.facets()[0]
    sage: face.ninterior_points()
    1

npoints(self)

source code 

Return the number of lattice points of this face.

EXAMPLES:
The number of lattice points of one of the facets of
the 3-dimensional cube:
    sage: o = lattice_polytope.octahedron(3)
    sage: cube = o.polar()
    sage: face = cube.facets()[0]
    sage: face.npoints()
    9

nvertices(self)

source code 

Return the number of vertices generating this face.

EXAMPLES:
The number of vertices generating one of the facets of
the 3-dimensional cube:
    sage: o = lattice_polytope.octahedron(3)
    sage: cube = o.polar()
    sage: face = cube.facets()[0]
    sage: face.nvertices()
    4

ordered_points(self)

source code 

Return the list of indices of lattice points on the edge in their
geometric order, from one vertex to other.

Works only for edges, i.e. faces generated by exactly two vertices.

EXAMPLE:
We find all points along an edge of the cube:
    sage: o = lattice_polytope.octahedron(3)
    sage: c = o.polar()
    sage: e = c.edges()[0]
    sage: e.vertices()
    [0, 1]
    sage: e.ordered_points()
    [0, 15, 1]

points(self)

source code 

Return a sequence of indices of lattice points of this face.

EXAMPLES:
The lattice points of one of the facets of the 3-dimensional cube:
    sage: o = lattice_polytope.octahedron(3)
    sage: cube = o.polar()
    sage: face = cube.facets()[0]
    sage: face.points()
    [0, 1, 2, 3, 11, 15, 18, 21, 25]

traverse_boundary(self)

source code 

Return a list of indices of vertices of a 2-face in their boundary order.

Needed for plot3d function of polytopes.

EXAMPLES:
    sage: c = lattice_polytope.octahedron(3).polar()
    sage: f = c.facets()[0]
    sage: f.vertices()
    [0, 1, 2, 3]
    sage: f.traverse_boundary()
    [0, 2, 3, 1]

vertices(self)

source code 

Return a sequence of indices of vertices generating this face.

EXAMPLES:
The vertices generating one of the facets of the 3-dimensional cube:
    sage: o = lattice_polytope.octahedron(3)
    sage: cube = o.polar()
    sage: face = cube.facets()[0]
    sage: face.vertices()
    [0, 1, 2, 3]