The Original CHomP Software
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes | List of all members
chomp::homology::tCell2l< tCell > Class Template Reference

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

#include <twolayer.h>

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. More...
 
typedef tCell CellType
 The type for keeping the cell at the given layer. More...
 
typedef tCell::CoordType CoordType
 The type of the coordinates. More...
 
typedef tCell::PointBase PointBase
 The point base (for wrapping and tabulating coordinates). More...
 

Public Member Functions

 tCell2l ()
 The default constructor. More...
 
 tCell2l (const tCell &_q, const LayerType &_l)
 The constructor of a cell at a given layer. More...
 
 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. More...
 
template<class tCube >
 tCell2l (const tCube2l< tCube > &q1, const tCube2l< tCube > &q2)
 The constructor of a cell as an intersection of two cubes. More...
 
template<class tCube >
 tCell2l (const tCube2l< tCube > &c, int facedim)
 The constructor of an arbitrary k-dimensional face of a full cube. More...
 
template<class tCube >
 tCell2l (const tCube2l< tCube > &c)
 The constructor of a full-dimensional cubical cell. More...
 
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. More...
 
 tCell2l (const tCell2l &c)
 The copy constructor. More...
 
tCell2loperator= (const tCell2l &c)
 The assignment operator. More...
 
int dim () const
 Returns the dimension of the cubical cell. More...
 
int spacedim () const
 Returns the dimension of the embedding space. More...
 
template<class intType >
intType * leftcoord (intType *c) const
 Fills the given table with the left corner coordinates. More...
 
template<class intType >
intType * rightcoord (intType *c) const
 Fills the given table with the right corner coordinates. More...
 
int_t hashkey1 () const
 Returns the hash key no. 1 required by the hashing set template. More...
 
int_t hashkey2 () const
 Returns the hash key no. 2 required by the hashing set template. More...
 
const LayerTypelayer () const
 Returns the layer number. More...
 
const tCell & cell () const
 Returns the cell without the layer. More...
 
void layer (const typename tCell2l< tCell >::LayerType &newlayer)
 Sets the layer number. More...
 
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. More...
 
static const char * pluralname ()
 Returns the plural name of the objects represented by this class. More...
 
static void identify (const hashedset< tCell > &s, int dim)
 Sets the given set of cells for the identification of layers. More...
 
static const hashedset< tCell > & identify ()
 Returns the set of cells for the identification of layers. More...
 
static LayerType droplayer (const tCell &q, const LayerType &layer)
 Drops the layer of the cell if necessary by the identification. More...
 

Static Public Attributes

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

Private Attributes

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

Static Private Attributes

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

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 482 of file twolayer.h.

Member Typedef Documentation

◆ CellType

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

The type for keeping the cell at the given layer.

Definition at line 489 of file twolayer.h.

◆ CoordType

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

The type of the coordinates.

Definition at line 492 of file twolayer.h.

◆ LayerType

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

The type for keeping the layer number.

Definition at line 486 of file twolayer.h.

◆ PointBase

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

The point base (for wrapping and tabulating coordinates).

Definition at line 498 of file twolayer.h.

Member Enumeration Documentation

◆ OutputBitValues

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 563 of file twolayer.h.

564 {
565 BitProduct = 0x01, // unset => two vertices
566 BitSpace = 0x02
567 };

Constructor & Destructor Documentation

◆ tCell2l() [1/9]

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

The default constructor.

Definition at line 619 of file twolayer.h.

619 : q (), l (0)
620{
621 return;
622} /* tCell2l */
LayerType l
The layer to which the cell belongs.
Definition: twolayer.h:601
tCell q
The actual cubical cell at the given layer.
Definition: twolayer.h:598

◆ tCell2l() [2/9]

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 625 of file twolayer.h.

626: q (_q), l (_l)
627{
628 if ((l == 1) && idset. check (q))
629 l = 0;
630 return;
631} /* tCell2l */
static hashedset< tCell > idset
The set of cells at which the identification takes place.
Definition: twolayer.h:590

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

