bdm::RV Class Reference

#include <libBM.h>

Inheritance diagram for bdm::RV:

Inheritance graph
[legend]

List of all members.


Detailed Description

Class representing variables, most often random variables.

The purpose of this class is to decribe a vector of data. Such description is used for connecting various vectors between each other, see class datalink.

The class is implemented using global variables to assure uniqueness of description:

In is a vector

inline_dotgraph_1.dot

Access functions

int _dsize () const
int countsize () const
 Recount size of the corresponding data vector.
int length () const
int id (int at) const
int size (int at) const
int time (int at) const
std::string name (int at) const
void set_time (int at, int time0)
std::ostream & operator<< (std::ostream &os, const RV &rv)
 Printing output e.g. for debugging.

Public Member Functions

Constructors
 RV (Array< std::string > in_names, ivec in_sizes, ivec in_times)
 Full constructor.
 RV (Array< std::string > in_names, ivec in_sizes)
 Constructor with times=0.
 RV (Array< std::string > in_names)
 Constructor with sizes=1, times=0.
 RV ()
 Constructor of empty RV.
 RV (string name, int sz, int tm=0)
 Constructor of a single RV with given id.
Algebra on Random Variables
ivec findself (const RV &rv2) const
 Find indexes of self in another rv,.
bool equal (const RV &rv2) const
 Compare if rv2 is identical to this RV.
bool add (const RV &rv2)
 Add (concat) another variable to the current one,.
RV subt (const RV &rv2) const
 Subtract another variable from the current one.
RV subselect (const ivec &ind) const
 Select only variables at indeces ind.
RV operator() (const ivec &ind) const
 Select only variables at indeces ind.
void t (int delta)
 Shift time shifted by delta.
Relation to vectors
str tostr () const
 generate str from rv, by expanding sizes
ivec dataind (const RV &crv) const
void dataind (const RV &rv2, ivec &selfi, ivec &rv2i) const
int mint () const
 Minimum time-offset.

Protected Attributes

int dsize
 size of the data vector
int len
 number of individual rvs
ivec ids
 Vector of unique IDs.
ivec times
 Vector of shifts from current time.

Member Function Documentation

ivec bdm::RV::findself ( const RV rv2  )  const

Find indexes of self in another rv,.

Returns:
ivec of the same size as self.

References ids, length(), and times.

Referenced by add(), dataind(), and subt().

bool bdm::RV::add ( const RV rv2  ) 

Add (concat) another variable to the current one,.

Returns:
true if all rv2 were added, false if rv2 is in conflict

References bdm::concat(), countsize(), dsize, findself(), ids, len, and times.

Referenced by UIArxDS::build(), UIARX::build(), bdm::concat(), bdm::compositepdf::getrv(), bdm::merger::merger(), and bdm::compositepdf::setrvc().

ivec bdm::RV::dataind ( const RV crv  )  const

when this rv is a part of bigger rv, this function returns indeces of self in the data vector of the bigger crv. Then, data can be copied via: data_of_this = cdata(ind);

References _dsize(), bdm::concat(), ids, bdm::str::ids, times, bdm::str::times, and tostr().

Referenced by bdm::enorm< sq_T >::condition(), bdm::datalink_m2e::datalink_m2e(), bdm::datalink_m2m::datalink_m2m(), and bdm::enorm< sq_T >::marginal().

void bdm::RV::dataind ( const RV rv2,
ivec &  selfi,
ivec &  rv2i 
) const

generate mutual indeces when copying data betwenn self and crv. Data are copied via: data_of_this(selfi) = data_of_rv2(rv2i)

References bdm::concat(), findself(), ids, bdm::str::ids, length(), times, bdm::str::times, and tostr().


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

Generated on Wed Feb 11 23:34:04 2009 for mixpp by  doxygen 1.5.6