#include <util.hpp>
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 |
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.
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().
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().
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().