\hypertarget{classbdm_1_1RV}{
\section{bdm::RV Class Reference}
\label{classbdm_1_1RV}\index{bdm::RV@{bdm::RV}}
}
{\tt \#include $<$libBM.h$>$}

Inheritance diagram for bdm::RV::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{classbdm_1_1RV}
\end{center}
\end{figure}


\subsection{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 \hyperlink{classbdm_1_1datalink}{datalink}.

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

In is a vector \begin{center}
\begin{ImageNoCaption}\mbox{\includegraphics{inline_dotgraph_2}}
\end{ImageNoCaption}
\end{center}
 \subsection*{Access functions}
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1RV_de30156104f61d86c94f758861418089}{
int \textbf{\_\-dsize} () const }
\label{classbdm_1_1RV_de30156104f61d86c94f758861418089}

\item 
\hypertarget{classbdm_1_1RV_39f9b44752376f07e346579b5ff8cbbd}{
int \hyperlink{classbdm_1_1RV_39f9b44752376f07e346579b5ff8cbbd}{countsize} () const }
\label{classbdm_1_1RV_39f9b44752376f07e346579b5ff8cbbd}

\begin{CompactList}\small\item\em Recount size of the corresponding data vector. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1RV_412d43294bac38fa1804829e38fa4eaf}{
ivec \textbf{cumsizes} () const }
\label{classbdm_1_1RV_412d43294bac38fa1804829e38fa4eaf}

\item 
\hypertarget{classbdm_1_1RV_e9ec8c3e756651ff352ab5e3d3acda4b}{
int \textbf{length} () const }
\label{classbdm_1_1RV_e9ec8c3e756651ff352ab5e3d3acda4b}

\item 
\hypertarget{classbdm_1_1RV_5900b42f778129a9e56008a1e8e489c8}{
int \textbf{id} (int at) const }
\label{classbdm_1_1RV_5900b42f778129a9e56008a1e8e489c8}

\item 
\hypertarget{classbdm_1_1RV_bde62551a3fc8f3f83c569860b73f705}{
int \textbf{size} (int at) const }
\label{classbdm_1_1RV_bde62551a3fc8f3f83c569860b73f705}

\item 
\hypertarget{classbdm_1_1RV_c94373d3a760919b4b3eee58b42e3a45}{
int \textbf{time} (int at) const }
\label{classbdm_1_1RV_c94373d3a760919b4b3eee58b42e3a45}

\item 
\hypertarget{classbdm_1_1RV_74c6ec8eb9c1dd69ad1d986eaee16dc2}{
std::string \textbf{name} (int at) const }
\label{classbdm_1_1RV_74c6ec8eb9c1dd69ad1d986eaee16dc2}

\item 
\hypertarget{classbdm_1_1RV_fb2892d12dc978549e9491aed327dfd4}{
void \textbf{set\_\-time} (int at, int time0)}
\label{classbdm_1_1RV_fb2892d12dc978549e9491aed327dfd4}

\item 
\hypertarget{classbdm_1_1RV_cad6f15535d10437f6690cb4492176a8}{
std::ostream \& \hyperlink{classbdm_1_1RV_cad6f15535d10437f6690cb4492176a8}{operator$<$$<$} (std::ostream \&os, const \hyperlink{classbdm_1_1RV}{RV} \&rv)}
\label{classbdm_1_1RV_cad6f15535d10437f6690cb4492176a8}

\begin{CompactList}\small\item\em Printing output e.g. for debugging. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{Indent}{\bf Constructors}\par
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1RV_3d93da01a64dab31074b25b7d93e5eae}{
\hyperlink{classbdm_1_1RV_3d93da01a64dab31074b25b7d93e5eae}{RV} (Array$<$ std::string $>$ in\_\-names, ivec in\_\-sizes, ivec in\_\-times)}
\label{classbdm_1_1RV_3d93da01a64dab31074b25b7d93e5eae}

\begin{CompactList}\small\item\em Full constructor. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1RV_5bd1bd9ec51b91578ecc83a6b2398a20}{
\hyperlink{classbdm_1_1RV_5bd1bd9ec51b91578ecc83a6b2398a20}{RV} (Array$<$ std::string $>$ in\_\-names, ivec in\_\-sizes)}
\label{classbdm_1_1RV_5bd1bd9ec51b91578ecc83a6b2398a20}

\begin{CompactList}\small\item\em Constructor with times=0. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1RV_a222dfef569e8f123180d40fde97c1cd}{
\hyperlink{classbdm_1_1RV_a222dfef569e8f123180d40fde97c1cd}{RV} (Array$<$ std::string $>$ in\_\-names)}
\label{classbdm_1_1RV_a222dfef569e8f123180d40fde97c1cd}

