ug4
ug::cgraph Class Reference

#include <new_graph.h>

Public Types

typedef const size_t * const_row_iterator
 
typedef stdvector< size_t >::const_iterator const_row_iterator
 
typedef size_t * row_iterator
 
typedef stdvector< size_t >::iterator row_iterator
 

Public Member Functions

row_iterator begin_row (size_t row)
 
row_iterator begin_row (size_t row)
 
const_row_iterator begin_row (size_t row) const
 
const_row_iterator begin_row (size_t row) const
 
 cgraph ()
 
 cgraph ()
 
 cgraph (size_t n)
 
 cgraph (size_t n)
 
void create_as_symmetricized (const cgraph &other)
 
row_iterator end_row (size_t row)
 
row_iterator end_row (size_t row)
 
const_row_iterator end_row (size_t row) const
 
const_row_iterator end_row (size_t row) const
 
bool has_connection (size_t from, size_t to) const
 returns true if graph has connection from "from" to "to", otherwise false More...
 
void init (size_t i)
 returns true if graph has connection from "from" to "to", otherwise false More...
 
bool is_isolated (size_t i) const
 
bool is_isolated (size_t i) const
 
size_t num_connections (size_t node) const
 returns nr of nodes the node "node" is connected to. More...
 
size_t num_connections (size_t node) const
 returns nr of nodes the node "node" is connected to. More...
 
void pr (size_t i) const
 print row i More...
 
void print () const
 
void print () const
 print whole graph to cout More...
 
void resize (size_t n)
 
void resize (size_t n)
 
void set_as_transpose_of (const cgraph &other)
 creates this graph as the transpose of other More...
 
void set_as_transpose_of (const cgraph &other)
 creates this graph as the transpose of other More...
 
void set_connection (size_t from, size_t to)
 set a connection from "from" to "to" if not already there More...
 
void set_connection (size_t from, size_t to)
 set a connection from "from" to "to" if not already there More...
 
size_t size () const
 
size_t size () const
 
void size_check (size_t a, size_t b) const
 
void size_check (size_t i) const
 
void symmetricize ()
 
void transpose ()
 tranpose this graph (by using create_as_tranpose of) More...
 
void transpose ()
 tranpose this graph (by using create_as_tranpose of) More...
 
 ~cgraph ()
 
 ~cgraph ()
 

Protected Attributes

stdvector< size_t * > cons
 
stdvector< size_t > consmem
 
size_t iMaxTotalNrOfConnections
 
size_t iTotalNrOfConnections
 
stdvector< stdvector< size_t > > m_data
 

Private Member Functions

void increase_maxtotalnrofconnections ()
 
void size_check (size_t i) const
 
void size_check (size_t i, size_t j) const
 

Friends

std::ostream & operator<< (std::ostream &out, const cgraph &g)
 

Detailed Description

cgraph graph class

Member Typedef Documentation

◆ const_row_iterator [1/2]

typedef const size_t* ug::cgraph::const_row_iterator

◆ const_row_iterator [2/2]

typedef stdvector<size_t>::const_iterator ug::cgraph::const_row_iterator

◆ row_iterator [1/2]

typedef size_t* ug::cgraph::row_iterator

◆ row_iterator [2/2]

typedef stdvector<size_t>::iterator ug::cgraph::row_iterator

Constructor & Destructor Documentation

◆ cgraph() [1/4]

ug::cgraph::cgraph ( )
inline

constructor

References FORCE_CREATION, and print().

◆ cgraph() [2/4]

ug::cgraph::cgraph ( size_t  n)
inline

References resize().

◆ ~cgraph() [1/2]

ug::cgraph::~cgraph ( )
inline

destructor

◆ cgraph() [3/4]

ug::cgraph::cgraph ( )
inline

constructor

◆ cgraph() [4/4]

ug::cgraph::cgraph ( size_t  n)
inline

References FORCE_CREATION, m_data, pr(), print(), and resize().

◆ ~cgraph() [2/2]

ug::cgraph::~cgraph ( )
inline

destructor

Member Function Documentation

◆ begin_row() [1/4]

◆ begin_row() [2/4]

row_iterator ug::cgraph::begin_row ( size_t  row)
inline

References m_data, and size_check().

◆ begin_row() [3/4]

const_row_iterator ug::cgraph::begin_row ( size_t  row) const
inline

References cons, and size_check().

◆ begin_row() [4/4]

const_row_iterator ug::cgraph::begin_row ( size_t  row) const
inline

References m_data, and size_check().

◆ create_as_symmetricized()

void ug::cgraph::create_as_symmetricized ( const cgraph other)
inline

◆ end_row() [1/4]

