graphgen::link_weight< WV > Class Template Reference

two point weight template class. More...

#include <weight.hpp>

List of all members.

Public Types

typedef double(* two_point_f )(qint, qint)
 type of initialization function

Public Member Functions

 link_weight ()
 construct uniform weight
 link_weight (two_point_f F)
 construct weight from function F(q1,q2), no precalculation of values
 link_weight (two_point_f F, qint qtable)
 construct weight from function F(q1,q2) and precalculate qtable entries
template<value_type::weight_value_type WVC>
 link_weight (const link_weight< WVC > &)
 copy-construct weight from any other link_weight using appropriate conversion
double r (qint q1, qint q2) const
 return r(q1,q2) direct from tables, no range checks
double p (qint q1, qint q2) const
 return p(q1,q2) from tables, no range checks
double ratio (qint q1, qint q2) const
 return r(q1,q2) from tables if possible, otherwise calculate.
double weight (qint q1, qint q2) const
 return p(!p q1,q2) from tables if possible, otherwise calculate.
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 (q1,q2,p(q1,q2),r(q1,q2)) tuples to the given stream os.
template<>
double weight (qint q1, qint q2) const
template<>
double ratio (qint q1, qint q2) const
template<>
double ratio (qint q1, qint q2) const
template<>
double weight (qint q1, qint q2) const
template<>
double weight (qint q1, qint q2) const
template<>
double ratio (qint q1, qint q2) const
template<>
double ratio (qint q1, qint q2) const
template<>
double weight (qint q1, qint q2) const
template<>
double weight (qint, qint) const
template<>
double ratio (qint, qint) const

Static Public Attributes

static const bool logarithmic = ( (WV == value_type::logweight) || (WV == value_type::logratio) )
 true if this weight gives logarithmic values


Detailed Description

template<value_type::weight_value_type WV>
class graphgen::link_weight< WV >

two point weight template class.

The link weight is used when the total functional weight of the network ensemble factorizes to functions depending on degrees of connected pairs of sites. link_weight<> buffers tables 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.

See also:
weight_value_type

Constructor & Destructor Documentation

template<value_type::weight_value_type WV>
template<value_type::weight_value_type WVC>
graphgen::link_weight< WV >::link_weight ( const link_weight< WVC > &   )  [inline]

copy-construct weight from any other link_weight using appropriate conversion

Todo:
implement


Member Function Documentation

template<value_type::weight_value_type WV>
double graphgen::link_weight< WV >::ratio ( qint  q1,
qint  q2 
) const

return r(q1,q2) from tables if possible, otherwise calculate.

range checked

Referenced by graphgen::link_weight< WV >::print(), and graphgen::link_weight< WV >::resize().

template<value_type::weight_value_type WV>
double graphgen::link_weight< WV >::weight ( qint  q1,
qint  q2 
) const

return p(!p q1,q2) from tables if possible, otherwise calculate.

range checked

Referenced by graphgen::graph_weight(), graphgen::link_weight< WV >::print(), and graphgen::link_weight< WV >::resize().

template<value_type::weight_value_type WV>
void graphgen::link_weight< WV >::resize ( qint  limit  )  [inline]

resize precalculated tables to limit entries, precalculate if tables are enlarged.

Highest table entries will be for qmax=limit-1 for q1 and/or q2

References graphgen::link_weight< WV >::ratio(), and graphgen::link_weight< WV >::weight().

Referenced by graphgen::link_weight< WV >::link_weight().

template<value_type::weight_value_type WV>
std::ostream& graphgen::link_weight< WV >::print ( std::ostream &  os,
qint  limit = 0 
) const [inline]

print limit lines of (q1,q2,p(q1,q2),r(q1,q2)) tuples to the given stream os.

limit defaults to qlimit

References graphgen::link_weight< WV >::limit(), graphgen::link_weight< WV >::ratio(), graphgen::tab(), and graphgen::link_weight< WV >::weight().


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