Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes

chomp::homology::tCell2l< tCell > Class Template Reference

A general cubical cell with additional information about the layer number. More...

#include <twolayer.h>

List of all members.

Public Types

enum  OutputBitValues { BitProduct = 0x01, BitSpace = 0x02 }
 

How to output the cell: As a cartesian product or by two opposite vertices? Also, should ' ' be inserted?

More...
typedef theLayerType LayerType
 The type for keeping the layer number.
typedef tCell CellType
 The type for keeping the cell at the given layer.
typedef tCell::CoordType CoordType
 The type of the coordinates.
typedef tCell::PointBase PointBase
 The point base (for wrapping and tabulating coordinates).

Public Member Functions

 tCell2l ()
 The default constructor.
 tCell2l (const tCell &_q, const LayerType &_l)
 The constructor of a cell at a given layer.
 tCell2l (const CoordType *c1, const CoordType *c2, int spcdim, int celldim=-1, int layer=0)
 The constructor of a cell spanning from one point to another.
template<class tCube >
 tCell2l (const tCube2l< tCube > &q1, const tCube2l< tCube > &q2)
 The constructor of a cell as an intersection of two cubes.
template<class tCube >
 tCell2l (const tCube2l< tCube > &c, int facedim)
 The constructor of an arbitrary k-dimensional face of a full cube.
template<class tCube >
 tCell2l (const tCube2l< tCube > &c)
 The constructor of a full-dimensional cubical cell.
template<class tCellSrc >
 tCell2l (const tCell2l< tCellSrc > &q, int offset, int ncoords)
 The constructor of a projection of a cell to the given number of coordinates that start at the given offset.
 tCell2l (const tCell2l &c)
 The copy constructor.
tCell2loperator= (const tCell2l &c)
 The assignment operator.
int dim () const
 Returns the dimension of the cubical cell.
int spacedim () const
 Returns the dimension of the embedding space.
template<class intType >
intType * leftcoord (intType *c) const
 Fills the given table with the left corner coordinates.
template<class intType >
intType * rightcoord (intType *c) const
 Fills the given table with the right corner coordinates.
int_t hashkey1 () const
 Returns the hash key no. 1 required by the hashing set template.
int_t hashkey2 () const
 Returns the hash key no. 2 required by the hashing set template.
const LayerTypelayer () const
 Returns the layer number.
const tCell & cell () const
 Returns the cell without the layer.
void layer (const typename tCell2l< tCell >::LayerType &newlayer)
 Sets the layer number.
template<class tCell >
 tCell2l (const typename tCell2l< tCell >::CoordType *c1, const typename tCell2l< tCell >::CoordType *c2, int spcdim, int celldim, int layer)

Static Public Member Functions

static const char * name ()
 Returns the name of the objects represented by this class.
static const char * pluralname ()
 Returns the plural name of the objects represented by this class.
static void identify (const hashedset< tCell > &s, int dim)
 Sets the given set of cells for the identification of layers.
static const hashedset< tCell > & identify ()
 Returns the set of cells for the identification of layers.
static LayerType droplayer (const tCell &q, const LayerType &layer)
 Drops the layer of the cell if necessary by the identification.

Static Public Attributes

static const int MaxDim = tCell::MaxDim
 The maximal dimension of a cube.
static int OutputBits = 0

Private Attributes

tCell q
 The actual cubical cell at the given layer.
LayerType l
 The layer to which the cell belongs.

Static Private Attributes

static hashedset< tCell > idset
 The set of cells at which the identification takes place.
static int iddim
 The space dimension of cells for which the identification takes place.

Detailed Description

template<class tCell>
class chomp::homology::tCell2l< tCell >

A general cubical cell with additional information about the layer number.

By default, the layer number is zero, unless set otherwise.

Definition at line 471 of file twolayer.h.


Member Typedef Documentation

template<class tCell>
typedef tCell chomp::homology::tCell2l< tCell >::CellType

The type for keeping the cell at the given layer.

Definition at line 478 of file twolayer.h.

template<class tCell>
typedef tCell::CoordType chomp::homology::tCell2l< tCell >::CoordType

The type of the coordinates.

Definition at line 481 of file twolayer.h.

template<class tCell>
typedef theLayerType chomp::homology::tCell2l< tCell >::LayerType

The type for keeping the layer number.

Definition at line 475 of file twolayer.h.

template<class tCell>
typedef tCell::PointBase chomp::homology::tCell2l< tCell >::PointBase

The point base (for wrapping and tabulating coordinates).

Definition at line 487 of file twolayer.h.


Member Enumeration Documentation

template<class tCell>
enum chomp::homology::tCell2l::OutputBitValues

How to output the cell: As a cartesian product or by two opposite vertices? Also, should ' ' be inserted?

Enumerator:
BitProduct 
BitSpace 

Definition at line 552 of file twolayer.h.

        {
                BitProduct = 0x01,      // unset => two vertices
                BitSpace = 0x02
        };


Constructor & Destructor Documentation

template<class tCell >
chomp::homology::tCell2l< tCell >::tCell2l (  )  [inline]

The default constructor.