\begin{CompactList}\small\item\em Constructor with sizes=1, times=0. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1RV_e319ca900261a5005a9b4b353ec16412}{
\hyperlink{classbdm_1_1RV_e319ca900261a5005a9b4b353ec16412}{RV} ()}
\label{classbdm_1_1RV_e319ca900261a5005a9b4b353ec16412}

\begin{CompactList}\small\item\em Constructor of empty \hyperlink{classbdm_1_1RV}{RV}. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1RV_a990e0f30c0e34f04c14260ab8ba5b5f}{
\hyperlink{classbdm_1_1RV_a990e0f30c0e34f04c14260ab8ba5b5f}{RV} (string name, int sz, int tm=0)}
\label{classbdm_1_1RV_a990e0f30c0e34f04c14260ab8ba5b5f}

\begin{CompactList}\small\item\em Constructor of a single \hyperlink{classbdm_1_1RV}{RV} with given id. \item\end{CompactList}\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Algebra on Random Variables}\par
\begin{CompactItemize}
\item 
ivec \hyperlink{classbdm_1_1RV_1367055b2608ad9d50d01a2da6cec869}{findself} (const \hyperlink{classbdm_1_1RV}{RV} \&rv2) const 
\begin{CompactList}\small\item\em Find indices of self in another rv,. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1RV_3bb011af88ae98f5c97955bb2c95cfee}{
bool \hyperlink{classbdm_1_1RV_3bb011af88ae98f5c97955bb2c95cfee}{equal} (const \hyperlink{classbdm_1_1RV}{RV} \&rv2) const }
\label{classbdm_1_1RV_3bb011af88ae98f5c97955bb2c95cfee}

\begin{CompactList}\small\item\em Compare if {\tt rv2} is identical to this {\tt \hyperlink{classbdm_1_1RV}{RV}}. \item\end{CompactList}\item 
bool \hyperlink{classbdm_1_1RV_87841b5ee43997b79789c0c22047e224}{add} (const \hyperlink{classbdm_1_1RV}{RV} \&rv2)
\begin{CompactList}\small\item\em Add (concat) another variable to the current one,. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1RV_aec44dabdf0a6d90fbae95e1356eda39}{
\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1RV_aec44dabdf0a6d90fbae95e1356eda39}{subt} (const \hyperlink{classbdm_1_1RV}{RV} \&rv2) const }
\label{classbdm_1_1RV_aec44dabdf0a6d90fbae95e1356eda39}

\begin{CompactList}\small\item\em Subtract another variable from the current one. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1RV_c0c04ab99ded62e1e05bcefb151ebeb9}{
\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1RV_c0c04ab99ded62e1e05bcefb151ebeb9}{subselect} (const ivec \&ind) const }
\label{classbdm_1_1RV_c0c04ab99ded62e1e05bcefb151ebeb9}

\begin{CompactList}\small\item\em Select only variables at indeces ind. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1RV_6f3daf0f857fff53a1c0a445fe160966}{
\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1RV_6f3daf0f857fff53a1c0a445fe160966}{operator()} (const ivec \&ind) const }
\label{classbdm_1_1RV_6f3daf0f857fff53a1c0a445fe160966}

\begin{CompactList}\small\item\em Select only variables at indeces ind. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1RV_452fb5f7ab1eafe17932bf9f458d0415}{
\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1RV_452fb5f7ab1eafe17932bf9f458d0415}{operator()} (int di1, int di2) const }
\label{classbdm_1_1RV_452fb5f7ab1eafe17932bf9f458d0415}

\begin{CompactList}\small\item\em Select from data vector starting at di1 to di2. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1RV_bd77cb0899f7fba1d0e34396137b7f1f}{
void \hyperlink{classbdm_1_1RV_bd77cb0899f7fba1d0e34396137b7f1f}{t} (int delta)}
\label{classbdm_1_1RV_bd77cb0899f7fba1d0e34396137b7f1f}

\begin{CompactList}\small\item\em Shift {\tt time} shifted by delta. \item\end{CompactList}\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Relation to vectors}\par
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1RV_8bdd7f4072749c7cc864b78a418ca388}{
\hyperlink{classbdm_1_1str}{str} \hyperlink{classbdm_1_1RV_8bdd7f4072749c7cc864b78a418ca388}{tostr} () const }
\label{classbdm_1_1RV_8bdd7f4072749c7cc864b78a418ca388}

\begin{CompactList}\small\item\em generate {\tt \hyperlink{classbdm_1_1str}{str}} from rv, by expanding sizes \item\end{CompactList}\item 
ivec \hyperlink{classbdm_1_1RV_cbebdb5e0d30101a6eb63550ef701c55}{dataind} (const \hyperlink{classbdm_1_1RV}{RV} \&crv) const 
\item 
void \hyperlink{classbdm_1_1RV_c92b92ecfd95c89be13ab3e6cb6855c1}{dataind} (const \hyperlink{classbdm_1_1RV}{RV} \&rv2, ivec \&selfi, ivec \&rv2i) const 
\item 
\hypertarget{classbdm_1_1RV_9a5c5aeeaf39299d07763377b05a8241}{
int \hyperlink{classbdm_1_1RV_9a5c5aeeaf39299d07763377b05a8241}{mint} () const }
\label{classbdm_1_1RV_9a5c5aeeaf39299d07763377b05a8241}

