\hypertarget{classchmat}{
\section{chmat Class Reference}
\label{classchmat}\index{chmat@{chmat}}
}
Symmetric matrix stored in square root decomposition using upper cholesky.  


{\tt \#include $<$chmat.h$>$}

Inheritance diagram for chmat:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=43pt]{classchmat__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for chmat:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=43pt]{classchmat__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
void \hyperlink{classchmat_bbc2d98d7455b1f38828907d442836bf}{opupdt} (const vec \&v, double w)
\item 
\hypertarget{classchmat_045addd685f8d978efda232d7dcb070e}{
mat \hyperlink{classchmat_045addd685f8d978efda232d7dcb070e}{to\_\-mat} () const }
\label{classchmat_045addd685f8d978efda232d7dcb070e}

\begin{CompactList}\small\item\em Conversion to full matrix. \item\end{CompactList}\item 
void \hyperlink{classchmat_66f509f92b0ccf020e2a2a32566e0777}{mult\_\-sym} (const mat \&C)
\begin{CompactList}\small\item\em Inplace symmetric multiplication by a SQUARE matrix $C$, i.e. $V = C*V*C'$. \item\end{CompactList}\item 
\hypertarget{classchmat_d558ab63475a2f2ebc0c0e149796dcc6}{
void \textbf{mult\_\-sym} (const mat \&C, \hyperlink{classchmat}{chmat} \&U) const }
\label{classchmat_d558ab63475a2f2ebc0c0e149796dcc6}

\item 
void \hyperlink{classchmat_07f50d1332b901eee962e8b1913102f7}{mult\_\-sym\_\-t} (const mat \&C)
\begin{CompactList}\small\item\em Inplace symmetric multiplication by a SQUARE transpose of matrix $C$, i.e. $V = C'*V*C$. \item\end{CompactList}\item 
\hypertarget{classchmat_31c3b985214a150b2a6b4be3b0fd40e3}{
void \textbf{mult\_\-sym\_\-t} (const mat \&C, \hyperlink{classchmat}{chmat} \&U) const }
\label{classchmat_31c3b985214a150b2a6b4be3b0fd40e3}

\item 
\hypertarget{classchmat_b504ca818203b13e667cb3c503980382}{
double \hyperlink{classchmat_b504ca818203b13e667cb3c503980382}{logdet} () const }
\label{classchmat_b504ca818203b13e667cb3c503980382}

\begin{CompactList}\small\item\em Logarithm of a determinant. \item\end{CompactList}\item 
vec \hyperlink{classchmat_b22aa239dbaca33e3fb93b4f674d7051}{sqrt\_\-mult} (const vec \&v) const 
\begin{CompactList}\small\item\em Multiplies square root of $V$ by vector $x$. \item\end{CompactList}\item 
\hypertarget{classchmat_6807737c7ffdb7041256b51db7592248}{
double \hyperlink{classchmat_6807737c7ffdb7041256b51db7592248}{qform} (const vec \&v) const }
\label{classchmat_6807737c7ffdb7041256b51db7592248}

\begin{CompactList}\small\item\em Evaluates quadratic form $x= v'*V*v$;. \item\end{CompactList}\item 
\hypertarget{classchmat_b49427cff186c62f5df3724e5d2c34b4}{
double \hyperlink{classchmat_b49427cff186c62f5df3724e5d2c34b4}{invqform} (const vec \&v) const }
\label{classchmat_b49427cff186c62f5df3724e5d2c34b4}

\begin{CompactList}\small\item\em Evaluates quadratic form $x= v'*inv(V)*v$;. \item\end{CompactList}\item 
\hypertarget{classchmat_d0a995d312ecc11d3b43693f5e224ba9}{
void \hyperlink{classchmat_d0a995d312ecc11d3b43693f5e224ba9}{clear} ()}
\label{classchmat_d0a995d312ecc11d3b43693f5e224ba9}

\begin{CompactList}\small\item\em Clearing matrix so that it corresponds to zeros. \item\end{CompactList}\item 
\hypertarget{classchmat_f3921e3e5e31337cdbda40a3a5467257}{
void \hyperlink{classchmat_f3921e3e5e31337cdbda40a3a5467257}{add} (const \hyperlink{classchmat}{chmat} \&A2, double w=1.0)}
\label{classchmat_f3921e3e5e31337cdbda40a3a5467257}

\begin{CompactList}\small\item\em add another \hyperlink{classchmat}{chmat} {\tt A2} with weight {\tt w}. \item\end{CompactList}\item 
\hypertarget{classchmat_5ce4e21a9012a4e98c1f0ed1ca5669bd}{
void \hyperlink{classchmat_5ce4e21a9012a4e98c1f0ed1ca5669bd}{inv} (\hyperlink{classchmat}{chmat} \&Inv) const }
\label{classchmat_5ce4e21a9012a4e98c1f0ed1ca5669bd}

\begin{CompactList}\small\item\em Inversion in the same form, i.e. cholesky. \item\end{CompactList}\item 
\hypertarget{classchmat_ba62fbf7cb8e065a4f3d24457824e89b}{
virtual \hyperlink{classchmat_ba62fbf7cb8e065a4f3d24457824e89b}{$\sim$chmat} ()}
\label{classchmat_ba62fbf7cb8e065a4f3d24457824e89b}

\begin{CompactList}\small\item\em Destructor for future use;. \item\end{CompactList}\item 
\hypertarget{classchmat_fdd73b0c596161637fd25bdf2c670c39}{
\hyperlink{classchmat_fdd73b0c596161637fd25bdf2c670c39}{chmat} (const int dim0)}
\label{classchmat_fdd73b0c596161637fd25bdf2c670c39}

\begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item 
\hypertarget{classchmat_d4f0a94e81279295e60e72812130f9d4}{
\hyperlink{classchmat_d4f0a94e81279295e60e72812130f9d4}{chmat} (const vec \&v)}
\label{classchmat_d4f0a94e81279295e60e72812130f9d4}

\begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item 
\hypertarget{classchmat_d92f3bd9a727b8c88a8c7385feb3449a}{
\hyperlink{classchmat_d92f3bd9a727b8c88a8c7385feb3449a}{chmat} (const \hyperlink{classchmat}{chmat} \&Ch0)}
\label{classchmat_d92f3bd9a727b8c88a8c7385feb3449a}

\begin{CompactList}\small\item\em Copy constructor. \item\end{CompactList}\item 
\hypertarget{classchmat_8334a00f30f0a05f893c2aeec395ef10}{
\hyperlink{classchmat_8334a00f30f0a05f893c2aeec395ef10}{chmat} (const mat \&M)}
\label{classchmat_8334a00f30f0a05f893c2aeec395ef10}

\begin{CompactList}\small\item\em Default constructor (m3k:cholform). \item\end{CompactList}\item 
\hypertarget{classchmat_24de7f42e0a86bb270588cd0dd9d60b4}{
\hyperlink{classchmat_24de7f42e0a86bb270588cd0dd9d60b4}{chmat} (const \hyperlink{classchmat}{chmat} \&M, const ivec \&perm)}
\label{classchmat_24de7f42e0a86bb270588cd0dd9d60b4}

\begin{CompactList}\small\item\em Constructor. \item\end{CompactList}\item 
\hypertarget{classchmat_9c50d31c999d85d8e9d8cf2b69b6ac8c}{
mat \& \hyperlink{classchmat_9c50d31c999d85d8e9d8cf2b69b6ac8c}{\_\-Ch} ()}
\label{classchmat_9c50d31c999d85d8e9d8cf2b69b6ac8c}

\begin{CompactList}\small\item\em Access function. \item\end{CompactList}\item 
\hypertarget{classchmat_a4fc7f9b0539b97c414442a22f3db6e8}{
void \hyperlink{classchmat_a4fc7f9b0539b97c414442a22f3db6e8}{setD} (const vec \&nD)}
\label{classchmat_a4fc7f9b0539b97c414442a22f3db6e8}

\begin{CompactList}\small\item\em Access functions. \item\end{CompactList}\item 
\hypertarget{classchmat_4b9271097d8317d9514c5d0d62cccb39}{
void \hyperlink{classchmat_4b9271097d8317d9514c5d0d62cccb39}{setD} (const vec \&nD, int i)}
\label{classchmat_4b9271097d8317d9514c5d0d62cccb39}

\begin{CompactList}\small\item\em Access functions. \item\end{CompactList}\item 
\hyperlink{classchmat}{chmat} \& \hyperlink{classchmat_6a8b39fe3a28d2c8e3fc0d74141229fb}{operator+=} (const \hyperlink{classchmat}{chmat} \&A2)
\begin{CompactList}\small\item\em Operators. \item\end{CompactList}\item 
\hypertarget{classchmat_a8c3628a8c15eb0009e57c66fcac1a76}{
\hyperlink{classchmat}{chmat} \& \hyperlink{classchmat_a8c3628a8c15eb0009e57c66fcac1a76}{operator-=} (const \hyperlink{classchmat}{chmat} \&A2)}
\label{classchmat_a8c3628a8c15eb0009e57c66fcac1a76}

\begin{CompactList}\small\item\em mapping of negative add operation to operators \item\end{CompactList}\item 
\hypertarget{classsqmat_ecc2e2540f95a04f4449842588170f5b}{
int \hyperlink{classsqmat_ecc2e2540f95a04f4449842588170f5b}{cols} () const }
\label{classsqmat_ecc2e2540f95a04f4449842588170f5b}

\begin{CompactList}\small\item\em Reimplementing common functions of mat: \hyperlink{classsqmat_ecc2e2540f95a04f4449842588170f5b}{cols()}. \item\end{CompactList}\item 
\hypertarget{classsqmat_071e80ced9cc3b8cbb360fa7462eb646}{
int \hyperlink{classsqmat_071e80ced9cc3b8cbb360fa7462eb646}{rows} () const }
\label{classsqmat_071e80ced9cc3b8cbb360fa7462eb646}

\begin{CompactList}\small\item\em Reimplementing common functions of mat: \hyperlink{classsqmat_ecc2e2540f95a04f4449842588170f5b}{cols()}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
\hypertarget{classchmat_95158bb150f5e7f939168abcd577fd9c}{
mat \hyperlink{classchmat_95158bb150f5e7f939168abcd577fd9c}{Ch}}
\label{classchmat_95158bb150f5e7f939168abcd577fd9c}

\begin{CompactList}\small\item\em Upper triangle of the cholesky matrix. \item\end{CompactList}\item 
\hypertarget{classsqmat_0abed904bdc0882373ba9adba919689d}{
int \hyperlink{classsqmat_0abed904bdc0882373ba9adba919689d}{dim}}
\label{classsqmat_0abed904bdc0882373ba9adba919689d}

\begin{CompactList}\small\item\em dimension of the square matrix \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Symmetric matrix stored in square root decomposition using upper cholesky. 

This matrix represent $A=Ch' Ch$ where only the upper triangle $Ch$ is stored; 

\subsection{Member Function Documentation}
\hypertarget{classchmat_bbc2d98d7455b1f38828907d442836bf}{
\index{chmat@{chmat}!opupdt@{opupdt}}
\index{opupdt@{opupdt}!chmat@{chmat}}
\subsubsection[opupdt]{\setlength{\rightskip}{0pt plus 5cm}void chmat::opupdt (const vec \& {\em v}, \/  double {\em w})\hspace{0.3cm}{\tt  \mbox{[}virtual\mbox{]}}}}
\label{classchmat_bbc2d98d7455b1f38828907d442836bf}


Perfroms a rank-1 update by outer product of vectors: $V = V + w v v'$. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em v}]Vector forming the outer product to be added \item[{\em w}]weight of updating; can be negative\end{description}
\end{Desc}
BLAS-2b operation. 

Implements \hyperlink{classsqmat_b223484796661f2dadb5607a86ce0581}{sqmat}.

References Ch.\hypertarget{classchmat_66f509f92b0ccf020e2a2a32566e0777}{
\index{chmat@{chmat}!mult\_\-sym@{mult\_\-sym}}
\index{mult\_\-sym@{mult\_\-sym}!chmat@{chmat}}
\subsubsection[mult\_\-sym]{\setlength{\rightskip}{0pt plus 5cm}void chmat::mult\_\-sym (const mat \& {\em C})\hspace{0.3cm}{\tt  \mbox{[}virtual\mbox{]}}}}
\label{classchmat_66f509f92b0ccf020e2a2a32566e0777}


Inplace symmetric multiplication by a SQUARE matrix $C$, i.e. $V = C*V*C'$. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em C}]multiplying matrix, \end{description}
\end{Desc}


Implements \hyperlink{classsqmat_60fbbfa9e483b8187c135f787ee53afa}{sqmat}.\hypertarget{classchmat_07f50d1332b901eee962e8b1913102f7}{
\index{chmat@{chmat}!mult\_\-sym\_\-t@{mult\_\-sym\_\-t}}
\index{mult\_\-sym\_\-t@{mult\_\-sym\_\-t}!chmat@{chmat}}
\subsubsection[mult\_\-sym\_\-t]{\setlength{\rightskip}{0pt plus 5cm}void chmat::mult\_\-sym\_\-t (const mat \& {\em C})\hspace{0.3cm}{\tt  \mbox{[}virtual\mbox{]}}}}
\label{classchmat_07f50d1332b901eee962e8b1913102f7}


Inplace symmetric multiplication by a SQUARE transpose of matrix $C$, i.e. $V = C'*V*C$. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em C}]multiplying matrix, \end{description}
\end{Desc}


Implements \hyperlink{classsqmat_6909e906da17725b1b80f3cae7cf3325}{sqmat}.\hypertarget{classchmat_b22aa239dbaca33e3fb93b4f674d7051}{
\index{chmat@{chmat}!sqrt\_\-mult@{sqrt\_\-mult}}
\index{sqrt\_\-mult@{sqrt\_\-mult}!chmat@{chmat}}
\subsubsection[sqrt\_\-mult]{\setlength{\rightskip}{0pt plus 5cm}vec chmat::sqrt\_\-mult (const vec \& {\em v}) const\hspace{0.3cm}{\tt  \mbox{[}virtual\mbox{]}}}}
\label{classchmat_b22aa239dbaca33e3fb93b4f674d7051}


Multiplies square root of $V$ by vector $x$. 

Used e.g. in generating normal samples. 

Implements \hyperlink{classsqmat_6b79438b5d7544a9c8e110a145355d8f}{sqmat}.

References Ch.\hypertarget{classchmat_6a8b39fe3a28d2c8e3fc0d74141229fb}{
\index{chmat@{chmat}!operator+=@{operator+=}}
\index{operator+=@{operator+=}!chmat@{chmat}}
\subsubsection[operator+=]{\setlength{\rightskip}{0pt plus 5cm}{\bf chmat} \& chmat::operator+= (const {\bf chmat} \& {\em A2})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{classchmat_6a8b39fe3a28d2c8e3fc0d74141229fb}


Operators. 

Operations: mapping of add operation to operators 

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
work/git/mixpp/bdm/math/\hyperlink{chmat_8h}{chmat.h}\item 
work/git/mixpp/bdm/math/chmat.cpp\end{CompactItemize}
