CellComplex (Class)

In: structures/CellComplex.rb
Parent: Object
Cell CellTuple CellComplex TopLevel

CellComplex

This class represents a cell complex where the incidence lattice has the diamond property. It implements a switch operator that can be used with cell tuple objects.

Methods

add   delete   down   getFullTuple   getOTuple   getOTupleV   getTuple   import   iterate   member?   new   rotate   show   switch   up  

Public Class methods

initialize

create an empty cell complex. The complex can contain cells of dimension between 0 and dim.

Public Instance methods

add

Add a cell to the complex. lower is an array with the cells of dimension one lower that are incident to the cell. It is required that these lower dimensional cells be in the complex. Also the new cell can not be in the boundary of any other existing cell. This function returns the newly created cell.

delete

delete the given cell from the complex. All other cells that contain it in their boundary are also deleted.

down

retrive the cells lower than the parameter cell which are offset dimensions lower (offset >= 0)

returns a (v, e, f) tuple for v this tuple may not be oriented

returns an oriented tuple containing ed if tri is given the tuple will also contain tri

returns an oriented tuple containing v if tri is given the tuple will also contain tri

getTuple

returns a tuple containing cell. The algorithm to determine the tuple is as follows. Let k be the dimension of c. Let t be the tuple that has c in its k^th entry and such that the i^th entry is the first cell that was given when i+1^th cell was created. If the cell of dimension d in the t is not inverted then t is returned otherwise switch(0,t) is returned.

import

this function adds the elements of otherComplex to this one nothing is cloned, so it is assumed that otherComplex will be discarded

iterate

calls the user supplied block on every cell of dimension dim

member?

return true iff the given cell is in the complex

rotate

get a circular ordering of the k-1 and k cells between the (k-2) and (k+1) cells of the given tuple in the incidence lattice. More precisely it returns a sequnence c_0, …, c_m of cells such that if i is even then c_i is of dimension k - 1 and if i is odd then c_i is of dimension k. In addition c_i and c_i+1 are adjacent. If the (k-2) cell is in the interior of the complex then c_m and c_i are adajacent. Otherwise c_m is on the boundary.

show

debug function that prints the data associated with every cell and its incident cells

switch

return the switch_k of the tuple if it is define and nil otherwise

up

retrive the cells higher than the parameter cell which are offset dimensions higher (offset >= 0)

[Validate]