Public Member Functions | Private Attributes

chomp::homology::mvcellmap< cell, euclidom, element > Class Template Reference

This class represents a multivalued map whose domain is a geometric complex. More...

#include <gcomplex.h>

List of all members.

Public Member Functions

 mvcellmap (gcomplex< cell, euclidom > *_g=0)
 The constructor of a map with its domain.
 mvcellmap (gcomplex< cell, euclidom > &_g)
 The constructor of a map with its domain.
 mvcellmap (const mvcellmap< cell, euclidom, element > &m)
 The copy constructor.
mvcellmapoperator= (const mvcellmap< cell, euclidom, element > &m)
 The assignment operator.
 ~mvcellmap ()
 The destructor.
int dim () const
 Returns the dimension of the domain of the map.
const hashedset< cell > & get (int d) const
 Returns the given level of the geometric complex.
const gcomplex< cell, euclidom > & getdomain () const
 Returns a reference of the domain cell complex of the map.
const hashedset< element > & operator() (const cell &c) const
 Returns the image of a given cell.
void add (int d, const cell &c, const hashedset< element > &set)
 Adds a set to the image of a given cell, provided the dimension of the cell is known.
void add (const cell &c, const hashedset< element > &set)
 Adds a set to the image of a given cell.
void add (int d, int_t n, const hashedset< element > &set)
 Adds a set to the image of a given cell, provided the dimension and number of the cell is known.
void add (int d, const cell &c, const element &e)
 Adds an element to the image of a given cell, provided the dimension of the cell is known.
void add (const cell &c, const element &e)
 Adds an element to the image of a given cell.
void add (int d, int_t n, const element &e)
 Adds an element to the image of a given cell, provided the dimension and number of the cell is known.

Private Attributes

gcomplex< cell, euclidom > * g
 A pointer to the domain of the map.
multitable< hashedset< element > > * images
 The array of images of the elements of each dimension.
int dimension
 The dimension of the domain of the map.

Detailed Description

template<class cell, class euclidom, class element>
class chomp::homology::mvcellmap< cell, euclidom, element >

This class represents a multivalued map whose domain is a geometric complex.

Definition at line 1530 of file gcomplex.h.


Constructor & Destructor Documentation

template<class cell , class euclidom , class element >
chomp::homology::mvcellmap< cell, euclidom, element >::mvcellmap ( gcomplex< cell, euclidom > *  _g = 0  )  [inline]

The constructor of a map with its domain.

The domain of the map must exist during the existence of the map and its dimension must not increase.

Definition at line 1603 of file gcomplex.h.

{
        g = _g;
        if (!g || (g -> dim () < 0))
        {
                images = NULL;
                dimension = -1;
                return;
        }
        dimension = g -> dim ();
        images = new multitable <hashedset<element> > [dimension + 1];
        if (!images)
                throw "Cannot create a multivalued cellular map.";
        return;
} /* mvcellmap<cell,euclidom,element>::mvcellmap */

template<class cell , class euclidom , class element >
chomp::homology::mvcellmap< cell, euclidom, element >::mvcellmap ( gcomplex< cell, euclidom > &  _g  )  [inline]

The constructor of a map with its domain.

The domain of the map must exist during the existence of the map and its dimension must not increase.

Definition at line 1621 of file gcomplex.h.

{
        g = &_g;
        if (!g || (g -> dim () < 0))
        {
                images = NULL;
                dimension = -1;
                return;
        }
        dimension = g -> dim ();
        images = new multitable <hashedset<element> > [dimension + 1];
        if (!images)
                throw "Cannot create a multivalued cellular map.";
        return;
} /* mvcellmap<cell,euclidom,element>::mvcellmap */

template<class cell , class euclidom , class element >
chomp::homology::mvcellmap< cell, euclidom, element >::mvcellmap ( const mvcellmap< cell, euclidom, element > &  m  ) 

The copy constructor.

Definition at line 1639 of file gcomplex.h.

{
        g = m. g;
        if (!g || (g -> dim () < 0))
        {
                images = NULL;
                dimension = -1;
                return;
        }
        dimension = g -> dim ();
        images = new multitable <hashedset<element> > [dimension + 1];
        if (!images)
                throw "Unable to construct a copy of a multivalued "
                        "cellular map.";
        for (int i = 0; i < dimension + 1; ++ i)
                images [i] = m. images [i];
        return;
} /* mvcellmap<cell,euclidom,element>::mvcellmap */

