gNode< T > Class Template Reference

#include <graph.hpp>

List of all members.

Public Member Functions

Friends


Detailed Description

template<class T>
class mmx::shape::gNode< T >

Definition at line 32 of file graph.hpp.


Constructor & Destructor Documentation

gNode (  )  [inline]

Definition at line 49 of file graph.hpp.

00049 : vlist (NULL), next (NULL), me (this), start (this) {};

gNode ( val  )  [inline]

Definition at line 51 of file graph.hpp.

00052     {
00053       this->data =val; //node data
00054       this->vlist=NULL;//next node in list
00055       this->next =NULL;//next neighbor of node
00056       this->me   =this;//next occurance of this node
00057       this->start=this;//pointer to this node on the node list
00058       this->m_status =2009;
00059       this->m_aux    =0;
00060     }   


Member Function Documentation

bool adj ( T &  v  )  [inline]

True if the node is adjacent to node with data v.

Definition at line 66 of file graph.hpp.

00066                         {
00067     
00068     gNode<T>* t;
00069     t= this->next;
00070     
00071     while(t!=NULL)
00072     {
00073       if(t->vlist->data==v)
00074         return true;
00075       t=t->next;
00076     }
00077     return false;
00078   };

int aux (  )  [inline]

Get vertex aux.

Definition at line 103 of file graph.hpp.

00104     {
00105       return this->start->m_aux;
00106     };

void aux ( int  i  )  [inline]

Set vertex aux.

Definition at line 97 of file graph.hpp.

Referenced by Graph< T >::push_vertex(), voronoi2dimpl< C, V >::run(), and voronoi2d< C, V >::run().

00098     {
00099       this->start->m_aux=i;
00100     };

T get_data (  )  [inline]

Definition at line 62 of file graph.hpp.

Referenced by voronoi2dimpl< C, V >::run(), and voronoi2d< C, V >::run().

00062 {return this->data;};

int status (  )  [inline]

Set vertex status.

Definition at line 91 of file graph.hpp.

00092     {
00093       return this->start->m_status;
00094     };

void status ( int  i  )  [inline]

Get vertex status.

Definition at line 81 of file graph.hpp.

Referenced by Graph< T >::dfs(), Graph< T >::dfs_walk(), and GraphDfsIter< T >::first().

00082     {
00083       if (this->start == NULL) {
00084         std::cerr << "internal bug\n";
00085         exit (-1);
00086       }
00087       this->start->m_status=i;
00088     };


Friends And Related Function Documentation

friend class Graph< T > [friend]

Definition at line 35 of file graph.hpp.

friend class GraphDfsIter< T > [friend]

Definition at line 36 of file graph.hpp.


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

Generated on 6 Dec 2012 for shape by  doxygen 1.6.1