Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

MODEL::ReservoirFunction Class Template Reference

#include <reservoirfunction.h>

Inheritance diagram for MODEL::ReservoirFunction:

Inheritance graph
Collaboration diagram for MODEL::ReservoirFunction:

Collaboration graph
List of all members.

Public Types

typedef NT::number numT
typedef NT::vect vect
typedef NT::vf vf
typedef NT::matrix matrix
typedef exchange_rate_f* exchange_rate
typedef exchange_rate* exchange_rate_list

Public Methods

typedef number exchange_rate_f (ReservoirFunction *,const vect &u)
 ReservoirFunction ()
 ReservoirFunction (const ReservoirFunction &rf)
virtual void add_exchange_rate (int from, int to, exchange_rate er)
virtual const vect& input (vect &fu, const vect &u)=0
virtual const vect& function (vect &fu, const vect &u)
number get_rate (integer from, integer to, const vect &u)

Private Attributes

exchange_rate_list R [dims+1]

Detailed Description

template<integer dims, typename nelem = number, class NT = NumericTraits<nelem,dims>> class MODEL::ReservoirFunction

This will be a class for reservoir rate equations, on which we can do noise simulations. There is always one dump reservoir, which corresponds to the infinite universe. Use it (but don't fill it up.)
What does it do? For n dimensions, you have n+1 reservoirs
(include the universe which is indexed by 0), so we need to define 0.5*n(n-1)+n exchange rates. (The universe only eats particles.)
You define these using the supplied macros for ease, but it
the future I might write a parser. The class then represents these to the outside world as a normal VectorFunction, but of course the extra consistency can be used to extract noise response information.
How do I use it? Derive your class from ReservoirFunction,
and implement all the required exchange rates (as friend functions). If you miss one, the class will complain (I hope).

          class MySystem : ReservoirFunction<3>

Definition at line 59 of file reservoirfunction.h.

Constructor & Destructor Documentation

ReservoirFunction ( const ReservoirFunction<dims, nelem, NT> & rf ) [inline]

Copy constructor: copy parameters as well ! \note: this should not work, as R is not copied, but strangely enough, it does. WHY? And it doesn't ... It used to work because the amputated version does not have a correct call to the base class, and just copied all things binary. Of course, once you try to make a "real" copy, it fails.

: Clean out copy constructor dependencies and calling sequences in the VectorFunction Hierarchy
: this leaks as much as an bucket without a bottom. We really should rewrite the destructor to mop up.

Definition at line 96 of file reservoirfunction.h.

Member Function Documentation

const vect & function ( vect & fu,
const vect & u ) [inline, virtual]

This is the workhorse: it tries to take all the exchange rate functions and puts them into a coherent system which reacts like a vectorfunction. You have to make sure you defined them all.

Reimplemented from MODEL::VectorFunction.

Definition at line 132 of file reservoirfunction.h.

const vect & input ( vect & fu,
const vect & u ) [pure virtual]

This is the input vector. It might depend on the specific point

Referenced by function().

The documentation for this class was generated from the following file:
To get the sources or tarballs, please go to SourceForge or you can use the CVS repository.

More Info? Michael Peeters. Also, check our research website:

Last update: June 2002.

Looking for Open Source? Check out SourceForge Logo !