bdm::RV Class Reference

Class representing variables, most often random variables. More...

#include <libBM.h>

Inheritance diagram for bdm::RV:

Inheritance graph
[legend]
Collaboration diagram for bdm::RV:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 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.
int count () const
 Return number of scalars in the RV.
int length () const
 Return length (number of entries) of the RV.
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.
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
Array< std::string > & _names ()
 access function
int id (int at)
 access function
int size (int at)
 access function
int time (int at)
 access function
std::string name (int at)
 access function
void set_id (int at, int id0)
 access function
void set_size (int at, int size0)
 access function
void set_time (int at, int time0)
 access function
void newids ()
 Assign unused ids to this rv.

Protected Attributes

int tsize
 size = sum of sizes
int len
 len = number of individual rvs
ivec ids
 Vector of unique IDs.
ivec sizes
 Vector of sizes.
ivec times
 Vector of shifts from current time.
Array< std::string > names
 Array of names.

Friends

std::ostream & operator<< (std::ostream &os, const RV &rv)
 Printing output e.g. for debugging.


Detailed Description

Class representing variables, most often random variables.

More?...


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, len, 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 findself(), ids, len, names, sizes, times, and tsize.

Referenced by bdm::compositepdf::getrv(), bdm::merger::merger(), bdm::MPF< BM_T >::MPF(), 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 count(), ids, bdm::str::ids, len, times, bdm::str::times, tostr(), and tsize.

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 findself(), ids, bdm::str::ids, len, length(), times, bdm::str::times, and tostr().


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

Generated on Tue Jan 27 16:31:12 2009 for mixpp by  doxygen 1.5.6