◆ tCell2l() [3/9]

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.

◆ tCell2l() [4/9]

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 646 of file twolayer.h.

648: q (q1. cube (), q2. cube ()), l ((q1. layer () < q2. layer ()) ?
649 q1. layer () : q2. layer ())
650{
651 if ((l == 1) && idset. check (q))
652 l = 0;
653 return;
654} /* tCell2l */
const LayerType & layer() const
Returns the layer number.
Definition: twolayer.h:770
Cube cube
A lower-case name of a cube [deprecated].
Definition: cube.h:77

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

◆ tCell2l() [5/9]

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 658 of file twolayer.h.

659: q (c. cube (), facedim), l (c. layer ())
660{
662 return;
663} /* tCell2l */
static LayerType droplayer(const tCell &q, const LayerType &layer)
Drops the layer of the cell if necessary by the identification.
Definition: twolayer.h:806

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

◆ tCell2l() [6/9]

template<class tCell >
template<class tCube >
chomp::homology::tCell2l< tCell >::tCell2l ( const tCube2l< tCube > &  c)
inlineexplicit

The constructor of a full-dimensional cubical cell.

Definition at line 667 of file twolayer.h.

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

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

◆ tCell2l() [7/9]

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 677 of file twolayer.h.

679: q (c. cell (), offset, ncoords), l (c. layer ())
680{
681 if (offset > 0)
682 l &= 0x03;
683 else
684 {
685 l >>= 2;
686 l &= 0x03;
687 }
688 if ((l == 1) && idset. check (q))
689 l = 0;
690 return;
691} /* tCell2l */
const tCell & cell() const
Returns the cell without the layer.
Definition: twolayer.h:777

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

◆ tCell2l() [8/9]

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

The copy constructor.

Definition at line 694 of file twolayer.h.

694 : q (c. q), l (c. l)
695{
696 return;
697} /* tCell2l */

◆ tCell2l() [9/9]

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 634 of file twolayer.h.

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

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

Member Function Documentation

◆ cell()

template<class tCell >
const tCell & chomp::homology::tCell2l< tCell >::cell
inline

Returns the cell without the layer.

Definition at line 777 of file twolayer.h.

778{
779 return q;
780} /* cell */

◆ dim()

template<class tCell >
int chomp::homology::tCell2l< tCell >::dim
inline

Returns the dimension of the cubical cell.

Definition at line 708 of file twolayer.h.

709{
710 return q. dim ();
711} /* dim */
int dim() const
Returns the dimension of the cubical cell.
Definition: twolayer.h:708

◆ droplayer()

template<class tCell >
tCell2l< tCell >::LayerType chomp::homology::tCell2l< tCell >::droplayer ( const tCell &  q,
const LayerType layer 
)
inlinestatic

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

Definition at line 805 of file twolayer.h.

807{
808 if (!layer)
809 return layer;
810 int dim = q. spacedim ();
811 if (dim <= iddim)
812 {
813 if (idset. check (q))
814 return 0;
815 else
816 return layer;
817 }
818 if (dim != iddim + iddim)
819 throw "Unknown cells for layer analysis.";
820 typename tCell2l<tCell>::LayerType layer1 (layer >> 2);
821 typename tCell2l<tCell>::LayerType layer2 (layer & 0x03);
822 if ((layer1) && idset. check (tCell (q, 0, iddim)))
823 layer1 = 0;
824 if ((layer2) && idset. check (tCell (q, iddim, iddim)))
825 layer2 = 0;
826 return (layer1 << 2) | layer2;
827} /* droplayer */
static int iddim
The space dimension of cells for which the identification takes place.
Definition: twolayer.h:595
int spacedim() const
Returns the dimension of the embedding space.
Definition: twolayer.h:714
theLayerType LayerType
The type for keeping the layer number.
Definition: twolayer.h:486

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

◆ hashkey1()

template<class tCell >
int_t chomp::homology::tCell2l< tCell >::hashkey1
inline

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

Definition at line 734 of file twolayer.h.