\begin{CompactList}\small\item\em Minimum time-offset. \item\end{CompactList}\end{CompactItemize}
\end{Indent}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1RV_0cfe477965243a89eb87a06b024e2fcb}{
int \hyperlink{classbdm_1_1RV_0cfe477965243a89eb87a06b024e2fcb}{dsize}}
\label{classbdm_1_1RV_0cfe477965243a89eb87a06b024e2fcb}

\begin{CompactList}\small\item\em size of the data vector \item\end{CompactList}\item 
\hypertarget{classbdm_1_1RV_b11bfdceb831ed30d33b852dd4a6b385}{
int \hyperlink{classbdm_1_1RV_b11bfdceb831ed30d33b852dd4a6b385}{len}}
\label{classbdm_1_1RV_b11bfdceb831ed30d33b852dd4a6b385}

\begin{CompactList}\small\item\em number of individual rvs \item\end{CompactList}\item 
\hypertarget{classbdm_1_1RV_0a9a4769ab5a322495bea0cd8091500b}{
ivec \hyperlink{classbdm_1_1RV_0a9a4769ab5a322495bea0cd8091500b}{ids}}
\label{classbdm_1_1RV_0a9a4769ab5a322495bea0cd8091500b}

\begin{CompactList}\small\item\em Vector of unique IDs. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1RV_ef6703854820bbf61736738f1bac6896}{
ivec \hyperlink{classbdm_1_1RV_ef6703854820bbf61736738f1bac6896}{times}}
\label{classbdm_1_1RV_ef6703854820bbf61736738f1bac6896}

\begin{CompactList}\small\item\em Vector of shifts from current time. \item\end{CompactList}\end{CompactItemize}


\subsection{Member Function Documentation}
\hypertarget{classbdm_1_1RV_1367055b2608ad9d50d01a2da6cec869}{
\index{bdm::RV@{bdm::RV}!findself@{findself}}
\index{findself@{findself}!bdm::RV@{bdm::RV}}
\subsubsection[findself]{\setlength{\rightskip}{0pt plus 5cm}ivec bdm::RV::findself (const {\bf RV} \& {\em rv2}) const}}
\label{classbdm_1_1RV_1367055b2608ad9d50d01a2da6cec869}


Find indices of self in another rv,. 

\begin{Desc}
\item[Returns:]ivec of the same size as self. \end{Desc}


References ids, length(), and times.

Referenced by add(), dataind(), and subt().\hypertarget{classbdm_1_1RV_87841b5ee43997b79789c0c22047e224}{
\index{bdm::RV@{bdm::RV}!add@{add}}
\index{add@{add}!bdm::RV@{bdm::RV}}
\subsubsection[add]{\setlength{\rightskip}{0pt plus 5cm}bool bdm::RV::add (const {\bf RV} \& {\em rv2})}}
\label{classbdm_1_1RV_87841b5ee43997b79789c0c22047e224}


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

\begin{Desc}
\item[Returns:]true if all rv2 were added, false if rv2 is in conflict \end{Desc}


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

Referenced by bdm::compositepdf::getrv(), bdm::merger::merger(), bdm::ArxDS::set\_\-drv(), and bdm::compositepdf::setrvc().\hypertarget{classbdm_1_1RV_cbebdb5e0d30101a6eb63550ef701c55}{
\index{bdm::RV@{bdm::RV}!dataind@{dataind}}
\index{dataind@{dataind}!bdm::RV@{bdm::RV}}
\subsubsection[dataind]{\setlength{\rightskip}{0pt plus 5cm}ivec bdm::RV::dataind (const {\bf RV} \& {\em crv}) const}}
\label{classbdm_1_1RV_cbebdb5e0d30101a6eb63550ef701c55}


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(), dsize, 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(), bdm::enorm$<$ sq\_\-T $>$::marginal(), and bdm::datalink::set\_\-connection().\hypertarget{classbdm_1_1RV_c92b92ecfd95c89be13ab3e6cb6855c1}{
\index{bdm::RV@{bdm::RV}!dataind@{dataind}}
\index{dataind@{dataind}!bdm::RV@{bdm::RV}}
\subsubsection[dataind]{\setlength{\rightskip}{0pt plus 5cm}void bdm::RV::dataind (const {\bf RV} \& {\em rv2}, \/  ivec \& {\em selfi}, \/  ivec \& {\em rv2i}) const}}
\label{classbdm_1_1RV_c92b92ecfd95c89be13ab3e6cb6855c1}


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

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
\hyperlink{libBM_8h}{libBM.h}\item 
libBM.cpp\end{CompactItemize}