template<class cell , class euclidom , class element >
chomp::homology::mvcellmap< cell, euclidom, element >::~mvcellmap (  )  [inline]

The destructor.

Definition at line 1680 of file gcomplex.h.

References chomp::homology::mvcellmap< cell, euclidom, element >::images.

{
        if (images)
                delete [] images;
        return;
} /* mvcellmap<cell,euclidom,element>::~mvcellmap */


Member Function Documentation

template<class cell , class euclidom , class element >
void chomp::homology::mvcellmap< cell, euclidom, element >::add ( int  d,
const cell &  c,
const hashedset< element > &  set 
) [inline]

Adds a set to the image of a given cell, provided the dimension of the cell is known.

Definition at line 1722 of file gcomplex.h.

References chomp::homology::mvcellmap< cell, euclidom, element >::dimension, chomp::homology::mvcellmap< cell, euclidom, element >::g, and chomp::homology::mvcellmap< cell, euclidom, element >::images.

Referenced by chomp::homology::mvcellmap< cell, euclidom, element >::add().

{
        if ((d < 0) || (d > dimension))
                throw "Wrong dimension for adding a cell to a map.";
        if (!g -> check (c))
        //      throw "The cell does not belong to the domain of the map.";
                g -> add (c);
        images [d] [(*g) [d]. getnumber (c)]. add (set);
        return;
} /* mvcellmap<cell,euclidom,element>::add */

template<class cell , class euclidom , class element >
void chomp::homology::mvcellmap< cell, euclidom, element >::add ( int  d,
int_t  n,
const element &  e 
) [inline]

Adds an element to the image of a given cell, provided the dimension and number of the cell is known.

Definition at line 1774 of file gcomplex.h.

References chomp::homology::mvcellmap< cell, euclidom, element >::add(), chomp::homology::mvcellmap< cell, euclidom, element >::dimension, and chomp::homology::mvcellmap< cell, euclidom, element >::images.

{
        if ((d < 0) || (d > dimension))
                throw "Wrong dimension for adding an element to the image.";
        images [d] [n]. add (set);
        return;
} /* mvcellmap<cell,euclidom,element>::add */

template<class cell , class euclidom , class element >
void chomp::homology::mvcellmap< cell, euclidom, element >::add ( int  d,
int_t  n,
const hashedset< element > &  set 
) [inline]

Adds a set to the image of a given cell, provided the dimension and number of the cell is known.

Definition at line 1743 of file gcomplex.h.

References chomp::homology::mvcellmap< cell, euclidom, element >::add(), chomp::homology::mvcellmap< cell, euclidom, element >::dimension, and chomp::homology::mvcellmap< cell, euclidom, element >::images.

{
        if ((d < 0) || (d > dimension))
                throw "Wrong dimension for adding an element to the image.";
        images [d] [n]. add (set);
        return;
} /* mvcellmap<cell,euclidom,element>::add */

template<class cell , class euclidom , class element >
void chomp::homology::mvcellmap< cell, euclidom, element >::add ( int  d,
const cell &  c,
const element &  e 
) [inline]

Adds an element to the image of a given cell, provided the dimension of the cell is known.

Definition at line 1753 of file gcomplex.h.

References chomp::homology::mvcellmap< cell, euclidom, element >::add(), chomp::homology::mvcellmap< cell, euclidom, element >::dimension, chomp::homology::mvcellmap< cell, euclidom, element >::g, and chomp::homology::mvcellmap< cell, euclidom, element >::images.

{
        if ((d < 0) || (d > dimension))
                throw "Wrong dimension for adding a cell to a map.";
        if (!g -> check (c))
        //      throw "The cell does not belong to the domain of the map.";
                g -> add (c);
        images [d] [(*g) [d]. getnumber (c)]. add (e);
        return;
} /* mvcellmap<cell,euclidom,element>::add */

template<class cell , class euclidom , class element >
void chomp::homology::mvcellmap< cell, euclidom, element >::add ( const cell &  c,
const element &  e 
) [inline]

Adds an element to the image of a given cell.

Definition at line 1766 of file gcomplex.h.