735{
736 return q. hashkey1 ();
737} /* hashkey1 */
int_t hashkey1() const
Returns the hash key no. 1 required by the hashing set template.
Definition: twolayer.h:734

References chomp::homology::hashkey1().

◆ hashkey2()

template<class tCell >
int_t chomp::homology::tCell2l< tCell >::hashkey2
inline

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

Definition at line 746 of file twolayer.h.

747{
748 return q. hashkey2 () ^ l;
749} /* hashkey2 */
int_t hashkey2() const
Returns the hash key no. 2 required by the hashing set template.
Definition: twolayer.h:746

References chomp::homology::hashkey2().

◆ identify() [1/2]

template<class tCell >
const hashedset< tCell > & chomp::homology::tCell2l< tCell >::identify
inlinestatic

Returns the set of cells for the identification of layers.

Definition at line 799 of file twolayer.h.

800{
801 return idset;
802} /* identify */

Referenced by chomp::homology::createimages(), and chomp::homology::intersection2l().

◆ identify() [2/2]

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

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

Definition at line 791 of file twolayer.h.

792{
793 idset = s;
794 iddim = dim;
795 return;
796} /* identify */

◆ layer() [1/2]

template<class tCell >
const tCell2l< tCell >::LayerType & chomp::homology::tCell2l< tCell >::layer
inline

Returns the layer number.

Definition at line 770 of file twolayer.h.

772{
773 return l;
774} /* layer */

◆ layer() [2/2]

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

Sets the layer number.

Definition at line 783 of file twolayer.h.

785{
786 l = newlayer;
787 return;
788} /* layer */

◆ leftcoord()

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 721 of file twolayer.h.

722{
723 return q. leftcoord (c);
724} /* leftcoord */
intType * leftcoord(intType *c) const
Fills the given table with the left corner coordinates.
Definition: twolayer.h:721

◆ name()

template<class tCell >
const char * chomp::homology::tCell2l< tCell >::name
inlinestatic

Returns the name of the objects represented by this class.

Definition at line 758 of file twolayer.h.

759{
760 return tCell::name ();
761} /* name */

◆ operator=()

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

The assignment operator.

Definition at line 700 of file twolayer.h.

701{
702 q = c. q;
703 l = c. l;
704 return *this;
705} /* tCell2l */

◆ pluralname()

template<class tCell >
const char * chomp::homology::tCell2l< tCell >::pluralname
inlinestatic

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

Definition at line 764 of file twolayer.h.

765{
766 return tCell::pluralname ();
767} /* pluralname */

◆ rightcoord()

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 728 of file twolayer.h.

729{
730 return q. rightcoord (c);
731} /* rightcoord */
intType * rightcoord(intType *c) const
Fills the given table with the right corner coordinates.
Definition: twolayer.h:728

◆ spacedim()

template<class tCell >
int chomp::homology::tCell2l< tCell >::spacedim
inline

Returns the dimension of the embedding space.

Definition at line 714 of file twolayer.h.

715{
716 return q. spacedim ();
717} /* spacedim */

Member Data Documentation

◆ iddim

template<class tCell >
int chomp::homology::tCell2l< tCell >::iddim
staticprivate

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 595 of file twolayer.h.

◆ idset

template<class tCell >
hashedset< tCell > chomp::homology::tCell2l< tCell >::idset
staticprivate

The set of cells at which the identification takes place.

Definition at line 590 of file twolayer.h.

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

◆ l

template<class tCell >
LayerType chomp::homology::tCell2l< tCell >::l
private

The layer to which the cell belongs.

Definition at line 601 of file twolayer.h.

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

◆ MaxDim

template<class tCell >
const int chomp::homology::tCell2l< tCell >::MaxDim = tCell::MaxDim
static

The maximal dimension of a cube.

Definition at line 495 of file twolayer.h.

◆ OutputBits

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

Definition at line 568 of file twolayer.h.

◆ q

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

The actual cubical cell at the given layer.

Definition at line 598 of file twolayer.h.

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


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