Show
Ignore:
Timestamp:
02/09/09 23:08:46 (16 years ago)
Author:
smidl
Message:

doc

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • doc/html/chmat_8h-source.html

    r255 r261  
    11<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    22<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
    3 <title>mixpp: work/git/mixpp/bdm/math/chmat.h Source File</title> 
     3<title>mixpp: chmat.h Source File</title> 
    44<link href="doxygen.css" rel="stylesheet" type="text/css"> 
    55<link href="tabs.css" rel="stylesheet" type="text/css"> 
     
    1212      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li> 
    1313      <li><a href="modules.html"><span>Modules</span></a></li> 
    14       <li><a href="annotated.html"><span>Classes</span></a></li> 
     14      <li><a href="namespaces.html"><span>Namespaces</span></a></li> 
     15      <li><a href="classes.html"><span>Classes</span></a></li> 
    1516      <li class="current"><a href="files.html"><span>Files</span></a></li> 
    1617    </ul> 
    1718  </div> 
    18 <h1>work/git/mixpp/bdm/math/chmat.h</h1><a href="chmat_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001  
     19<h1>chmat.h</h1><a href="chmat_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001  
    1920<a name="l00013"></a>00013 <span class="preprocessor">#ifndef CHMAT_H</span> 
    2021<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define CHMAT_H</span> 
    2122<a name="l00015"></a>00015 <span class="preprocessor"></span> 
    22 <a name="l00016"></a>00016 <span class="preprocessor">#include &lt;itpp/itbase.h&gt;</span> 
     23<a name="l00016"></a>00016  
    2324<a name="l00017"></a>00017 <span class="preprocessor">#include "<a class="code" href="libDC_8h.html" title="Matrices in decomposed forms (LDL&amp;#39;, LU, UDU&amp;#39;, etc).">libDC.h</a>"</span> 
    24 <a name="l00018"></a>00018 <span class="preprocessor">#include "../itpp_ext.h"</span> 
    25 <a name="l00019"></a>00019  
    26 <a name="l00025"></a><a class="code" href="classchmat.html">00025</a> <span class="keyword">class </span><a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> : <span class="keyword">public</span> <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> { 
    27 <a name="l00026"></a>00026 <span class="keyword">protected</span>: 
    28 <a name="l00028"></a><a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c">00028</a>         mat <a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>; 
    29 <a name="l00029"></a>00029 <span class="keyword">public</span>: 
    30 <a name="l00030"></a>00030  
    31 <a name="l00031"></a>00031         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#bbc2d98d7455b1f38828907d442836bf">opupdt</a> ( <span class="keyword">const</span> vec &amp;v, <span class="keywordtype">double</span> w ); 
    32 <a name="l00032"></a>00032         mat <a class="code" href="classchmat.html#045addd685f8d978efda232d7dcb070e" title="Conversion to full matrix.">to_mat</a>() <span class="keyword">const</span>; 
    33 <a name="l00033"></a>00033         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#66f509f92b0ccf020e2a2a32566e0777" title="Inplace symmetric multiplication by a SQUARE matrix , i.e. .">mult_sym</a> ( <span class="keyword">const</span> mat &amp;C ); 
    34 <a name="l00034"></a>00034         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#66f509f92b0ccf020e2a2a32566e0777" title="Inplace symmetric multiplication by a SQUARE matrix , i.e. .">mult_sym</a> ( <span class="keyword">const</span> mat &amp;C , <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;U ) <span class="keyword">const</span>; 
    35 <a name="l00035"></a>00035         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#07f50d1332b901eee962e8b1913102f7" title="Inplace symmetric multiplication by a SQUARE transpose of matrix , i.e. .">mult_sym_t</a> ( <span class="keyword">const</span> mat &amp;C ); 
    36 <a name="l00036"></a>00036         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#07f50d1332b901eee962e8b1913102f7" title="Inplace symmetric multiplication by a SQUARE transpose of matrix , i.e. .">mult_sym_t</a> ( <span class="keyword">const</span> mat &amp;C, <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;U ) <span class="keyword">const</span>; 
    37 <a name="l00037"></a>00037         <span class="keywordtype">double</span> <a class="code" href="classchmat.html#b504ca818203b13e667cb3c503980382" title="Logarithm of a determinant.">logdet</a>() <span class="keyword">const</span>; 
    38 <a name="l00038"></a>00038         vec <a class="code" href="classchmat.html#b22aa239dbaca33e3fb93b4f674d7051" title="Multiplies square root of  by vector .">sqrt_mult</a> ( <span class="keyword">const</span> vec &amp;v ) <span class="keyword">const</span>; 
    39 <a name="l00039"></a>00039         <span class="keywordtype">double</span> <a class="code" href="classchmat.html#6807737c7ffdb7041256b51db7592248" title="Evaluates quadratic form ;.">qform</a> ( <span class="keyword">const</span> vec &amp;v ) <span class="keyword">const</span>; 
    40 <a name="l00040"></a>00040         <span class="keywordtype">double</span> <a class="code" href="classchmat.html#b49427cff186c62f5df3724e5d2c34b4" title="Evaluates quadratic form ;.">invqform</a> ( <span class="keyword">const</span> vec &amp;v ) <span class="keyword">const</span>; 
    41 <a name="l00041"></a>00041         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#d0a995d312ecc11d3b43693f5e224ba9" title="Clearing matrix so that it corresponds to zeros.">clear</a>(); 
    42 <a name="l00043"></a><a class="code" href="classchmat.html#f3921e3e5e31337cdbda40a3a5467257">00043</a>         <span class="keywordtype">void</span> <span class="keyword">add</span> ( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;A2, <span class="keywordtype">double</span> w=1.0 ) {}; 
    43 <a name="l00045"></a><a class="code" href="classchmat.html#5ce4e21a9012a4e98c1f0ed1ca5669bd">00045</a>         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#5ce4e21a9012a4e98c1f0ed1ca5669bd" title="Inversion in the same form, i.e. cholesky.">inv</a> ( <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;Inv )<span class="keyword"> const   </span>{ ( Inv.<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ) = itpp::inv ( <a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ).T();}; <span class="comment">//Fixme: can be more efficient</span> 
    44 <a name="l00046"></a>00046         ; 
    45 <a name="l00047"></a>00047 <span class="comment">//      void inv ( mat &amp;Inv );</span> 
    46 <a name="l00048"></a>00048  
    47 <a name="l00050"></a><a class="code" href="classchmat.html#ba62fbf7cb8e065a4f3d24457824e89b">00050</a>         <span class="keyword">virtual</span> <a class="code" href="classchmat.html#ba62fbf7cb8e065a4f3d24457824e89b" title="Destructor for future use;.">~chmat</a>() {}; 
    48 <a name="l00052"></a><a class="code" href="classchmat.html#fdd73b0c596161637fd25bdf2c670c39">00052</a>         <a class="code" href="classchmat.html#fdd73b0c596161637fd25bdf2c670c39" title="Default constructor.">chmat</a> ( <span class="keyword">const</span> <span class="keywordtype">int</span> dim0 ) : <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> ( dim0 ),<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ( dim0,dim0 ) {}; 
    49 <a name="l00054"></a><a class="code" href="classchmat.html#d4f0a94e81279295e60e72812130f9d4">00054</a>         <a class="code" href="classchmat.html#fdd73b0c596161637fd25bdf2c670c39" title="Default constructor.">chmat</a> ( <span class="keyword">const</span> vec &amp;v) : <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> ( v.length() ),<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ( diag(sqrt(v)) ) {}; 
    50 <a name="l00056"></a><a class="code" href="classchmat.html#d92f3bd9a727b8c88a8c7385feb3449a">00056</a>         <a class="code" href="classchmat.html#fdd73b0c596161637fd25bdf2c670c39" title="Default constructor.">chmat</a> ( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;Ch0) : <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> ( Ch0.<a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>),<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ( Ch0.<a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>,Ch0.<a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a> ) {<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>=Ch0.<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>;}; 
    51 <a name="l00058"></a><a class="code" href="classchmat.html#8334a00f30f0a05f893c2aeec395ef10">00058</a>         <a class="code" href="classchmat.html#fdd73b0c596161637fd25bdf2c670c39" title="Default constructor.">chmat</a> ( <span class="keyword">const</span> mat &amp;M ) : <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> ( M.<a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646" title="Reimplementing common functions of mat: cols().">rows</a>() ),<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ( M.<a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646" title="Reimplementing common functions of mat: cols().">rows</a>(),M.<a class="code" href="classsqmat.html#ecc2e2540f95a04f4449842588170f5b" title="Reimplementing common functions of mat: cols().">cols</a>() ) { 
    52 <a name="l00059"></a>00059                 mat Q; 
    53 <a name="l00060"></a>00060                 it_assert_debug ( M.rows() ==M.cols(),<span class="stringliteral">"chmat:: input matrix must be square!"</span> ); 
    54 <a name="l00061"></a>00061                 <a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>=chol ( M ); 
    55 <a name="l00062"></a>00062         }; 
    56 <a name="l00064"></a><a class="code" href="classchmat.html#24de7f42e0a86bb270588cd0dd9d60b4">00064</a>         <a class="code" href="classchmat.html#fdd73b0c596161637fd25bdf2c670c39" title="Default constructor.">chmat</a> ( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;M, <span class="keyword">const</span> ivec &amp;perm ):<a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a>(M.<a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646" title="Reimplementing common functions of mat: cols().">rows</a>()){it_error(<span class="stringliteral">"not implemneted"</span>);}; 
    57 <a name="l00066"></a><a class="code" href="classchmat.html#9c50d31c999d85d8e9d8cf2b69b6ac8c">00066</a>         mat &amp; <a class="code" href="classchmat.html#9c50d31c999d85d8e9d8cf2b69b6ac8c" title="Access function.">_Ch</a>() {<span class="keywordflow">return</span> <a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>;} 
    58 <a name="l00068"></a><a class="code" href="classchmat.html#a4fc7f9b0539b97c414442a22f3db6e8">00068</a>         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#a4fc7f9b0539b97c414442a22f3db6e8" title="Access functions.">setD</a> ( <span class="keyword">const</span> vec &amp;nD ) {<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>=diag ( sqrt(nD) );} 
    59 <a name="l00070"></a><a class="code" href="classchmat.html#4b9271097d8317d9514c5d0d62cccb39">00070</a>         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#a4fc7f9b0539b97c414442a22f3db6e8" title="Access functions.">setD</a> ( <span class="keyword">const</span> vec &amp;nD, <span class="keywordtype">int</span> i ) {<span class="keywordflow">for</span> ( <span class="keywordtype">int</span> j=i;j&lt;nD.length();j++ ) {<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>( j,j ) =sqrt(nD ( j-i ));}} <span class="comment">//Fixme can be more general</span> 
    60 <a name="l00071"></a>00071  
    61 <a name="l00073"></a>00073         <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; <a class="code" href="classchmat.html#6a8b39fe3a28d2c8e3fc0d74141229fb" title="Operators.">operator += </a>( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;A2 ); 
    62 <a name="l00074"></a>00074         <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; <a class="code" href="classchmat.html#a8c3628a8c15eb0009e57c66fcac1a76" title="mapping of negative add operation to operators">operator -= </a>( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;A2 ) ; 
    63 <a name="l00075"></a>00075         <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; operator * ( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;A2 ); 
    64 <a name="l00076"></a>00076         <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; operator * ( <span class="keyword">const</span> <span class="keywordtype">double</span> &amp;d ){<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>*d; <span class="keywordflow">return</span> *<span class="keyword">this</span>;}; 
    65 <a name="l00077"></a>00077         <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; operator = ( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;A2 ){<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>=A2.<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>;<a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>=A2.<a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>;<span class="keywordflow">return</span> *<span class="keyword">this</span>;} 
    66 <a name="l00078"></a>00078 }; 
     25<a name="l00018"></a>00018  
     26<a name="l00024"></a><a class="code" href="classchmat.html">00024</a> <span class="keyword">class </span><a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> : <span class="keyword">public</span> <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> { 
     27<a name="l00025"></a>00025 <span class="keyword">protected</span>: 
     28<a name="l00027"></a><a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c">00027</a>         mat <a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>; 
     29<a name="l00028"></a>00028 <span class="keyword">public</span>: 
     30<a name="l00029"></a>00029  
     31<a name="l00030"></a>00030         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#bbc2d98d7455b1f38828907d442836bf">opupdt</a> ( <span class="keyword">const</span> vec &amp;v, <span class="keywordtype">double</span> w ); 
     32<a name="l00031"></a>00031         mat <a class="code" href="classchmat.html#045addd685f8d978efda232d7dcb070e" title="Conversion to full matrix.">to_mat</a>() <span class="keyword">const</span>; 
     33<a name="l00032"></a>00032         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#66f509f92b0ccf020e2a2a32566e0777" title="Inplace symmetric multiplication by a SQUARE matrix , i.e. .">mult_sym</a> ( <span class="keyword">const</span> mat &amp;C ); 
     34<a name="l00033"></a>00033         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#66f509f92b0ccf020e2a2a32566e0777" title="Inplace symmetric multiplication by a SQUARE matrix , i.e. .">mult_sym</a> ( <span class="keyword">const</span> mat &amp;C , <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;U ) <span class="keyword">const</span>; 
     35<a name="l00034"></a>00034         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#07f50d1332b901eee962e8b1913102f7" title="Inplace symmetric multiplication by a SQUARE transpose of matrix , i.e. .">mult_sym_t</a> ( <span class="keyword">const</span> mat &amp;C ); 
     36<a name="l00035"></a>00035         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#07f50d1332b901eee962e8b1913102f7" title="Inplace symmetric multiplication by a SQUARE transpose of matrix , i.e. .">mult_sym_t</a> ( <span class="keyword">const</span> mat &amp;C, <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;U ) <span class="keyword">const</span>; 
     37<a name="l00036"></a>00036         <span class="keywordtype">double</span> <a class="code" href="classchmat.html#b504ca818203b13e667cb3c503980382" title="Logarithm of a determinant.">logdet</a>() <span class="keyword">const</span>; 
     38<a name="l00037"></a>00037         vec <a class="code" href="classchmat.html#b22aa239dbaca33e3fb93b4f674d7051" title="Multiplies square root of  by vector .">sqrt_mult</a> ( <span class="keyword">const</span> vec &amp;v ) <span class="keyword">const</span>; 
     39<a name="l00038"></a>00038         <span class="keywordtype">double</span> <a class="code" href="classchmat.html#6807737c7ffdb7041256b51db7592248" title="Evaluates quadratic form ;.">qform</a> ( <span class="keyword">const</span> vec &amp;v ) <span class="keyword">const</span>; 
     40<a name="l00039"></a>00039         <span class="keywordtype">double</span> <a class="code" href="classchmat.html#b49427cff186c62f5df3724e5d2c34b4" title="Evaluates quadratic form ;.">invqform</a> ( <span class="keyword">const</span> vec &amp;v ) <span class="keyword">const</span>; 
     41<a name="l00040"></a>00040         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#d0a995d312ecc11d3b43693f5e224ba9" title="Clearing matrix so that it corresponds to zeros.">clear</a>(); 
     42<a name="l00042"></a><a class="code" href="classchmat.html#f3921e3e5e31337cdbda40a3a5467257">00042</a>         <span class="keywordtype">void</span> <span class="keyword">add</span> ( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;A2, <span class="keywordtype">double</span> w=1.0 ) {}; 
     43<a name="l00044"></a><a class="code" href="classchmat.html#5ce4e21a9012a4e98c1f0ed1ca5669bd">00044</a>         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#5ce4e21a9012a4e98c1f0ed1ca5669bd" title="Inversion in the same form, i.e. cholesky.">inv</a> ( <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;Inv )<span class="keyword"> const   </span>{ ( Inv.<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ) = itpp::inv ( <a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ).T();}; <span class="comment">//Fixme: can be more efficient</span> 
     44<a name="l00045"></a>00045         ; 
     45<a name="l00046"></a>00046 <span class="comment">//      void inv ( mat &amp;Inv );</span> 
     46<a name="l00047"></a>00047  
     47<a name="l00049"></a><a class="code" href="classchmat.html#ba62fbf7cb8e065a4f3d24457824e89b">00049</a>         <span class="keyword">virtual</span> <a class="code" href="classchmat.html#ba62fbf7cb8e065a4f3d24457824e89b" title="Destructor for future use;.">~chmat</a>() {}; 
     48<a name="l00051"></a><a class="code" href="classchmat.html#fdd73b0c596161637fd25bdf2c670c39">00051</a>         <a class="code" href="classchmat.html#fdd73b0c596161637fd25bdf2c670c39" title="Default constructor.">chmat</a> ( <span class="keyword">const</span> <span class="keywordtype">int</span> dim0 ) : <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> ( dim0 ),<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ( dim0,dim0 ) {}; 
     49<a name="l00053"></a><a class="code" href="classchmat.html#d4f0a94e81279295e60e72812130f9d4">00053</a>         <a class="code" href="classchmat.html#fdd73b0c596161637fd25bdf2c670c39" title="Default constructor.">chmat</a> ( <span class="keyword">const</span> vec &amp;v) : <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> ( v.length() ),<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ( diag(sqrt(v)) ) {}; 
     50<a name="l00055"></a><a class="code" href="classchmat.html#d92f3bd9a727b8c88a8c7385feb3449a">00055</a>         <a class="code" href="classchmat.html#fdd73b0c596161637fd25bdf2c670c39" title="Default constructor.">chmat</a> ( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;Ch0) : <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> ( Ch0.<a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>),<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ( Ch0.<a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>,Ch0.<a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a> ) {<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>=Ch0.<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>;}; 
     51<a name="l00057"></a><a class="code" href="classchmat.html#8334a00f30f0a05f893c2aeec395ef10">00057</a>         <a class="code" href="classchmat.html#fdd73b0c596161637fd25bdf2c670c39" title="Default constructor.">chmat</a> ( <span class="keyword">const</span> mat &amp;M ) : <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> ( M.<a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646" title="Reimplementing common functions of mat: cols().">rows</a>() ),<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ( M.<a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646" title="Reimplementing common functions of mat: cols().">rows</a>(),M.<a class="code" href="classsqmat.html#ecc2e2540f95a04f4449842588170f5b" title="Reimplementing common functions of mat: cols().">cols</a>() ) { 
     52<a name="l00058"></a>00058                 mat Q; 
     53<a name="l00059"></a>00059                 it_assert_debug ( M.rows() ==M.cols(),<span class="stringliteral">"chmat:: input matrix must be square!"</span> ); 
     54<a name="l00060"></a>00060                 <a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>=chol ( M ); 
     55<a name="l00061"></a>00061         }; 
     56<a name="l00063"></a><a class="code" href="classchmat.html#24de7f42e0a86bb270588cd0dd9d60b4">00063</a>         <a class="code" href="classchmat.html#fdd73b0c596161637fd25bdf2c670c39" title="Default constructor.">chmat</a> ( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;M, <span class="keyword">const</span> ivec &amp;perm ):<a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a>(M.<a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646" title="Reimplementing common functions of mat: cols().">rows</a>()){it_error(<span class="stringliteral">"not implemneted"</span>);}; 
     57<a name="l00065"></a><a class="code" href="classchmat.html#9c50d31c999d85d8e9d8cf2b69b6ac8c">00065</a>         mat &amp; <a class="code" href="classchmat.html#9c50d31c999d85d8e9d8cf2b69b6ac8c" title="Access function.">_Ch</a>() {<span class="keywordflow">return</span> <a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>;} 
     58<a name="l00067"></a><a class="code" href="classchmat.html#a4fc7f9b0539b97c414442a22f3db6e8">00067</a>         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#a4fc7f9b0539b97c414442a22f3db6e8" title="Access functions.">setD</a> ( <span class="keyword">const</span> vec &amp;nD ) {<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>=diag ( sqrt(nD) );} 
     59<a name="l00069"></a><a class="code" href="classchmat.html#4b9271097d8317d9514c5d0d62cccb39">00069</a>         <span class="keywordtype">void</span> <a class="code" href="classchmat.html#a4fc7f9b0539b97c414442a22f3db6e8" title="Access functions.">setD</a> ( <span class="keyword">const</span> vec &amp;nD, <span class="keywordtype">int</span> i ) {<span class="keywordflow">for</span> ( <span class="keywordtype">int</span> j=i;j&lt;nD.length();j++ ) {<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>( j,j ) =sqrt(nD ( j-i ));}} <span class="comment">//Fixme can be more general</span> 
     60<a name="l00070"></a>00070  
     61<a name="l00072"></a>00072         <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; <a class="code" href="classchmat.html#6a8b39fe3a28d2c8e3fc0d74141229fb" title="Operators.">operator += </a>( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;A2 ); 
     62<a name="l00073"></a>00073         <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; <a class="code" href="classchmat.html#a8c3628a8c15eb0009e57c66fcac1a76" title="mapping of negative add operation to operators">operator -= </a>( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;A2 ) ; 
     63<a name="l00074"></a>00074         <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; operator * ( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;A2 ); 
     64<a name="l00075"></a>00075         <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; operator * ( <span class="keyword">const</span> <span class="keywordtype">double</span> &amp;d ){<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>*d; <span class="keywordflow">return</span> *<span class="keyword">this</span>;}; 
     65<a name="l00076"></a>00076         <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; operator = ( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;A2 ){<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>=A2.<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>;<a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>=A2.<a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>;<span class="keywordflow">return</span> *<span class="keyword">this</span>;} 
     66<a name="l00077"></a>00077 }; 
     67<a name="l00078"></a>00078  
    6768<a name="l00079"></a>00079  
    68 <a name="l00080"></a>00080  
    69 <a name="l00083"></a><a class="code" href="classchmat.html#6a8b39fe3a28d2c8e3fc0d74141229fb">00083</a> <span class="keyword">inline</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; <a class="code" href="classchmat.html#6a8b39fe3a28d2c8e3fc0d74141229fb" title="Operators.">chmat::operator += </a>( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;A2 )  {this-&gt;<span class="keyword">add</span> ( A2 );<span class="keywordflow">return</span> *<span class="keyword">this</span>;} 
    70 <a name="l00085"></a><a class="code" href="classchmat.html#a8c3628a8c15eb0009e57c66fcac1a76">00085</a> <span class="keyword">inline</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; <a class="code" href="classchmat.html#a8c3628a8c15eb0009e57c66fcac1a76" title="mapping of negative add operation to operators">chmat::operator -= </a>( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;A2 )  {this-&gt;<span class="keyword">add</span> ( A2,-1.0 );<span class="keywordflow">return</span> *<span class="keyword">this</span>;} 
    71 <a name="l00086"></a>00086  
    72 <a name="l00087"></a>00087 <span class="preprocessor">#endif // CHMAT_H</span> 
     69<a name="l00082"></a><a class="code" href="classchmat.html#6a8b39fe3a28d2c8e3fc0d74141229fb">00082</a> <span class="keyword">inline</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; <a class="code" href="classchmat.html#6a8b39fe3a28d2c8e3fc0d74141229fb" title="Operators.">chmat::operator += </a>( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;A2 )  {this-&gt;<span class="keyword">add</span> ( A2 );<span class="keywordflow">return</span> *<span class="keyword">this</span>;} 
     70<a name="l00084"></a><a class="code" href="classchmat.html#a8c3628a8c15eb0009e57c66fcac1a76">00084</a> <span class="keyword">inline</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>&amp; <a class="code" href="classchmat.html#a8c3628a8c15eb0009e57c66fcac1a76" title="mapping of negative add operation to operators">chmat::operator -= </a>( <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &amp;A2 )  {this-&gt;<span class="keyword">add</span> ( A2,-1.0 );<span class="keywordflow">return</span> *<span class="keyword">this</span>;} 
     71<a name="l00085"></a>00085  
     72<a name="l00086"></a>00086 <span class="preprocessor">#endif // CHMAT_H</span> 
    7373</pre></div></div> 
    74 <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jan 27 16:29:52 2009 for mixpp by&nbsp; 
     74<hr size="1"><address style="text-align: right;"><small>Generated on Fri Feb 6 15:29:44 2009 for mixpp by&nbsp; 
    7575<a href="http://www.doxygen.org/index.html"> 
    7676<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>