#include <weight.hpp>
Public Types | |
typedef double(* | one_point_f )(qint) |
type of initialization function | |
Public Member Functions | |
vertex_weight () | |
construct uniform weight | |
vertex_weight (one_point_f F) | |
construct weight from function F , dot not precalculate any values | |
vertex_weight (one_point_f F, qint qtable) | |
construct weight from function F with initial precalculation qtable values for tables | |
template<value_type::weight_value_type WVC> | |
vertex_weight (const vertex_weight< WVC > &) | |
copy-construct weight from any other vertex_weight<>, doing appropriate conversions | |
double | r (qint q) const |
return r(q ) direct from tables, no range checks | |
double | p (qint q) const |
return p(q ) direct from tables, no range checks | |
double | ratio (qint q) const |
return r(q ) from tables if possible, otherwise it is calculated. | |
double | weight (qint q) const |
Return p(q ) from tables if possible, otherwise it is caluclated. | |
void | resize (qint limit) |
resize precalculated tables to limit entries, precalculate if tables are enlarged. | |
qint | limit () const |
return the smallest q, for which no precalculated value is available | |
std::ostream & | print (std::ostream &os, qint limit=0) const |
print limit lines of (q,weight,ratio) triples to the stream os . | |
template<> | |
double | weight (qint q) const |
template<> | |
double | ratio (qint q) const |
template<> | |
double | ratio (qint q) const |
template<> | |
double | weight (qint q) const |
template<> | |
double | weight (qint q) const |
template<> | |
double | ratio (qint q) const |
template<> | |
double | ratio (qint q) const |
template<> | |
double | weight (qint q) const |
template<> | |
double | weight (qint) const |
template<> | |
double | ratio (qint) const |
Static Public Attributes | |
static const bool | logarithmic = ( (WV == value_type::logweight) || (WV == value_type::logratio) ) |
true if this weight gives logarithmic values |
The vertex weight is used when the total functional weight of the network ensemble factorizes to functions depending only on single vertex degrees. The vertex_weight<> buffers tables an amount of weight and weight ratio values.
The WV template parameter sets up the method the initial function/data is interpreted and how values are returned.
double graphgen::vertex_weight< WV >::ratio | ( | qint | q | ) | const |
return r(q
) from tables if possible, otherwise it is calculated.
q
range is checked
Referenced by graphgen::vertex_weight< WV >::print(), and graphgen::vertex_weight< WV >::resize().
double graphgen::vertex_weight< WV >::weight | ( | qint | q | ) | const |
Return p(q
) from tables if possible, otherwise it is caluclated.
q
range is checked
Referenced by graphgen::graph_weight(), graphgen::vertex_weight< WV >::print(), and graphgen::vertex_weight< WV >::resize().
void graphgen::vertex_weight< WV >::resize | ( | qint | limit | ) | [inline] |
resize precalculated tables to limit
entries, precalculate if tables are enlarged.
Highest table entry will be for qmax=limit-1
References graphgen::vertex_weight< WV >::ratio(), and graphgen::vertex_weight< WV >::weight().
Referenced by graphgen::vertex_weight< WV >::vertex_weight().
std::ostream& graphgen::vertex_weight< WV >::print | ( | std::ostream & | os, | |
qint | limit = 0 | |||
) | const [inline] |
print limit
lines of (q,weight,ratio) triples to the stream os
.
Without limit all precalculated values are printed
References graphgen::vertex_weight< WV >::limit(), graphgen::vertex_weight< WV >::ratio(), graphgen::tab(), and graphgen::vertex_weight< WV >::weight().