graphgen::symmetric_matrix< T > Class Template Reference
[Utilities]

Symmetric matrix container data type<T>. More...

#include <util.hpp>

List of all members.

Public Member Functions

 symmetric_matrix (unsigned int size)
 symmetric_matrix (unsigned int size, T val)
T & operator() (unsigned int i, unsigned int j)
 return reference of a_ij, note that rows/cols are numbered beginning with zero
const T & operator() (unsigned int i, unsigned int j) const
 return const reference of a_ij, note that rows/cols are numbered beginning with zero
T & at (unsigned int i, unsigned int j)
 return reference of a_ij, note that rows/cols are numbered beginning with zero
const T & at (unsigned int i, unsigned int j) const
 return const reference of a_ij, note that rows/cols are numbered beginning with zero
size_t size () const
 return the inverse of index for the vector size.
void resize (unsigned int n)
 resize, so that n rows/cols are in the matrix


Detailed Description

template<class T>
class graphgen::symmetric_matrix< T >

Symmetric matrix container data type<T>.

Lower triangular matrix elements are stored in a linear extendable structure: 0 1 2 3 4 5

The matrix number of rows/cols can be passed on initialization or changed later. The Matrix will grow to contain elements queried with the at(i,j) method. The operator() is just like any index operator but for two indices. Order of indices does not matter, max(i,j) will be index of the row, min(i,j) for column.


Member Function Documentation

template<class T>
T& graphgen::symmetric_matrix< T >::at ( unsigned int  i,
unsigned int  j 
) [inline]

return reference of a_ij, note that rows/cols are numbered beginning with zero

this is bounds checked and will grow the matrix if needed

References graphgen::symmetric_matrix< T >::resize().

Referenced by graphgen::estimate_degree_correlation().

template<class T>
const T& graphgen::symmetric_matrix< T >::at ( unsigned int  i,
unsigned int  j 
) const [inline]

return const reference of a_ij, note that rows/cols are numbered beginning with zero

this is bounds checked and will grow the matrix if needed

References graphgen::symmetric_matrix< T >::resize().

template<class T>
size_t graphgen::symmetric_matrix< T >::size (  )  const [inline]

return the inverse of index for the vector size.

add 0.5 to avoid floating point problems

Referenced by graphgen::estimate_assortativity(), graphgen::estimate_average_neighbor_degrees(), and graphgen::estimate_degree_correlation().


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

Generated on Wed Jun 2 14:49:12 2010 for GraphGen by  doxygen 1.5.6