root/doc/latex/classchmat.tex @ 271

Revision 271, 12.0 kB (checked in by smidl, 16 years ago)

Next major revision

  • Property svn:eol-style set to native
RevLine 
[172]1\hypertarget{classchmat}{
[37]2\section{chmat Class Reference}
3\label{classchmat}\index{chmat@{chmat}}
[172]4}
[37]5{\tt \#include $<$chmat.h$>$}
6
[271]7Inheritance diagram for chmat::\begin{figure}[H]
[37]8\begin{center}
9\leavevmode
[271]10\includegraphics[height=2cm]{classchmat}
[37]11\end{center}
12\end{figure}
[270]13
14
15\subsection{Detailed Description}
16Symmetric matrix stored in square root decomposition using upper cholesky.
17
18This matrix represent $A=Ch' Ch$ where only the upper triangle $Ch$ is stored; \subsection*{Public Member Functions}
[37]19\begin{CompactItemize}
20\item 
[172]21void \hyperlink{classchmat_bbc2d98d7455b1f38828907d442836bf}{opupdt} (const vec \&v, double w)
[37]22\item 
[172]23\hypertarget{classchmat_045addd685f8d978efda232d7dcb070e}{
24mat \hyperlink{classchmat_045addd685f8d978efda232d7dcb070e}{to\_\-mat} () const }
25\label{classchmat_045addd685f8d978efda232d7dcb070e}
[37]26
27\begin{CompactList}\small\item\em Conversion to full matrix. \item\end{CompactList}\item 
[172]28void \hyperlink{classchmat_66f509f92b0ccf020e2a2a32566e0777}{mult\_\-sym} (const mat \&C)
[79]29\begin{CompactList}\small\item\em Inplace symmetric multiplication by a SQUARE matrix $C$, i.e. $V = C*V*C'$. \item\end{CompactList}\item 
[172]30\hypertarget{classchmat_d558ab63475a2f2ebc0c0e149796dcc6}{
31void \textbf{mult\_\-sym} (const mat \&C, \hyperlink{classchmat}{chmat} \&U) const }
32\label{classchmat_d558ab63475a2f2ebc0c0e149796dcc6}
[37]33
[79]34\item 
[172]35void \hyperlink{classchmat_07f50d1332b901eee962e8b1913102f7}{mult\_\-sym\_\-t} (const mat \&C)
[79]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 
[172]37\hypertarget{classchmat_31c3b985214a150b2a6b4be3b0fd40e3}{
38void \textbf{mult\_\-sym\_\-t} (const mat \&C, \hyperlink{classchmat}{chmat} \&U) const }
39\label{classchmat_31c3b985214a150b2a6b4be3b0fd40e3}
[79]40
41\item 
[172]42\hypertarget{classchmat_b504ca818203b13e667cb3c503980382}{
43double \hyperlink{classchmat_b504ca818203b13e667cb3c503980382}{logdet} () const }
44\label{classchmat_b504ca818203b13e667cb3c503980382}
[79]45
[37]46\begin{CompactList}\small\item\em Logarithm of a determinant. \item\end{CompactList}\item 
[172]47vec \hyperlink{classchmat_b22aa239dbaca33e3fb93b4f674d7051}{sqrt\_\-mult} (const vec \&v) const
[79]48\begin{CompactList}\small\item\em Multiplies square root of $V$ by vector $x$. \item\end{CompactList}\item 
[172]49\hypertarget{classchmat_6807737c7ffdb7041256b51db7592248}{
50double \hyperlink{classchmat_6807737c7ffdb7041256b51db7592248}{qform} (const vec \&v) const }
51\label{classchmat_6807737c7ffdb7041256b51db7592248}
[37]52
[79]53\begin{CompactList}\small\item\em Evaluates quadratic form $x= v'*V*v$;. \item\end{CompactList}\item 
[172]54\hypertarget{classchmat_b49427cff186c62f5df3724e5d2c34b4}{
55double \hyperlink{classchmat_b49427cff186c62f5df3724e5d2c34b4}{invqform} (const vec \&v) const }
56\label{classchmat_b49427cff186c62f5df3724e5d2c34b4}
[37]57
[79]58\begin{CompactList}\small\item\em Evaluates quadratic form $x= v'*inv(V)*v$;. \item\end{CompactList}\item 
[172]59\hypertarget{classchmat_d0a995d312ecc11d3b43693f5e224ba9}{
60void \hyperlink{classchmat_d0a995d312ecc11d3b43693f5e224ba9}{clear} ()}
61\label{classchmat_d0a995d312ecc11d3b43693f5e224ba9}
[79]62
[37]63\begin{CompactList}\small\item\em Clearing matrix so that it corresponds to zeros. \item\end{CompactList}\item 
[172]64\hypertarget{classchmat_f3921e3e5e31337cdbda40a3a5467257}{
65void \hyperlink{classchmat_f3921e3e5e31337cdbda40a3a5467257}{add} (const \hyperlink{classchmat}{chmat} \&A2, double w=1.0)}
66\label{classchmat_f3921e3e5e31337cdbda40a3a5467257}
[37]67
[172]68\begin{CompactList}\small\item\em add another \hyperlink{classchmat}{chmat} {\tt A2} with weight {\tt w}. \item\end{CompactList}\item 
69\hypertarget{classchmat_5ce4e21a9012a4e98c1f0ed1ca5669bd}{
70void \hyperlink{classchmat_5ce4e21a9012a4e98c1f0ed1ca5669bd}{inv} (\hyperlink{classchmat}{chmat} \&Inv) const }
71\label{classchmat_5ce4e21a9012a4e98c1f0ed1ca5669bd}
[37]72
[79]73\begin{CompactList}\small\item\em Inversion in the same form, i.e. cholesky. \item\end{CompactList}\item 
[172]74\hypertarget{classchmat_ba62fbf7cb8e065a4f3d24457824e89b}{
75virtual \hyperlink{classchmat_ba62fbf7cb8e065a4f3d24457824e89b}{$\sim$chmat} ()}
76\label{classchmat_ba62fbf7cb8e065a4f3d24457824e89b}
[37]77
78\begin{CompactList}\small\item\em Destructor for future use;. \item\end{CompactList}\item 
[172]79\hypertarget{classchmat_fdd73b0c596161637fd25bdf2c670c39}{
80\hyperlink{classchmat_fdd73b0c596161637fd25bdf2c670c39}{chmat} (const int dim0)}
81\label{classchmat_fdd73b0c596161637fd25bdf2c670c39}
[37]82
83\begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item 
[172]84\hypertarget{classchmat_d4f0a94e81279295e60e72812130f9d4}{
85\hyperlink{classchmat_d4f0a94e81279295e60e72812130f9d4}{chmat} (const vec \&v)}
86\label{classchmat_d4f0a94e81279295e60e72812130f9d4}
[79]87
88\begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item 
[172]89\hypertarget{classchmat_d92f3bd9a727b8c88a8c7385feb3449a}{
90\hyperlink{classchmat_d92f3bd9a727b8c88a8c7385feb3449a}{chmat} (const \hyperlink{classchmat}{chmat} \&Ch0)}
91\label{classchmat_d92f3bd9a727b8c88a8c7385feb3449a}
[79]92
93\begin{CompactList}\small\item\em Copy constructor. \item\end{CompactList}\item 
[172]94\hypertarget{classchmat_8334a00f30f0a05f893c2aeec395ef10}{
95\hyperlink{classchmat_8334a00f30f0a05f893c2aeec395ef10}{chmat} (const mat \&M)}
96\label{classchmat_8334a00f30f0a05f893c2aeec395ef10}
[37]97
98\begin{CompactList}\small\item\em Default constructor (m3k:cholform). \item\end{CompactList}\item 
[210]99\hypertarget{classchmat_24de7f42e0a86bb270588cd0dd9d60b4}{
100\hyperlink{classchmat_24de7f42e0a86bb270588cd0dd9d60b4}{chmat} (const \hyperlink{classchmat}{chmat} \&M, const ivec \&perm)}
101\label{classchmat_24de7f42e0a86bb270588cd0dd9d60b4}
102
103\begin{CompactList}\small\item\em Constructor. \item\end{CompactList}\item 
[172]104\hypertarget{classchmat_9c50d31c999d85d8e9d8cf2b69b6ac8c}{
105mat \& \hyperlink{classchmat_9c50d31c999d85d8e9d8cf2b69b6ac8c}{\_\-Ch} ()}
106\label{classchmat_9c50d31c999d85d8e9d8cf2b69b6ac8c}
[37]107
108\begin{CompactList}\small\item\em Access function. \item\end{CompactList}\item 
[172]109\hypertarget{classchmat_a4fc7f9b0539b97c414442a22f3db6e8}{
110void \hyperlink{classchmat_a4fc7f9b0539b97c414442a22f3db6e8}{setD} (const vec \&nD)}
111\label{classchmat_a4fc7f9b0539b97c414442a22f3db6e8}
[79]112
113\begin{CompactList}\small\item\em Access functions. \item\end{CompactList}\item 
[172]114\hypertarget{classchmat_4b9271097d8317d9514c5d0d62cccb39}{
115void \hyperlink{classchmat_4b9271097d8317d9514c5d0d62cccb39}{setD} (const vec \&nD, int i)}
116\label{classchmat_4b9271097d8317d9514c5d0d62cccb39}
[79]117
118\begin{CompactList}\small\item\em Access functions. \item\end{CompactList}\item 
[172]119\hyperlink{classchmat}{chmat} \& \hyperlink{classchmat_6a8b39fe3a28d2c8e3fc0d74141229fb}{operator+=} (const \hyperlink{classchmat}{chmat} \&A2)
[79]120\begin{CompactList}\small\item\em Operators. \item\end{CompactList}\item 
[172]121\hypertarget{classchmat_a8c3628a8c15eb0009e57c66fcac1a76}{
122\hyperlink{classchmat}{chmat} \& \hyperlink{classchmat_a8c3628a8c15eb0009e57c66fcac1a76}{operator-=} (const \hyperlink{classchmat}{chmat} \&A2)}
123\label{classchmat_a8c3628a8c15eb0009e57c66fcac1a76}
[79]124
125\begin{CompactList}\small\item\em mapping of negative add operation to operators \item\end{CompactList}\item 
[234]126\hypertarget{classchmat_64f1eec40946d3abad7762899c9f933a}{
127\hyperlink{classchmat}{chmat} \& \textbf{operator$\ast$} (const \hyperlink{classchmat}{chmat} \&A2)}
128\label{classchmat_64f1eec40946d3abad7762899c9f933a}
129
130\item 
131\hypertarget{classchmat_e0404bcb998f0b82d25f5fc386cc4fa5}{
132\hyperlink{classchmat}{chmat} \& \textbf{operator$\ast$} (const double \&d)}
133\label{classchmat_e0404bcb998f0b82d25f5fc386cc4fa5}
134
135\item 
136\hypertarget{classchmat_cdb54c921d7b93ac1a04d58cae7a9618}{
137\hyperlink{classchmat}{chmat} \& \textbf{operator=} (const \hyperlink{classchmat}{chmat} \&A2)}
138\label{classchmat_cdb54c921d7b93ac1a04d58cae7a9618}
139
140\item 
[172]141\hypertarget{classsqmat_ecc2e2540f95a04f4449842588170f5b}{
142int \hyperlink{classsqmat_ecc2e2540f95a04f4449842588170f5b}{cols} () const }
143\label{classsqmat_ecc2e2540f95a04f4449842588170f5b}
[37]144
[172]145\begin{CompactList}\small\item\em Reimplementing common functions of mat: \hyperlink{classsqmat_ecc2e2540f95a04f4449842588170f5b}{cols()}. \item\end{CompactList}\item 
146\hypertarget{classsqmat_071e80ced9cc3b8cbb360fa7462eb646}{
147int \hyperlink{classsqmat_071e80ced9cc3b8cbb360fa7462eb646}{rows} () const }
148\label{classsqmat_071e80ced9cc3b8cbb360fa7462eb646}
[37]149
[172]150\begin{CompactList}\small\item\em Reimplementing common functions of mat: \hyperlink{classsqmat_ecc2e2540f95a04f4449842588170f5b}{cols()}. \item\end{CompactList}\end{CompactItemize}
[37]151\subsection*{Protected Attributes}
152\begin{CompactItemize}
153\item 
[172]154\hypertarget{classchmat_95158bb150f5e7f939168abcd577fd9c}{
155mat \hyperlink{classchmat_95158bb150f5e7f939168abcd577fd9c}{Ch}}
156\label{classchmat_95158bb150f5e7f939168abcd577fd9c}
[37]157
[79]158\begin{CompactList}\small\item\em Upper triangle of the cholesky matrix. \item\end{CompactList}\item 
[172]159\hypertarget{classsqmat_0abed904bdc0882373ba9adba919689d}{
160int \hyperlink{classsqmat_0abed904bdc0882373ba9adba919689d}{dim}}
161\label{classsqmat_0abed904bdc0882373ba9adba919689d}
[37]162
163\begin{CompactList}\small\item\em dimension of the square matrix \item\end{CompactList}\end{CompactItemize}
164
165
166\subsection{Member Function Documentation}
[172]167\hypertarget{classchmat_bbc2d98d7455b1f38828907d442836bf}{
[37]168\index{chmat@{chmat}!opupdt@{opupdt}}
169\index{opupdt@{opupdt}!chmat@{chmat}}
[172]170\subsubsection[opupdt]{\setlength{\rightskip}{0pt plus 5cm}void chmat::opupdt (const vec \& {\em v}, \/  double {\em w})\hspace{0.3cm}{\tt  \mbox{[}virtual\mbox{]}}}}
171\label{classchmat_bbc2d98d7455b1f38828907d442836bf}
[37]172
173
[79]174Perfroms a rank-1 update by outer product of vectors: $V = V + w v v'$. \begin{Desc}
[37]175\item[Parameters:]
176\begin{description}
177\item[{\em v}]Vector forming the outer product to be added \item[{\em w}]weight of updating; can be negative\end{description}
178\end{Desc}
179BLAS-2b operation.
180
[172]181Implements \hyperlink{classsqmat_b223484796661f2dadb5607a86ce0581}{sqmat}.
[91]182
[172]183References Ch.\hypertarget{classchmat_66f509f92b0ccf020e2a2a32566e0777}{
184\index{chmat@{chmat}!mult\_\-sym@{mult\_\-sym}}
[91]185\index{mult\_\-sym@{mult\_\-sym}!chmat@{chmat}}
[172]186\subsubsection[mult\_\-sym]{\setlength{\rightskip}{0pt plus 5cm}void chmat::mult\_\-sym (const mat \& {\em C})\hspace{0.3cm}{\tt  \mbox{[}virtual\mbox{]}}}}
187\label{classchmat_66f509f92b0ccf020e2a2a32566e0777}
[37]188
189
[79]190Inplace symmetric multiplication by a SQUARE matrix $C$, i.e. $V = C*V*C'$.
[37]191
192\begin{Desc}
193\item[Parameters:]
194\begin{description}
195\item[{\em C}]multiplying matrix, \end{description}
196\end{Desc}
197
198
[172]199Implements \hyperlink{classsqmat_60fbbfa9e483b8187c135f787ee53afa}{sqmat}.\hypertarget{classchmat_07f50d1332b901eee962e8b1913102f7}{
200\index{chmat@{chmat}!mult\_\-sym\_\-t@{mult\_\-sym\_\-t}}
[91]201\index{mult\_\-sym\_\-t@{mult\_\-sym\_\-t}!chmat@{chmat}}
[172]202\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{]}}}}
203\label{classchmat_07f50d1332b901eee962e8b1913102f7}
[37]204
205
[79]206Inplace symmetric multiplication by a SQUARE transpose of matrix $C$, i.e. $V = C'*V*C$.
[37]207
208\begin{Desc}
209\item[Parameters:]
210\begin{description}
211\item[{\em C}]multiplying matrix, \end{description}
212\end{Desc}
213
214
[172]215Implements \hyperlink{classsqmat_6909e906da17725b1b80f3cae7cf3325}{sqmat}.\hypertarget{classchmat_b22aa239dbaca33e3fb93b4f674d7051}{
216\index{chmat@{chmat}!sqrt\_\-mult@{sqrt\_\-mult}}
[91]217\index{sqrt\_\-mult@{sqrt\_\-mult}!chmat@{chmat}}
[172]218\subsubsection[sqrt\_\-mult]{\setlength{\rightskip}{0pt plus 5cm}vec chmat::sqrt\_\-mult (const vec \& {\em v}) const\hspace{0.3cm}{\tt  \mbox{[}virtual\mbox{]}}}}
219\label{classchmat_b22aa239dbaca33e3fb93b4f674d7051}
[37]220
221
[79]222Multiplies square root of $V$ by vector $x$.
[37]223
224Used e.g. in generating normal samples.
225
[172]226Implements \hyperlink{classsqmat_6b79438b5d7544a9c8e110a145355d8f}{sqmat}.
[91]227
[172]228References Ch.\hypertarget{classchmat_6a8b39fe3a28d2c8e3fc0d74141229fb}{
229\index{chmat@{chmat}!operator+=@{operator+=}}
[79]230\index{operator+=@{operator+=}!chmat@{chmat}}
[172]231\subsubsection[operator+=]{\setlength{\rightskip}{0pt plus 5cm}{\bf chmat} \& chmat::operator+= (const {\bf chmat} \& {\em A2})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
232\label{classchmat_6a8b39fe3a28d2c8e3fc0d74141229fb}
[37]233
[79]234
235Operators.
236
237Operations: mapping of add operation to operators
238
[37]239The documentation for this class was generated from the following files:\begin{CompactItemize}
240\item 
[261]241\hyperlink{chmat_8h}{chmat.h}\item 
242chmat.cpp\end{CompactItemize}
Note: See TracBrowser for help on using the browser.