Definition at line 608 of file twolayer.h.

                               : q (), l (0)
{
        return;
} /* tCell2l */

template<class tCell >
chomp::homology::tCell2l< tCell >::tCell2l ( const tCell &  _q,
const LayerType _l 
) [inline]

The constructor of a cell at a given layer.

Definition at line 614 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::idset, chomp::homology::tCell2l< tCell >::l, and chomp::homology::tCell2l< tCell >::q.

: q (_q), l (_l)
{
        if ((l == 1) && idset. check (q))
                l = 0;
        return;
} /* tCell2l */

template<class tCell>
chomp::homology::tCell2l< tCell >::tCell2l ( const CoordType c1,
const CoordType c2,
int  spcdim,
int  celldim = -1,
int  layer = 0 
)

The constructor of a cell spanning from one point to another.

template<class tCell >
template<class tCube >
chomp::homology::tCell2l< tCell >::tCell2l ( const tCube2l< tCube > &  q1,
const tCube2l< tCube > &  q2 
) [inline]

The constructor of a cell as an intersection of two cubes.

Definition at line 635 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::idset, chomp::homology::tCell2l< tCell >::l, and chomp::homology::tCell2l< tCell >::q.

: q (q1. cube (), q2. cube ()), l ((q1. layer () < q2. layer ()) ?
        q1. layer () : q2. layer ())
{
        if ((l == 1) && idset. check (q))
                l = 0;
        return;
} /* tCell2l */

template<class tCell >
template<class tCube >
chomp::homology::tCell2l< tCell >::tCell2l ( const tCube2l< tCube > &  c,
int  facedim 
) [inline]

The constructor of an arbitrary k-dimensional face of a full cube.

Definition at line 647 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::droplayer(), chomp::homology::tCell2l< tCell >::l, and chomp::homology::tCell2l< tCell >::q.

: q (c. cube (), facedim), l (c. layer ())
{
        l = tCell2l<tCell>::droplayer (q, l);
        return;
} /* tCell2l */

template<class tCell >
template<class tCube >
chomp::homology::tCell2l< tCell >::tCell2l ( const tCube2l< tCube > &  c  )  [inline, explicit]

The constructor of a full-dimensional cubical cell.

Definition at line 656 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::idset, chomp::homology::tCell2l< tCell >::l, and chomp::homology::tCell2l< tCell >::q.

: q (c. cube ()), l (c. layer ())
{
        if ((l == 1) && idset. check (q))
                l = 0;
        return;
} /* tCell2l */

template<class tCell >
template<class tCellSrc >
chomp::homology::tCell2l< tCell >::tCell2l ( const tCell2l< tCellSrc > &  q,
int  offset,
int  ncoords 
) [inline]

The constructor of a projection of a cell to the given number of coordinates that start at the given offset.

Definition at line 666 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::idset, chomp::homology::tCell2l< tCell >::l, and chomp::homology::tCell2l< tCell >::q.

: q (c. cell (), offset, ncoords), l (c. layer ())
{
        if (offset > 0)
                l &= 0x03;
        else
        {
                l >>= 2;
                l &= 0x03;
        }
        if ((l == 1) && idset. check (q))
                l = 0;
        return;
} /* tCell2l */

template<class tCell >
chomp::homology::tCell2l< tCell >::tCell2l ( const tCell2l< tCell > &  c  )  [inline]

The copy constructor.

Definition at line 683 of file twolayer.h.

                                               : q (c. q), l (c. l)
{
        return;
} /* tCell2l */

template<class tCell>
template<class tCell >
chomp::homology::tCell2l< tCell >::tCell2l ( const typename tCell2l< tCell >::CoordType c1,
const typename tCell2l< tCell >::CoordType c2,
int  spcdim,
int  celldim,
int  layer 
) [inline]

Definition at line 623 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::idset, chomp::homology::tCell2l< tCell >::l, and chomp::homology::tCell2l< tCell >::q.

: q (c1, c2, spcdim, celldim), l (layer)
{
        if ((l == 1) && idset. check (q))
                l = 0;
        return;
} /* tCell2l */


Member Function Documentation

template<class tCell >
const tCell & chomp::homology::tCell2l< tCell >::cell (  )  const [inline]

Returns the cell without the layer.

Definition at line 754 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::q.

{
        return q;
} /* cell */

template<class tCell >
int chomp::homology::tCell2l< tCell >::dim (  )  const [inline]

Returns the dimension of the cubical cell.

Definition at line 697 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::q.

{
        return q. dim ();
} /* dim */

template<class tCell >
tCell2l< tCell >::LayerType chomp::homology::tCell2l< tCell >::droplayer ( const tCell &  q,
const LayerType layer 
) [inline, static]

Drops the layer of the cell if necessary by the identification.

Definition at line 783 of file twolayer.h.

Referenced by chomp::homology::tCell2l< tCell >::tCell2l().

