52 | | <a name="l00087"></a><a class="code" href="classfsqmat.html">00087</a> <span class="keyword">class </span><a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a>: <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> { |
53 | | <a name="l00088"></a>00088 <span class="keywordtype">void</span> opupdt( <span class="keyword">const</span> vec &v, <span class="keywordtype">double</span> w ); |
54 | | <a name="l00089"></a>00089 mat to_mat(); |
55 | | <a name="l00090"></a>00090 <span class="keywordtype">void</span> mult_sym( <span class="keyword">const</span> mat &C, <span class="keywordtype">bool</span> trans=<span class="keyword">false</span> ); |
56 | | <a name="l00091"></a>00091 <span class="keywordtype">void</span> mult_sym( <span class="keyword">const</span> mat &C, <a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a> &U, <span class="keywordtype">bool</span> trans=<span class="keyword">false</span> ); |
57 | | <a name="l00092"></a>00092 <span class="keywordtype">void</span> inv(<a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a> &Inv); |
58 | | <a name="l00093"></a>00093 <span class="keywordtype">void</span> clear(); |
59 | | <a name="l00094"></a>00094 |
60 | | <a name="l00095"></a>00095 |
61 | | <a name="l00097"></a>00097 <a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a>(<span class="keyword">const</span> mat &M); |
| 52 | <a name="l00087"></a><a class="code" href="classfsqmat.html">00087</a> <span class="keyword">class </span><a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</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> { |
| 53 | <a name="l00088"></a>00088 <span class="keyword">protected</span>: |
| 54 | <a name="l00089"></a>00089 mat M; |
| 55 | <a name="l00090"></a>00090 <span class="keyword">public</span>: |
| 56 | <a name="l00091"></a>00091 <span class="keywordtype">void</span> <a class="code" href="classfsqmat.html#b36530e155667fe9f1bd58394e50c65a">opupdt</a>( <span class="keyword">const</span> vec &v, <span class="keywordtype">double</span> w ); |
| 57 | <a name="l00092"></a>00092 mat <a class="code" href="classfsqmat.html#cedf4f048309056f4262c930914dfda8" title="Conversion to full matrix.">to_mat</a>(); |
| 58 | <a name="l00093"></a>00093 <span class="keywordtype">void</span> <a class="code" href="classfsqmat.html#acc5d2d0a243f1de6d0106065f01f518" title="Inplace symmetric multiplication by a SQUARE matrix $C$, i.e. $V = C*V*C&#39;$.">mult_sym</a>( <span class="keyword">const</span> mat &C, <span class="keywordtype">bool</span> trans=<span class="keyword">false</span> ); |
| 59 | <a name="l00094"></a>00094 <span class="keywordtype">void</span> <a class="code" href="classfsqmat.html#acc5d2d0a243f1de6d0106065f01f518" title="Inplace symmetric multiplication by a SQUARE matrix $C$, i.e. $V = C*V*C&#39;$.">mult_sym</a>( <span class="keyword">const</span> mat &C, <a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a> &U, <span class="keywordtype">bool</span> trans=<span class="keyword">false</span> ); |
| 60 | <a name="l00095"></a>00095 <span class="keywordtype">void</span> inv(<a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a> &Inv); |
| 61 | <a name="l00096"></a>00096 <span class="keywordtype">void</span> <a class="code" href="classfsqmat.html#cfa4c359483d2322f32d1d50050f8ac4" title="Clearing matrix so that it corresponds to zeros.">clear</a>(); |
| 62 | <a name="l00097"></a>00097 |
63 | | <a name="l00104"></a>00104 <span class="keyword">virtual</span> <span class="keywordtype">void</span> inv(<a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a>* Inv); |
64 | | <a name="l00105"></a>00105 |
65 | | <a name="l00106"></a>00106 |
66 | | <a name="l00107"></a>00107 }; |
67 | | <a name="l00108"></a>00108 |
68 | | <a name="l00109"></a>00109 <span class="keyword">class </span>ldmat: <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> { |
69 | | <a name="l00110"></a>00110 <span class="keyword">public</span>: |
70 | | <a name="l00111"></a>00111 |
71 | | <a name="l00113"></a>00113 ldmat( <span class="keyword">const</span> mat &L, <span class="keyword">const</span> vec &D ); |
72 | | <a name="l00115"></a>00115 ldmat( mat V ); |
73 | | <a name="l00117"></a>00117 ldmat( vec D0 ); |
74 | | <a name="l00118"></a>00118 ldmat (); |
75 | | <a name="l00119"></a>00119 |
76 | | <a name="l00120"></a>00120 <span class="comment">// Reimplementation of compulsory operatios</span> |
| 64 | <a name="l00099"></a>00099 <a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a>(){}; <span class="comment">// mat will be initialized OK</span> |
| 65 | <a name="l00101"></a>00101 <span class="comment"></span> <a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a>(<span class="keyword">const</span> mat &M); |
| 66 | <a name="l00102"></a>00102 |
| 67 | <a name="l00108"></a>00108 <span class="keyword">virtual</span> <span class="keywordtype">void</span> inv(<a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a>* Inv); |
| 68 | <a name="l00109"></a>00109 |
| 69 | <a name="l00110"></a><a class="code" href="classfsqmat.html#bf212272ec195ad2706e2bf4d8e7c9b3">00110</a> <span class="keywordtype">double</span> <a class="code" href="classfsqmat.html#bf212272ec195ad2706e2bf4d8e7c9b3" title="Logarithm of a determinant.">logdet</a>(){<span class="keywordflow">return</span> log(det(M));}; |
| 70 | <a name="l00111"></a><a class="code" href="classfsqmat.html#6d047b9f7a27dfc093303a13cc9b1fba">00111</a> <span class="keywordtype">double</span> <a class="code" href="classfsqmat.html#6d047b9f7a27dfc093303a13cc9b1fba" title="Evaluates quadratic form $x= v&#39;*V*v$;.">qform</a>(vec &v){<span class="keywordflow">return</span> (v*(M*v));}; |
| 71 | <a name="l00112"></a><a class="code" href="classfsqmat.html#6648dd4291b809cce14e8497d0433ad3">00112</a> vec <a class="code" href="classfsqmat.html#6648dd4291b809cce14e8497d0433ad3" title="Multiplies square root of $V$ by vector $x$.">sqrt_mult</a>(vec &v){it_error(<span class="stringliteral">"not implemented"</span>);<span class="keywordflow">return</span> v;}; |
| 72 | <a name="l00113"></a>00113 |
| 73 | <a name="l00114"></a>00114 <a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a>& operator += (<span class="keyword">const</span> <a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a> &A){M+=A.<a class="code" href="classfsqmat.html#a7a1fcb9aae19d1e4daddfc9c22ce453">M</a>;<span class="keywordflow">return</span> *<span class="keyword">this</span>;}; |
| 74 | <a name="l00115"></a>00115 <a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a>& operator -= (<span class="keyword">const</span> <a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a> &A){M-=A.<a class="code" href="classfsqmat.html#a7a1fcb9aae19d1e4daddfc9c22ce453">M</a>;<span class="keywordflow">return</span> *<span class="keyword">this</span>;}; |
| 75 | <a name="l00116"></a>00116 <a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a>& operator *= (<span class="keywordtype">double</span> x){M*=x;<span class="keywordflow">return</span> *<span class="keyword">this</span>;}; |
| 76 | <a name="l00117"></a>00117 }; |
| 77 | <a name="l00118"></a>00118 |
| 78 | <a name="l00119"></a>00119 <span class="keyword">class </span>ldmat: <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> { |
| 79 | <a name="l00120"></a>00120 <span class="keyword">public</span>: |
78 | | <a name="l00122"></a>00122 <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#b223484796661f2dadb5607a86ce0581">opupdt</a>( <span class="keyword">const</span> vec &v, <span class="keywordtype">double</span> w ); |
79 | | <a name="l00123"></a>00123 mat <a class="code" href="classsqmat.html#9a5b6fddfeb42339e1dc9b978a2590fc" title="Conversion to full matrix.">to_mat</a>(); |
80 | | <a name="l00124"></a>00124 <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#faa3bc90be142adde9cf74f573c70157" title="Inplace symmetric multiplication by a SQUARE matrix $C$, i.e. $V = C*V*C&#39;$.">mult_sym</a>( <span class="keyword">const</span> mat &C, <span class="keywordtype">bool</span> trans=<span class="keyword">false</span> ); |
81 | | <a name="l00125"></a>00125 <span class="keywordtype">void</span> <span class="keyword">add</span> ( <span class="keyword">const</span> ldmat &ld2, <span class="keywordtype">double</span> w=1.0 ); |
82 | | <a name="l00126"></a>00126 <span class="keywordtype">double</span> <a class="code" href="classsqmat.html#5c852819589f74cdaefbd648c0ce8547" title="Logarithm of a determinant.">logdet</a>(); |
83 | | <a name="l00127"></a>00127 <span class="keywordtype">double</span> <a class="code" href="classsqmat.html#44e079468bc8bfccf634dc85b32ba6be" title="Evaluates quadratic form $x= v&#39;*V*v$;.">qform</a>(vec &v); |
84 | | <a name="l00128"></a>00128 <span class="comment">// sqmat& operator -= ( const sqmat & ld2 );</span> |
85 | | <a name="l00129"></a>00129 <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#6fca246f9eabbdeb8cac03030e826b5e" title="Clearing matrix so that it corresponds to zeros.">clear</a>(); |
86 | | <a name="l00130"></a>00130 <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#743d3799d9e73403230c54e14ecf09ed" title="Reimplementing common functions of mat: cols().">cols</a>(); |
87 | | <a name="l00131"></a>00131 <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#f59664a4be09450f8c6ce3f5e5ab2dc7" title="Reimplementing common functions of mat: cols().">rows</a>(); |
88 | | <a name="l00132"></a>00132 vec <a class="code" href="classsqmat.html#b5236c8a050199e1a9d338b0da1a08d2" title="Multiplies square root of $V$ by vector $x$.">sqrt_mult</a>(vec &v); |
89 | | <a name="l00133"></a>00133 |
90 | | <a name="l00139"></a>00139 <span class="keyword">virtual</span> <span class="keywordtype">void</span> inv(ldmat &Inv); |
91 | | <a name="l00140"></a>00140 |
92 | | <a name="l00146"></a>00146 <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#faa3bc90be142adde9cf74f573c70157" title="Inplace symmetric multiplication by a SQUARE matrix $C$, i.e. $V = C*V*C&#39;$.">mult_sym</a>( <span class="keyword">const</span> mat &C, ldmat &U, <span class="keywordtype">bool</span> trans=<span class="keyword">false</span> ); |
93 | | <a name="l00147"></a>00147 |
94 | | <a name="l00156"></a>00156 <span class="keywordtype">void</span> ldform( mat &A, vec &D0 ); |
| 81 | <a name="l00123"></a>00123 ldmat( <span class="keyword">const</span> mat &L, <span class="keyword">const</span> vec &D ); |
| 82 | <a name="l00125"></a>00125 ldmat( mat V ); |
| 83 | <a name="l00127"></a>00127 ldmat( vec D0 ); |
| 84 | <a name="l00128"></a>00128 ldmat (); |
| 85 | <a name="l00129"></a>00129 |
| 86 | <a name="l00130"></a>00130 <span class="comment">// Reimplementation of compulsory operatios</span> |
| 87 | <a name="l00131"></a>00131 |
| 88 | <a name="l00132"></a>00132 <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#b223484796661f2dadb5607a86ce0581">opupdt</a>( <span class="keyword">const</span> vec &v, <span class="keywordtype">double</span> w ); |
| 89 | <a name="l00133"></a>00133 mat <a class="code" href="classsqmat.html#9a5b6fddfeb42339e1dc9b978a2590fc" title="Conversion to full matrix.">to_mat</a>(); |
| 90 | <a name="l00134"></a>00134 <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#faa3bc90be142adde9cf74f573c70157" title="Inplace symmetric multiplication by a SQUARE matrix $C$, i.e. $V = C*V*C&#39;$.">mult_sym</a>( <span class="keyword">const</span> mat &C, <span class="keywordtype">bool</span> trans=<span class="keyword">false</span> ); |
| 91 | <a name="l00135"></a>00135 <span class="keywordtype">void</span> <span class="keyword">add</span> ( <span class="keyword">const</span> ldmat &ld2, <span class="keywordtype">double</span> w=1.0 ); |
| 92 | <a name="l00136"></a>00136 <span class="keywordtype">double</span> <a class="code" href="classsqmat.html#5c852819589f74cdaefbd648c0ce8547" title="Logarithm of a determinant.">logdet</a>(); |
| 93 | <a name="l00137"></a>00137 <span class="keywordtype">double</span> <a class="code" href="classsqmat.html#44e079468bc8bfccf634dc85b32ba6be" title="Evaluates quadratic form $x= v&#39;*V*v$;.">qform</a>(vec &v); |
| 94 | <a name="l00138"></a>00138 <span class="comment">// sqmat& operator -= ( const sqmat & ld2 );</span> |
| 95 | <a name="l00139"></a>00139 <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#6fca246f9eabbdeb8cac03030e826b5e" title="Clearing matrix so that it corresponds to zeros.">clear</a>(); |
| 96 | <a name="l00140"></a>00140 <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#ecc2e2540f95a04f4449842588170f5b" title="Reimplementing common functions of mat: cols().">cols</a>(); |
| 97 | <a name="l00141"></a>00141 <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646" title="Reimplementing common functions of mat: cols().">rows</a>(); |
| 98 | <a name="l00142"></a>00142 vec <a class="code" href="classsqmat.html#b5236c8a050199e1a9d338b0da1a08d2" title="Multiplies square root of $V$ by vector $x$.">sqrt_mult</a>(vec &v); |
| 99 | <a name="l00143"></a>00143 |
| 100 | <a name="l00149"></a>00149 <span class="keyword">virtual</span> <span class="keywordtype">void</span> inv(ldmat &Inv); |
| 101 | <a name="l00150"></a>00150 |
| 102 | <a name="l00156"></a>00156 <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#faa3bc90be142adde9cf74f573c70157" title="Inplace symmetric multiplication by a SQUARE matrix $C$, i.e. $V = C*V*C&#39;$.">mult_sym</a>( <span class="keyword">const</span> mat &C, ldmat &U, <span class="keywordtype">bool</span> trans=<span class="keyword">false</span> ); |
106 | | <a name="l00168"></a>00168 }; |
107 | | <a name="l00169"></a>00169 |
108 | | <a name="l00171"></a>00171 |
109 | | <a name="l00172"></a>00172 <span class="keyword">inline</span> ldmat& ldmat::operator += (<span class="keyword">const</span> ldmat &ldA) {this-><span class="keyword">add</span>(ldA);<span class="keywordflow">return</span> *<span class="keyword">this</span>;} |
110 | | <a name="l00173"></a>00173 <span class="keyword">inline</span> ldmat& ldmat::operator -= (<span class="keyword">const</span> ldmat &ldA) {this-><span class="keyword">add</span>(ldA,-1.0);<span class="keywordflow">return</span> *<span class="keyword">this</span>;} |
111 | | <a name="l00174"></a>00174 <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#743d3799d9e73403230c54e14ecf09ed" title="Reimplementing common functions of mat: cols().">ldmat::cols</a>(){<span class="keywordflow">return</span> dim;} |
112 | | <a name="l00175"></a>00175 <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#f59664a4be09450f8c6ce3f5e5ab2dc7" title="Reimplementing common functions of mat: cols().">ldmat::rows</a>(){<span class="keywordflow">return</span> dim;} |
113 | | <a name="l00176"></a>00176 |
114 | | <a name="l00177"></a>00177 <span class="preprocessor">#endif // DC_H</span> |
115 | | </pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Feb 15 18:57:36 2008 for mixpp by |
| 106 | <a name="l00168"></a>00168 ldmat& operator += (<span class="keyword">const</span> ldmat &ldA); |
| 107 | <a name="l00169"></a>00169 ldmat& operator -= (<span class="keyword">const</span> ldmat &ldA); |
| 108 | <a name="l00170"></a>00170 ldmat& operator *= (<span class="keywordtype">double</span> x); |
| 109 | <a name="l00171"></a>00171 |
| 110 | <a name="l00172"></a>00172 <span class="keyword">friend</span> std::ostream &operator<< ( std::ostream &os, ldmat &sq ); |
| 111 | <a name="l00173"></a>00173 |
| 112 | <a name="l00174"></a>00174 <span class="keyword">protected</span>: |
| 113 | <a name="l00175"></a>00175 vec D; |
| 114 | <a name="l00176"></a>00176 mat L; |
| 115 | <a name="l00177"></a>00177 |
| 116 | <a name="l00178"></a>00178 }; |
| 117 | <a name="l00179"></a>00179 |
| 118 | <a name="l00181"></a>00181 |
| 119 | <a name="l00182"></a>00182 <span class="keyword">inline</span> ldmat& ldmat::operator += (<span class="keyword">const</span> ldmat &ldA) {this-><span class="keyword">add</span>(ldA);<span class="keywordflow">return</span> *<span class="keyword">this</span>;} |
| 120 | <a name="l00183"></a>00183 <span class="keyword">inline</span> ldmat& ldmat::operator -= (<span class="keyword">const</span> ldmat &ldA) {this-><span class="keyword">add</span>(ldA,-1.0);<span class="keywordflow">return</span> *<span class="keyword">this</span>;} |
| 121 | <a name="l00184"></a>00184 <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#ecc2e2540f95a04f4449842588170f5b" title="Reimplementing common functions of mat: cols().">ldmat::cols</a>(){<span class="keywordflow">return</span> dim;} |
| 122 | <a name="l00185"></a>00185 <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646" title="Reimplementing common functions of mat: cols().">ldmat::rows</a>(){<span class="keywordflow">return</span> dim;} |
| 123 | <a name="l00186"></a>00186 |
| 124 | <a name="l00187"></a>00187 <span class="preprocessor">#endif // DC_H</span> |
| 125 | </pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Sun Feb 17 16:14:14 2008 for mixpp by |