◆ end_row() [2/4]

row_iterator ug::cgraph::end_row ( size_t  row)
inline

References m_data, and size_check().

◆ end_row() [3/4]

const_row_iterator ug::cgraph::end_row ( size_t  row) const
inline

References cons, and size_check().

◆ end_row() [4/4]

const_row_iterator ug::cgraph::end_row ( size_t  row) const
inline

References m_data, and size_check().

◆ has_connection()

bool ug::cgraph::has_connection ( size_t  from,
size_t  to 
) const
inline

returns true if graph has connection from "from" to "to", otherwise false

References begin_row(), end_row(), and size_check().

◆ increase_maxtotalnrofconnections()

void ug::cgraph::increase_maxtotalnrofconnections ( )
inlineprivate

References cons, and consmem.

Referenced by set_connection().

◆ init()

void ug::cgraph::init ( size_t  i)
inline

returns true if graph has connection from "from" to "to", otherwise false

References cons, and consmem.

Referenced by set_connection().

◆ is_isolated() [1/2]

bool ug::cgraph::is_isolated ( size_t  i) const
inline

References cons, num_connections(), and size_check().

◆ is_isolated() [2/2]

bool ug::cgraph::is_isolated ( size_t  i) const
inline

◆ num_connections() [1/2]

size_t ug::cgraph::num_connections ( size_t  node) const
inline

returns nr of nodes the node "node" is connected to.

References cons, and size_check().

Referenced by create_as_symmetricized(), is_isolated(), pr(), and set_as_transpose_of().

◆ num_connections() [2/2]

size_t ug::cgraph::num_connections ( size_t  node) const
inline

returns nr of nodes the node "node" is connected to.

References m_data, and size_check().

◆ pr()

void ug::cgraph::pr ( size_t  i) const
inline

print row i

References begin_row(), end_row(), and num_connections().

Referenced by cgraph().

◆ print() [1/2]

void ug::cgraph::print ( ) const
inline

References begin_row(), end_row(), and size().

Referenced by cgraph().

◆ print() [2/2]

void ug::cgraph::print ( ) const
inline

print whole graph to cout

◆ resize() [1/2]

◆ resize() [2/2]

void ug::cgraph::resize ( size_t  n)
inline

References m_data, and resize().

◆ set_as_transpose_of() [1/2]

void ug::cgraph::set_as_transpose_of ( const cgraph other)
inline

creates this graph as the transpose of other

References begin_row(), cons, consmem, end_row(), iMaxTotalNrOfConnections, iTotalNrOfConnections, num_connections(), p, size(), and UG_ASSERT.

Referenced by transpose().

◆ set_as_transpose_of() [2/2]

void ug::cgraph::set_as_transpose_of ( const cgraph other)
inline

creates this graph as the transpose of other

References m_data.

◆ set_connection() [1/2]

void ug::cgraph::set_connection ( size_t  from,
size_t  to 
)
inline

◆ set_connection() [2/2]

void ug::cgraph::set_connection ( size_t  from,
size_t  to 
)
inline

set a connection from "from" to "to" if not already there

References begin_row(), end_row(), m_data, and size_check().

◆ size() [1/2]

◆ size() [2/2]

size_t ug::cgraph::size ( ) const
inline

References m_data.

◆ size_check() [1/4]

void ug::cgraph::size_check ( size_t  a,
size_t  b 
) const
inline

References m_data, and UG_ASSERT.

◆ size_check() [2/4]

void ug::cgraph::size_check ( size_t  i) const
inlineprivate

◆ size_check() [3/4]

void ug::cgraph::size_check ( size_t  i) const
inline

References m_data, and UG_ASSERT.

◆ size_check() [4/4]

void ug::cgraph::size_check ( size_t  i,
size_t  j 
) const
inlineprivate

References size(), and UG_ASSERT.

◆ symmetricize()

void ug::cgraph::symmetricize ( )
inline

◆ transpose() [1/2]

void ug::cgraph::transpose ( )
inline

tranpose this graph (by using create_as_tranpose of)

References cons, consmem, iMaxTotalNrOfConnections, iTotalNrOfConnections, and set_as_transpose_of().

◆ transpose() [2/2]

void ug::cgraph::transpose ( )
inline

tranpose this graph (by using create_as_tranpose of)

References m_data.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const cgraph g 
)
friend

Member Data Documentation

◆ cons

◆ consmem

◆ iMaxTotalNrOfConnections

size_t ug::cgraph::iMaxTotalNrOfConnections
protected

◆ iTotalNrOfConnections

size_t ug::cgraph::iTotalNrOfConnections
protected

◆ m_data


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