{
        if (!layer)
                return layer;
        int dim = q. spacedim ();
        if (dim <= iddim)
        {
                if (idset. check (q))
                        return 0;
                else
                        return layer;
        }
        if (dim != iddim + iddim)
                throw "Unknown cells for layer analysis.";
        typename tCell2l<tCell>::LayerType layer1 (layer >> 2);
        typename tCell2l<tCell>::LayerType layer2 (layer & 0x03);
        if ((layer1) && idset. check (tCell (q, 0, iddim)))
                layer1 = 0;
        if ((layer2) && idset. check (tCell (q, iddim, iddim)))
                layer2 = 0;
        return (layer1 << 2) | layer2;
} /* droplayer */

template<class tCell >
int_t chomp::homology::tCell2l< tCell >::hashkey1 (  )  const [inline]

Returns the hash key no. 1 required by the hashing set template.

Definition at line 723 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::q.

{
        return q. hashkey1 ();
} /* hashkey1 */

template<class tCell >
int_t chomp::homology::tCell2l< tCell >::hashkey2 (  )  const [inline]

Returns the hash key no. 2 required by the hashing set template.

Definition at line 729 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::l, and chomp::homology::tCell2l< tCell >::q.

{
        return q. hashkey2 () ^ l;
} /* hashkey2 */

template<class tCell >
void chomp::homology::tCell2l< tCell >::identify ( const hashedset< tCell > &  s,
int  dim 
) [inline, static]

Sets the given set of cells for the identification of layers.

Definition at line 768 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::iddim, and chomp::homology::tCell2l< tCell >::idset.

{
        idset = s;
        iddim = dim;
        return;
} /* identify */

template<class tCell >
const hashedset< tCell > & chomp::homology::tCell2l< tCell >::identify (  )  [inline, static]

Returns the set of cells for the identification of layers.

Definition at line 776 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::idset.

Referenced by chomp::homology::createimages(), chomp::homology::intersection2l(), and chomp::homology::tCube2l< tCube >::setlayers().

{
        return idset;
} /* identify */

template<class tCell >
const tCell2l< tCell >::LayerType & chomp::homology::tCell2l< tCell >::layer (  )  const [inline]

Returns the layer number.

Definition at line 747 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::l.

{
        return l;
} /* layer */

template<class tCell >
void chomp::homology::tCell2l< tCell >::layer ( const typename tCell2l< tCell >::LayerType newlayer  )  [inline]

Sets the layer number.

Definition at line 761 of file twolayer.h.

{
        l = newlayer;
        return;
} /* layer */

template<class tCell >
template<class intType >
intType * chomp::homology::tCell2l< tCell >::leftcoord ( intType *  c  )  const [inline]

Fills the given table with the left corner coordinates.

Definition at line 710 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::q.

{
        return q. leftcoord (c);
} /* leftcoord */

template<class tCell >
const char * chomp::homology::tCell2l< tCell >::name (  )  [inline, static]

Returns the name of the objects represented by this class.

Definition at line 735 of file twolayer.h.

{
        return tCell::name ();
} /* name */

template<class tCell >
tCell2l< tCell > & chomp::homology::tCell2l< tCell >::operator= ( const tCell2l< tCell > &  c  )  [inline]

The assignment operator.

Definition at line 689 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::l, and chomp::homology::tCell2l< tCell >::q.

{
        q = c. q;
        l = c. l;
        return *this;
} /* tCell2l */

template<class tCell >
const char * chomp::homology::tCell2l< tCell >::pluralname (  )  [inline, static]

Returns the plural name of the objects represented by this class.

Definition at line 741 of file twolayer.h.

{
        return tCell::pluralname ();
} /* pluralname */

template<class tCell >
template<class intType >
intType * chomp::homology::tCell2l< tCell >::rightcoord ( intType *  c  )  const [inline]

Fills the given table with the right corner coordinates.

Definition at line 717 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::q.

{
        return q. rightcoord (c);
} /* rightcoord */

template<class tCell >
int chomp::homology::tCell2l< tCell >::spacedim (  )  const [inline]

Returns the dimension of the embedding space.

Definition at line 703 of file twolayer.h.

References chomp::homology::tCell2l< tCell >::q.

{
        return q. spacedim ();
} /* spacedim */


Member Data Documentation

template<class tCell>
int chomp::homology::tCell2l< tCell >::iddim [static, private]

The space dimension of cells for which the identification takes place.

For twice this dimension, the cells are identified by considering both projections.

Definition at line 584 of file twolayer.h.

Referenced by chomp::homology::tCell2l< tCell >::identify().

template<class tCell>
hashedset< tCell > chomp::homology::tCell2l< tCell >::idset [static, private]

The set of cells at which the identification takes place.

Definition at line 579 of file twolayer.h.

Referenced by chomp::homology::tCell2l< tCell >::identify(), and chomp::homology::tCell2l< tCell >::tCell2l().

template<class tCell>
LayerType chomp::homology::tCell2l< tCell >::l [private]
template<class tCell>
const int chomp::homology::tCell2l< tCell >::MaxDim = tCell::MaxDim [static]

The maximal dimension of a cube.

Definition at line 484 of file twolayer.h.

template<class tCell>
int chomp::homology::tCell2l< tCell >::OutputBits = 0 [static]

Definition at line 557 of file twolayer.h.

template<class tCell>
tCell chomp::homology::tCell2l< tCell >::q [private]

The documentation for this class was generated from the following file: