Changeset 354 for doc/html/chmat_8h-source.html
- Timestamp:
- 06/02/09 10:24:26 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
doc/html/chmat_8h-source.html
r353 r354 87 87 <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>(); 88 88 <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> &A2, <span class="keywordtype">double</span> w=1.0 ) {}; 89 <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> &Inv )<span class="keyword"> const </span>{ ( Inv.<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ) = <a class="code" href="group__inverse.html#g125b083397cc9450b8a67a485b545bc8" title="Inverse of real square matrix.Calculate the inverse of the real matrix .">itpp::inv</a>( <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>89 <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> &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> 90 90 <a name="l00045"></a>00045 ; 91 91 <a name="l00046"></a>00046 <span class="comment">// void inv ( mat &Inv );</span> … … 94 94 <a name="l00051"></a>00051 <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> ( ) : <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> (),<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ( ) {}; 95 95 <a name="l00053"></a><a class="code" href="classchmat.html#fdd73b0c596161637fd25bdf2c670c39">00053</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 ) {}; 96 <a name="l00055"></a><a class="code" href="classchmat.html#d4f0a94e81279295e60e72812130f9d4">00055</a> <a class="code" href="classchmat.html#d4f0a94e81279295e60e72812130f9d4" title="Default constructor.">chmat</a> ( <span class="keyword">const</span> vec &v) : <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> ( v. <a class="code" href="group__matrix__functions.html#g97bb6b35d6d4c683c7558842e4500c2d" title="Length of vector.">length</a>() ),<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a> ( <a class="code" href="group__diag.html#gb0938c932c1cbc19b2ce6c5ac1007553" title="Get the diagonal elements of the input matrix m.">diag</a>(<a class="code" href="group__miscfunc.html#g20af7c97287e8275db8c2b0f650310ac" title="Square root of the elements.">sqrt</a>(v)) ) {};96 <a name="l00055"></a><a class="code" href="classchmat.html#d4f0a94e81279295e60e72812130f9d4">00055</a> <a class="code" href="classchmat.html#d4f0a94e81279295e60e72812130f9d4" title="Default constructor.">chmat</a> ( <span class="keyword">const</span> vec &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)) ) {}; 97 97 <a name="l00057"></a><a class="code" href="classchmat.html#d92f3bd9a727b8c88a8c7385feb3449a">00057</a> <a class="code" href="classchmat.html#d92f3bd9a727b8c88a8c7385feb3449a" title="Copy 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> &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>;}; 98 98 <a name="l00059"></a><a class="code" href="classchmat.html#8334a00f30f0a05f893c2aeec395ef10">00059</a> <a class="code" href="classchmat.html#8334a00f30f0a05f893c2aeec395ef10" title="Default constructor (m3k:cholform).">chmat</a> ( <span class="keyword">const</span> mat &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>() ) { 99 99 <a name="l00060"></a>00060 mat Q; 100 <a name="l00061"></a>00061 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>( M.rows() ==M.cols(),<span class="stringliteral">"chmat:: input matrix must be square!"</span> );101 <a name="l00062"></a>00062 <a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>= <a class="code" href="group__matrixdecomp.html#g8aa42136e884519422d4f2dd95e51cb5" title="Cholesky factorisation of real symmetric and positive definite matrix.">chol</a>( M );100 <a name="l00061"></a>00061 it_assert_debug ( M.rows() ==M.cols(),<span class="stringliteral">"chmat:: input matrix must be square!"</span> ); 101 <a name="l00062"></a>00062 <a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>=chol ( M ); 102 102 <a name="l00063"></a>00063 }; 103 <a name="l00065"></a><a class="code" href="classchmat.html#24de7f42e0a86bb270588cd0dd9d60b4">00065</a> <a class="code" href="classchmat.html#24de7f42e0a86bb270588cd0dd9d60b4" title="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> &M, <span class="keyword">const</span> ivec &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>()){ <a class="code" href="group__errorhandlingfunc.html#g22d38e98332f9edff88cc501463eedce" title="Abort unconditionally.">it_error</a>(<span class="stringliteral">"not implemneted"</span>);};103 <a name="l00065"></a><a class="code" href="classchmat.html#24de7f42e0a86bb270588cd0dd9d60b4">00065</a> <a class="code" href="classchmat.html#24de7f42e0a86bb270588cd0dd9d60b4" title="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> &M, <span class="keyword">const</span> ivec &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>);}; 104 104 <a name="l00067"></a><a class="code" href="classchmat.html#9c50d31c999d85d8e9d8cf2b69b6ac8c">00067</a> mat & <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>;} 105 105 <a name="l00069"></a><a class="code" href="classchmat.html#0e2982a88febb5e604f96505ea40bd95">00069</a> <span class="keyword">const</span> mat & <a class="code" href="classchmat.html#0e2982a88febb5e604f96505ea40bd95" title="Access function.">_Ch</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>;} 106 <a name="l00071"></a><a class="code" href="classchmat.html#a4fc7f9b0539b97c414442a22f3db6e8">00071</a> <span class="keywordtype">void</span> <a class="code" href="classchmat.html#a4fc7f9b0539b97c414442a22f3db6e8" title="Access functions.">setD</a> ( <span class="keyword">const</span> vec &nD ) {<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>= <a class="code" href="group__diag.html#gb0938c932c1cbc19b2ce6c5ac1007553" title="Get the diagonal elements of the input matrix m.">diag</a> ( <a class="code" href="group__miscfunc.html#g20af7c97287e8275db8c2b0f650310ac" title="Square root of the elements.">sqrt</a>(nD) );}106 <a name="l00071"></a><a class="code" href="classchmat.html#a4fc7f9b0539b97c414442a22f3db6e8">00071</a> <span class="keywordtype">void</span> <a class="code" href="classchmat.html#a4fc7f9b0539b97c414442a22f3db6e8" title="Access functions.">setD</a> ( <span class="keyword">const</span> vec &nD ) {<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>=diag ( sqrt(nD) );} 107 107 <a name="l00073"></a><a class="code" href="classchmat.html#4c8b321967b14ed2616a2abb9498a979">00073</a> <span class="keywordtype">void</span> <a class="code" href="classchmat.html#4c8b321967b14ed2616a2abb9498a979" title="Access functions.">setCh</a> ( <span class="keyword">const</span> vec &chQ ) { 108 <a name="l00074"></a>00074 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(chQ.length()==<a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>*<a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>,<span class="stringliteral">""</span>);108 <a name="l00074"></a>00074 it_assert_debug(chQ.length()==<a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>*<a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>,<span class="stringliteral">""</span>); 109 109 <a name="l00075"></a>00075 copy_vector(dim*dim, chQ._data(), <a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>._data()); 110 110 <a name="l00076"></a>00076 } 111 <a name="l00078"></a><a class="code" href="classchmat.html#4b9271097d8317d9514c5d0d62cccb39">00078</a> <span class="keywordtype">void</span> <a class="code" href="classchmat.html#4b9271097d8317d9514c5d0d62cccb39" title="Access functions.">setD</a> ( <span class="keyword">const</span> vec &nD, <span class="keywordtype">int</span> i ) {<span class="keywordflow">for</span> ( <span class="keywordtype">int</span> j=i;j<nD.length();j++ ) {<a class="code" href="classchmat.html#95158bb150f5e7f939168abcd577fd9c" title="Upper triangle of the cholesky matrix.">Ch</a>( j,j ) = <a class="code" href="group__miscfunc.html#g20af7c97287e8275db8c2b0f650310ac" title="Square root of the elements.">sqrt</a>(nD ( j-i ));}} <span class="comment">//Fixme can be more general</span>111 <a name="l00078"></a><a class="code" href="classchmat.html#4b9271097d8317d9514c5d0d62cccb39">00078</a> <span class="keywordtype">void</span> <a class="code" href="classchmat.html#4b9271097d8317d9514c5d0d62cccb39" title="Access functions.">setD</a> ( <span class="keyword">const</span> vec &nD, <span class="keywordtype">int</span> i ) {<span class="keywordflow">for</span> ( <span class="keywordtype">int</span> j=i;j<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> 112 112 <a name="l00079"></a>00079 113 113 <a name="l00081"></a>00081 <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a>& <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> &A2 ); … … 124 124 <a name="l00095"></a>00095 <span class="preprocessor">#endif // CHMAT_H</span> 125 125 </pre></div></div> 126 <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10: 02:112009 for mixpp by 126 <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:11:00 2009 for mixpp by 127 127 <a href="http://www.doxygen.org/index.html"> 128 128 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>