[37] | 1 | \section{chmat Class Reference} |
---|
| 2 | \label{classchmat}\index{chmat@{chmat}} |
---|
| 3 | Symmetric matrix stored in square root decomposition using upper cholesky. |
---|
| 4 | |
---|
| 5 | |
---|
| 6 | {\tt \#include $<$chmat.h$>$} |
---|
| 7 | |
---|
| 8 | Inheritance diagram for chmat:\nopagebreak |
---|
| 9 | \begin{figure}[H] |
---|
| 10 | \begin{center} |
---|
| 11 | \leavevmode |
---|
[91] | 12 | \includegraphics[width=43pt]{classchmat__inherit__graph} |
---|
[37] | 13 | \end{center} |
---|
| 14 | \end{figure} |
---|
| 15 | Collaboration diagram for chmat:\nopagebreak |
---|
| 16 | \begin{figure}[H] |
---|
| 17 | \begin{center} |
---|
| 18 | \leavevmode |
---|
[91] | 19 | \includegraphics[width=43pt]{classchmat__coll__graph} |
---|
[37] | 20 | \end{center} |
---|
| 21 | \end{figure} |
---|
| 22 | \subsection*{Public Member Functions} |
---|
| 23 | \begin{CompactItemize} |
---|
| 24 | \item |
---|
[79] | 25 | void {\bf opupdt} (const vec \&v, double w) |
---|
[37] | 26 | \item |
---|
[79] | 27 | mat {\bf to\_\-mat} ()\label{classchmat_a37e2c726e4fc3ad50b26ac2ca6c1452} |
---|
[37] | 28 | |
---|
| 29 | \begin{CompactList}\small\item\em Conversion to full matrix. \item\end{CompactList}\item |
---|
[79] | 30 | void {\bf mult\_\-sym} (const mat \&C) |
---|
| 31 | \begin{CompactList}\small\item\em Inplace symmetric multiplication by a SQUARE matrix $C$, i.e. $V = C*V*C'$. \item\end{CompactList}\item |
---|
| 32 | void \textbf{mult\_\-sym} (const mat \&C, {\bf chmat} \&U) const \label{classchmat_d558ab63475a2f2ebc0c0e149796dcc6} |
---|
[37] | 33 | |
---|
[79] | 34 | \item |
---|
| 35 | void {\bf mult\_\-sym\_\-t} (const mat \&C) |
---|
| 36 | \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 |
---|
| 37 | void \textbf{mult\_\-sym\_\-t} (const mat \&C, {\bf chmat} \&U) const \label{classchmat_31c3b985214a150b2a6b4be3b0fd40e3} |
---|
| 38 | |
---|
| 39 | \item |
---|
| 40 | double {\bf logdet} () const \label{classchmat_b504ca818203b13e667cb3c503980382} |
---|
| 41 | |
---|
[37] | 42 | \begin{CompactList}\small\item\em Logarithm of a determinant. \item\end{CompactList}\item |
---|
[79] | 43 | vec {\bf sqrt\_\-mult} (const vec \&v) const |
---|
| 44 | \begin{CompactList}\small\item\em Multiplies square root of $V$ by vector $x$. \item\end{CompactList}\item |
---|
| 45 | double {\bf qform} (const vec \&v) const \label{classchmat_6807737c7ffdb7041256b51db7592248} |
---|
[37] | 46 | |
---|
[79] | 47 | \begin{CompactList}\small\item\em Evaluates quadratic form $x= v'*V*v$;. \item\end{CompactList}\item |
---|
| 48 | double {\bf invqform} (const vec \&v) const \label{classchmat_b49427cff186c62f5df3724e5d2c34b4} |
---|
[37] | 49 | |
---|
[79] | 50 | \begin{CompactList}\small\item\em Evaluates quadratic form $x= v'*inv(V)*v$;. \item\end{CompactList}\item |
---|
| 51 | void {\bf clear} ()\label{classchmat_d0a995d312ecc11d3b43693f5e224ba9} |
---|
| 52 | |
---|
[37] | 53 | \begin{CompactList}\small\item\em Clearing matrix so that it corresponds to zeros. \item\end{CompactList}\item |
---|
[79] | 54 | void \textbf{add} (const {\bf chmat} \&A2, double w=1.0)\label{classchmat_f3921e3e5e31337cdbda40a3a5467257} |
---|
[37] | 55 | |
---|
| 56 | \item |
---|
[79] | 57 | void {\bf inv} ({\bf chmat} \&Inv) const \label{classchmat_5ce4e21a9012a4e98c1f0ed1ca5669bd} |
---|
[37] | 58 | |
---|
[79] | 59 | \begin{CompactList}\small\item\em Inversion in the same form, i.e. cholesky. \item\end{CompactList}\item |
---|
[37] | 60 | virtual {\bf $\sim$chmat} ()\label{classchmat_ba62fbf7cb8e065a4f3d24457824e89b} |
---|
| 61 | |
---|
| 62 | \begin{CompactList}\small\item\em Destructor for future use;. \item\end{CompactList}\item |
---|
| 63 | {\bf chmat} (const int dim0)\label{classchmat_fdd73b0c596161637fd25bdf2c670c39} |
---|
| 64 | |
---|
| 65 | \begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item |
---|
[79] | 66 | {\bf chmat} (const vec \&v)\label{classchmat_d4f0a94e81279295e60e72812130f9d4} |
---|
| 67 | |
---|
| 68 | \begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item |
---|
| 69 | {\bf chmat} (const {\bf chmat} \&Ch0)\label{classchmat_d92f3bd9a727b8c88a8c7385feb3449a} |
---|
| 70 | |
---|
| 71 | \begin{CompactList}\small\item\em Copy constructor. \item\end{CompactList}\item |
---|
[37] | 72 | {\bf chmat} (const mat \&M)\label{classchmat_8334a00f30f0a05f893c2aeec395ef10} |
---|
| 73 | |
---|
| 74 | \begin{CompactList}\small\item\em Default constructor (m3k:cholform). \item\end{CompactList}\item |
---|
| 75 | mat \& {\bf \_\-Ch} ()\label{classchmat_9c50d31c999d85d8e9d8cf2b69b6ac8c} |
---|
| 76 | |
---|
| 77 | \begin{CompactList}\small\item\em Access function. \item\end{CompactList}\item |
---|
[79] | 78 | void {\bf setD} (const vec \&nD)\label{classchmat_a4fc7f9b0539b97c414442a22f3db6e8} |
---|
| 79 | |
---|
| 80 | \begin{CompactList}\small\item\em Access functions. \item\end{CompactList}\item |
---|
| 81 | void {\bf setD} (const vec \&nD, int i)\label{classchmat_4b9271097d8317d9514c5d0d62cccb39} |
---|
| 82 | |
---|
| 83 | \begin{CompactList}\small\item\em Access functions. \item\end{CompactList}\item |
---|
| 84 | {\bf chmat} \& {\bf operator+=} (const {\bf chmat} \&A2) |
---|
| 85 | \begin{CompactList}\small\item\em Operators. \item\end{CompactList}\item |
---|
| 86 | {\bf chmat} \& {\bf operator-=} (const {\bf chmat} \&A2)\label{classchmat_a8c3628a8c15eb0009e57c66fcac1a76} |
---|
| 87 | |
---|
| 88 | \begin{CompactList}\small\item\em mapping of negative add operation to operators \item\end{CompactList}\item |
---|
[37] | 89 | int {\bf cols} () const \label{classsqmat_ecc2e2540f95a04f4449842588170f5b} |
---|
| 90 | |
---|
| 91 | \begin{CompactList}\small\item\em Reimplementing common functions of mat: \doxyref{cols()}{p.}{classsqmat_ecc2e2540f95a04f4449842588170f5b}. \item\end{CompactList}\item |
---|
| 92 | int {\bf rows} () const \label{classsqmat_071e80ced9cc3b8cbb360fa7462eb646} |
---|
| 93 | |
---|
| 94 | \begin{CompactList}\small\item\em Reimplementing common functions of mat: \doxyref{cols()}{p.}{classsqmat_ecc2e2540f95a04f4449842588170f5b}. \item\end{CompactList}\end{CompactItemize} |
---|
| 95 | \subsection*{Protected Attributes} |
---|
| 96 | \begin{CompactItemize} |
---|
| 97 | \item |
---|
| 98 | mat {\bf Ch}\label{classchmat_95158bb150f5e7f939168abcd577fd9c} |
---|
| 99 | |
---|
[79] | 100 | \begin{CompactList}\small\item\em Upper triangle of the cholesky matrix. \item\end{CompactList}\item |
---|
[37] | 101 | int {\bf dim}\label{classsqmat_0abed904bdc0882373ba9adba919689d} |
---|
| 102 | |
---|
| 103 | \begin{CompactList}\small\item\em dimension of the square matrix \item\end{CompactList}\end{CompactItemize} |
---|
| 104 | |
---|
| 105 | |
---|
| 106 | \subsection{Detailed Description} |
---|
| 107 | Symmetric matrix stored in square root decomposition using upper cholesky. |
---|
| 108 | |
---|
[79] | 109 | This matrix represent $A=Ch' Ch$ where only the upper triangle $Ch$ is stored; |
---|
[37] | 110 | |
---|
| 111 | \subsection{Member Function Documentation} |
---|
| 112 | \index{chmat@{chmat}!opupdt@{opupdt}} |
---|
| 113 | \index{opupdt@{opupdt}!chmat@{chmat}} |
---|
[91] | 114 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void chmat::opupdt (const vec \& {\em v}, \/ double {\em w})\hspace{0.3cm}{\tt [virtual]}}\label{classchmat_bbc2d98d7455b1f38828907d442836bf} |
---|
[37] | 115 | |
---|
| 116 | |
---|
[79] | 117 | Perfroms a rank-1 update by outer product of vectors: $V = V + w v v'$. \begin{Desc} |
---|
[37] | 118 | \item[Parameters:] |
---|
| 119 | \begin{description} |
---|
| 120 | \item[{\em v}]Vector forming the outer product to be added \item[{\em w}]weight of updating; can be negative\end{description} |
---|
| 121 | \end{Desc} |
---|
| 122 | BLAS-2b operation. |
---|
| 123 | |
---|
[91] | 124 | Implements {\bf sqmat} \doxyref{}{p.}{classsqmat_b223484796661f2dadb5607a86ce0581}. |
---|
| 125 | |
---|
| 126 | References Ch.\index{chmat@{chmat}!mult\_\-sym@{mult\_\-sym}} |
---|
| 127 | \index{mult\_\-sym@{mult\_\-sym}!chmat@{chmat}} |
---|
[37] | 128 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void chmat::mult\_\-sym (const mat \& {\em C})\hspace{0.3cm}{\tt [virtual]}}\label{classchmat_66f509f92b0ccf020e2a2a32566e0777} |
---|
| 129 | |
---|
| 130 | |
---|
[79] | 131 | Inplace symmetric multiplication by a SQUARE matrix $C$, i.e. $V = C*V*C'$. |
---|
[37] | 132 | |
---|
| 133 | \begin{Desc} |
---|
| 134 | \item[Parameters:] |
---|
| 135 | \begin{description} |
---|
| 136 | \item[{\em C}]multiplying matrix, \end{description} |
---|
| 137 | \end{Desc} |
---|
| 138 | |
---|
| 139 | |
---|
[91] | 140 | Implements {\bf sqmat} \doxyref{}{p.}{classsqmat_60fbbfa9e483b8187c135f787ee53afa}.\index{chmat@{chmat}!mult\_\-sym\_\-t@{mult\_\-sym\_\-t}} |
---|
| 141 | \index{mult\_\-sym\_\-t@{mult\_\-sym\_\-t}!chmat@{chmat}} |
---|
[37] | 142 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void chmat::mult\_\-sym\_\-t (const mat \& {\em C})\hspace{0.3cm}{\tt [virtual]}}\label{classchmat_07f50d1332b901eee962e8b1913102f7} |
---|
| 143 | |
---|
| 144 | |
---|
[79] | 145 | Inplace symmetric multiplication by a SQUARE transpose of matrix $C$, i.e. $V = C'*V*C$. |
---|
[37] | 146 | |
---|
| 147 | \begin{Desc} |
---|
| 148 | \item[Parameters:] |
---|
| 149 | \begin{description} |
---|
| 150 | \item[{\em C}]multiplying matrix, \end{description} |
---|
| 151 | \end{Desc} |
---|
| 152 | |
---|
| 153 | |
---|
[91] | 154 | Implements {\bf sqmat} \doxyref{}{p.}{classsqmat_6909e906da17725b1b80f3cae7cf3325}.\index{chmat@{chmat}!sqrt\_\-mult@{sqrt\_\-mult}} |
---|
| 155 | \index{sqrt\_\-mult@{sqrt\_\-mult}!chmat@{chmat}} |
---|
[37] | 156 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}vec chmat::sqrt\_\-mult (const vec \& {\em v}) const\hspace{0.3cm}{\tt [inline, virtual]}}\label{classchmat_b22aa239dbaca33e3fb93b4f674d7051} |
---|
| 157 | |
---|
| 158 | |
---|
[79] | 159 | Multiplies square root of $V$ by vector $x$. |
---|
[37] | 160 | |
---|
| 161 | Used e.g. in generating normal samples. |
---|
| 162 | |
---|
[91] | 163 | Implements {\bf sqmat} \doxyref{}{p.}{classsqmat_6b79438b5d7544a9c8e110a145355d8f}. |
---|
| 164 | |
---|
| 165 | References Ch.\index{chmat@{chmat}!operator+=@{operator+=}} |
---|
[79] | 166 | \index{operator+=@{operator+=}!chmat@{chmat}} |
---|
| 167 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf chmat} \& chmat::operator+= (const {\bf chmat} \& {\em A2})\hspace{0.3cm}{\tt [inline]}}\label{classchmat_6a8b39fe3a28d2c8e3fc0d74141229fb} |
---|
[37] | 168 | |
---|
[79] | 169 | |
---|
| 170 | Operators. |
---|
| 171 | |
---|
| 172 | Operations: mapping of add operation to operators |
---|
| 173 | |
---|
[37] | 174 | The documentation for this class was generated from the following files:\begin{CompactItemize} |
---|
| 175 | \item |
---|
| 176 | work/mixpp/bdm/math/{\bf chmat.h}\item |
---|
| 177 | work/mixpp/bdm/math/chmat.cpp\end{CompactItemize} |
---|