References chomp::homology::mvcellmap< cell, euclidom, element >::add(), and chomp::homology::mvcellmap< cell, euclidom, element >::dim().

{
        add (c. dim (), c, e);
        return;
} /* mvcellmap<cell,euclidom,element>::add */

template<class cell , class euclidom , class element >
void chomp::homology::mvcellmap< cell, euclidom, element >::add ( const cell &  c,
const hashedset< element > &  set 
) [inline]

Adds a set to the image of a given cell.

Definition at line 1735 of file gcomplex.h.

References chomp::homology::mvcellmap< cell, euclidom, element >::add(), and chomp::homology::mvcellmap< cell, euclidom, element >::dim().

{
        add (c. dim (), c, set);
        return;
} /* mvcellmap<cell,euclidom,element>::add */

template<class cell , class euclidom , class element >
int chomp::homology::mvcellmap< cell, euclidom, element >::dim (  )  const

Returns the dimension of the domain of the map.

Definition at line 1688 of file gcomplex.h.

References chomp::homology::mvcellmap< cell, euclidom, element >::dimension.

Referenced by chomp::homology::mvcellmap< cell, euclidom, element >::add().

{
        return dimension;
} /* mvcellmap<cell,euclidom,element>::dim */

template<class cell , class euclidom , class element >
const hashedset< cell > & chomp::homology::mvcellmap< cell, euclidom, element >::get ( int  d  )  const

Returns the given level of the geometric complex.

Definition at line 1694 of file gcomplex.h.

References chomp::homology::mvcellmap< cell, euclidom, element >::dimension, and chomp::homology::mvcellmap< cell, euclidom, element >::g.

{
        if ((d < 0) || (d > dimension))
                throw "Wrong dimension to retrieve from mvcellmap.";
        return (*g) [d];
} /* mvcellmap<cell,euclidom,element>::get */

template<class cell , class euclidom , class element >
const gcomplex< cell, euclidom > & chomp::homology::mvcellmap< cell, euclidom, element >::getdomain (  )  const

Returns a reference of the domain cell complex of the map.

Definition at line 1702 of file gcomplex.h.

References chomp::homology::mvcellmap< cell, euclidom, element >::g.

{
        return *g;
} /* mvcellmap<cell,euclidom,element>::getdomain */

template<class cell , class euclidom , class element >
const hashedset< element > & chomp::homology::mvcellmap< cell, euclidom, element >::operator() ( const cell &  c  )  const

Returns the image of a given cell.

Definition at line 1710 of file gcomplex.h.

{
        int d = c. dim ();
        if (d > dimension)
                throw "Trying to get the image of a cell of dim too high.";
        int_t n = (*g) [d]. getnumber (c);
        if (n < 0)
                throw "Trying to get the image of a cell not in the domain.";
        return images [d] [n];
} /* mvcellmap<cell,euclidom,element>::operator () */

template<class cell , class euclidom , class element >
mvcellmap< cell, euclidom, element > & chomp::homology::mvcellmap< cell, euclidom, element >::operator= ( const mvcellmap< cell, euclidom, element > &  m  ) 

The assignment operator.

Definition at line 1660 of file gcomplex.h.

{
        if (images)
                delete [] images;
        g = m. g;
        dimension = m. dimension;
        if (!g || (dimension < 0))
        {
                images = NULL;
                return *this;
        }
        images = new multitable <hashedset<element> > [dimension + 1];
        if (!images)
                throw "Cannot copy a multivalued cellular map.";
        for (int i = 0; i < dimension + 1; ++ i)
                images [i] = m. images [i];
        return *this;
} /* mvcellmap<cell,euclidom,element>::operator = */


Member Data Documentation

template<class cell, class euclidom, class element>
int chomp::homology::mvcellmap< cell, euclidom, element >::dimension [private]
template<class cell, class euclidom, class element>
gcomplex<cell,euclidom>* chomp::homology::mvcellmap< cell, euclidom, element >::g [private]
template<class cell, class euclidom, class element>
multitable<hashedset<element> >* chomp::homology::mvcellmap< cell, euclidom, element >::images [private]

The array of images of the elements of each dimension.

Definition at line 1592 of file gcomplex.h.

Referenced by chomp::homology::mvcellmap< cell, euclidom, element >::add(), and chomp::homology::mvcellmap< cell, euclidom, element >::~mvcellmap().


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