31 | | <a name="l00045"></a>00045 <span class="keyword">virtual</span> <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">true</span> ) =0; |
32 | | <a name="l00046"></a>00046 |
33 | | <a name="l00047"></a>00047 |
34 | | <a name="l00052"></a>00052 <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classsqmat.html#5c852819589f74cdaefbd648c0ce8547" title="Logarithm of a determinant.">logdet</a>() =0; |
35 | | <a name="l00053"></a>00053 |
36 | | <a name="l00059"></a>00059 <span class="keyword">virtual</span> vec <a class="code" href="classsqmat.html#b5236c8a050199e1a9d338b0da1a08d2" title="Multiplies square root of $V$ by vector $x$.">sqrt_mult</a> ( vec &v ) =0; |
37 | | <a name="l00060"></a>00060 |
38 | | <a name="l00065"></a>00065 <span class="keyword">virtual</span> <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 ) =0; |
39 | | <a name="l00066"></a>00066 |
40 | | <a name="l00067"></a>00067 <span class="comment">// //! easy version of the</span> |
41 | | <a name="l00068"></a>00068 <span class="comment">// sqmat inv();</span> |
42 | | <a name="l00069"></a>00069 |
43 | | <a name="l00071"></a>00071 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#6fca246f9eabbdeb8cac03030e826b5e" title="Clearing matrix so that it corresponds to zeros.">clear</a>() =0; |
44 | | <a name="l00072"></a>00072 |
45 | | <a name="l00074"></a><a class="code" href="classsqmat.html#ecc2e2540f95a04f4449842588170f5b">00074</a> <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#ecc2e2540f95a04f4449842588170f5b" title="Reimplementing common functions of mat: cols().">cols</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> dim;}; |
46 | | <a name="l00075"></a>00075 |
47 | | <a name="l00077"></a><a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646">00077</a> <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646" title="Reimplementing common functions of mat: cols().">rows</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> dim;}; |
48 | | <a name="l00078"></a>00078 |
49 | | <a name="l00079"></a>00079 <span class="keyword">protected</span>: |
50 | | <a name="l00080"></a>00080 <span class="keywordtype">int</span> dim; |
51 | | <a name="l00081"></a>00081 }; |
| 31 | <a name="l00044"></a>00044 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#60fbbfa9e483b8187c135f787ee53afa" 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 ) =0; |
| 32 | <a name="l00045"></a>00045 |
| 33 | <a name="l00049"></a>00049 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#6909e906da17725b1b80f3cae7cf3325" title="Inplace symmetric multiplication by a SQUARE transpose of matrix $C$, i.e. $V = C&#39;*V*C$...">mult_sym_t</a> ( <span class="keyword">const</span> mat &C ) =0; |
| 34 | <a name="l00050"></a>00050 |
| 35 | <a name="l00051"></a>00051 |
| 36 | <a name="l00056"></a>00056 <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classsqmat.html#0a772b396750eeeed85d69fa72478b45" title="Logarithm of a determinant.">logdet</a>() <span class="keyword">const</span> =0; |
| 37 | <a name="l00057"></a>00057 |
| 38 | <a name="l00063"></a>00063 <span class="keyword">virtual</span> vec <a class="code" href="classsqmat.html#975ddc7e8035d8d4e6cbd52dd99c248c" title="Multiplies square root of $V$ by vector $x$.">sqrt_mult</a> (<span class="keyword">const</span> vec &v ) =0; |
| 39 | <a name="l00064"></a>00064 |
| 40 | <a name="l00069"></a>00069 <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classsqmat.html#90f97cdf9de08ead4f0648419b3aa4ce" title="Evaluates quadratic form $x= v&#39;*V*v$;.">qform</a> (<span class="keyword">const</span> vec &v ) =0; |
| 41 | <a name="l00070"></a>00070 |
| 42 | <a name="l00071"></a>00071 <span class="comment">// //! easy version of the</span> |
| 43 | <a name="l00072"></a>00072 <span class="comment">// sqmat inv();</span> |
| 44 | <a name="l00073"></a>00073 |
| 45 | <a name="l00075"></a>00075 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#6fca246f9eabbdeb8cac03030e826b5e" title="Clearing matrix so that it corresponds to zeros.">clear</a>() =0; |
| 46 | <a name="l00076"></a>00076 |
| 47 | <a name="l00078"></a><a class="code" href="classsqmat.html#ecc2e2540f95a04f4449842588170f5b">00078</a> <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#ecc2e2540f95a04f4449842588170f5b" title="Reimplementing common functions of mat: cols().">cols</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> dim;}; |
| 48 | <a name="l00079"></a>00079 |
| 49 | <a name="l00081"></a><a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646">00081</a> <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646" title="Reimplementing common functions of mat: cols().">rows</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> dim;}; |
53 | | <a name="l00083"></a>00083 |
54 | | <a name="l00088"></a><a class="code" href="classfsqmat.html">00088</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> |
55 | | <a name="l00089"></a>00089 { |
56 | | <a name="l00090"></a>00090 <span class="keyword">protected</span>: |
57 | | <a name="l00091"></a>00091 mat M; |
58 | | <a name="l00092"></a>00092 <span class="keyword">public</span>: |
59 | | <a name="l00093"></a>00093 <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 ); |
60 | | <a name="l00094"></a>00094 mat <a class="code" href="classfsqmat.html#cedf4f048309056f4262c930914dfda8" title="Conversion to full matrix.">to_mat</a>() ; |
61 | | <a name="l00095"></a>00095 <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> ); |
62 | | <a name="l00096"></a>00096 <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> ); |
63 | | <a name="l00097"></a>00097 <span class="keywordtype">void</span> <a class="code" href="classfsqmat.html#cfa4c359483d2322f32d1d50050f8ac4" title="Clearing matrix so that it corresponds to zeros.">clear</a>(); |
64 | | <a name="l00098"></a>00098 |
65 | | <a name="l00099"></a>00099 |
66 | | <a name="l00100"></a>00100 <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> |
67 | | <a name="l00102"></a>00102 <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 ); |
68 | | <a name="l00103"></a>00103 |
69 | | <a name="l00109"></a>00109 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classfsqmat.html#9fa853e1ca28f2a1a1c43377e798ecb1" title="Matrix inversion preserving the chosen form.">inv</a> ( <a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a> &Inv ); |
70 | | <a name="l00110"></a>00110 |
71 | | <a name="l00111"></a><a class="code" href="classfsqmat.html#bf212272ec195ad2706e2bf4d8e7c9b3">00111</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 ) );}; |
72 | | <a name="l00112"></a><a class="code" href="classfsqmat.html#6d047b9f7a27dfc093303a13cc9b1fba">00112</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 ) );}; |
73 | | <a name="l00113"></a><a class="code" href="classfsqmat.html#6648dd4291b809cce14e8497d0433ad3">00113</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;}; |
74 | | <a name="l00114"></a>00114 |
75 | | <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>;}; |
76 | | <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="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>;}; |
77 | | <a name="l00117"></a>00117 <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>;}; |
78 | | <a name="l00118"></a>00118 <span class="comment">// fsqmat& operator = ( const fsqmat &A) {M=A.M; return *this;};</span> |
79 | | <a name="l00119"></a>00119 }; |
80 | | <a name="l00120"></a>00120 |
81 | | <a name="l00121"></a>00121 <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> |
82 | | <a name="l00122"></a>00122 { |
83 | | <a name="l00123"></a>00123 <span class="keyword">public</span>: |
| 51 | <a name="l00084"></a><a class="code" href="classsqmat.html#0481f2067bb32aaea7e6d4f27e46b656">00084</a> <span class="keyword">virtual</span> <a class="code" href="classsqmat.html#0481f2067bb32aaea7e6d4f27e46b656" title="Destructor for future use;.">~sqmat</a>(){}; |
| 52 | <a name="l00085"></a>00085 <span class="keyword">protected</span>: |
| 53 | <a name="l00086"></a>00086 <span class="keywordtype">int</span> dim; |
| 54 | <a name="l00087"></a>00087 }; |
| 55 | <a name="l00088"></a>00088 |
| 56 | <a name="l00089"></a>00089 |
| 57 | <a name="l00094"></a><a class="code" href="classfsqmat.html">00094</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> |
| 58 | <a name="l00095"></a>00095 { |
| 59 | <a name="l00096"></a>00096 <span class="keyword">protected</span>: |
| 60 | <a name="l00097"></a>00097 mat M; |
| 61 | <a name="l00098"></a>00098 <span class="keyword">public</span>: |
| 62 | <a name="l00099"></a>00099 <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 ); |
| 63 | <a name="l00100"></a>00100 mat <a class="code" href="classfsqmat.html#cedf4f048309056f4262c930914dfda8" title="Conversion to full matrix.">to_mat</a>() ; |
| 64 | <a name="l00101"></a>00101 <span class="keywordtype">void</span> <a class="code" href="classfsqmat.html#5530d2756b5d991de755e6121c9a452e" 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); |
| 65 | <a name="l00102"></a>00102 <span class="keywordtype">void</span> <a class="code" href="classfsqmat.html#92052a8adc2054b63e42d1373d145c89" title="Inplace symmetric multiplication by a SQUARE transpose of matrix $C$, i.e. $V = C&#39;*V*C$...">mult_sym_t</a> ( <span class="keyword">const</span> mat &C); |
| 66 | <a name="l00103"></a>00103 <span class="keywordtype">void</span> <a class="code" href="classfsqmat.html#5530d2756b5d991de755e6121c9a452e" 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); |
| 67 | <a name="l00104"></a>00104 <span class="keywordtype">void</span> <a class="code" href="classfsqmat.html#92052a8adc2054b63e42d1373d145c89" title="Inplace symmetric multiplication by a SQUARE transpose of matrix $C$, i.e. $V = C&#39;*V*C$...">mult_sym_t</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); |
| 68 | <a name="l00105"></a>00105 <span class="keywordtype">void</span> <a class="code" href="classfsqmat.html#cfa4c359483d2322f32d1d50050f8ac4" title="Clearing matrix so that it corresponds to zeros.">clear</a>(); |
| 69 | <a name="l00106"></a>00106 |
| 70 | <a name="l00108"></a>00108 <a class="code" href="classfsqmat.html#79e3f73e0ccd663c7f7e08083d272940" title="Default initialization.">fsqmat</a>(); <span class="comment">// mat will be initialized OK</span> |
| 71 | <a name="l00110"></a>00110 <span class="comment"></span> <a class="code" href="classfsqmat.html#79e3f73e0ccd663c7f7e08083d272940" title="Default initialization.">fsqmat</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> dim0); <span class="comment">// mat will be initialized OK</span> |
| 72 | <a name="l00112"></a>00112 <span class="comment"></span> <a class="code" href="classfsqmat.html#79e3f73e0ccd663c7f7e08083d272940" title="Default initialization.">fsqmat</a> ( <span class="keyword">const</span> mat &M ); |
| 73 | <a name="l00113"></a>00113 |
| 74 | <a name="l00115"></a><a class="code" href="classfsqmat.html#2a8f104e4befbc2aa90d8b11edfedb2e">00115</a> <span class="keyword">virtual</span> <a class="code" href="classfsqmat.html#2a8f104e4befbc2aa90d8b11edfedb2e" title="Destructor for future use;.">~fsqmat</a>(){}; |
| 75 | <a name="l00116"></a>00116 |
| 76 | <a name="l00117"></a>00117 |
| 77 | <a name="l00123"></a>00123 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classfsqmat.html#9fa853e1ca28f2a1a1c43377e798ecb1" title="Matrix inversion preserving the chosen form.">inv</a> ( <a class="code" href="classfsqmat.html" title="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</a> &Inv ); |
85 | | <a name="l00126"></a>00126 ldmat ( <span class="keyword">const</span> mat &L, <span class="keyword">const</span> vec &D ); |
86 | | <a name="l00128"></a>00128 ldmat ( mat V ); |
87 | | <a name="l00130"></a>00130 ldmat ( vec D0 ); |
88 | | <a name="l00131"></a>00131 ldmat (); |
89 | | <a name="l00132"></a>00132 |
90 | | <a name="l00133"></a>00133 <span class="comment">// Reimplementation of compulsory operatios</span> |
91 | | <a name="l00134"></a>00134 |
92 | | <a name="l00135"></a>00135 <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 ); |
93 | | <a name="l00136"></a>00136 mat <a class="code" href="classsqmat.html#9a5b6fddfeb42339e1dc9b978a2590fc" title="Conversion to full matrix.">to_mat</a>(); |
94 | | <a name="l00137"></a>00137 <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> ); |
95 | | <a name="l00138"></a>00138 <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 ); |
96 | | <a name="l00139"></a>00139 <span class="keywordtype">double</span> <a class="code" href="classsqmat.html#5c852819589f74cdaefbd648c0ce8547" title="Logarithm of a determinant.">logdet</a>(); |
97 | | <a name="l00140"></a>00140 <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 ); |
98 | | <a name="l00141"></a>00141 <span class="comment">// sqmat& operator -= ( const sqmat & ld2 );</span> |
99 | | <a name="l00142"></a>00142 <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#6fca246f9eabbdeb8cac03030e826b5e" title="Clearing matrix so that it corresponds to zeros.">clear</a>(); |
100 | | <a name="l00143"></a>00143 <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#ecc2e2540f95a04f4449842588170f5b" title="Reimplementing common functions of mat: cols().">cols</a>(); |
101 | | <a name="l00144"></a>00144 <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646" title="Reimplementing common functions of mat: cols().">rows</a>(); |
102 | | <a name="l00145"></a>00145 vec <a class="code" href="classsqmat.html#b5236c8a050199e1a9d338b0da1a08d2" title="Multiplies square root of $V$ by vector $x$.">sqrt_mult</a> ( vec &v ); |
103 | | <a name="l00146"></a>00146 |
104 | | <a name="l00152"></a>00152 <span class="keyword">virtual</span> <span class="keywordtype">void</span> inv ( ldmat &Inv ); |
105 | | <a name="l00153"></a>00153 |
106 | | <a name="l00159"></a>00159 <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> ); |
107 | | <a name="l00160"></a>00160 |
108 | | <a name="l00169"></a>00169 <span class="keywordtype">void</span> ldform ( mat &A, vec &D0 ); |
| 79 | <a name="l00125"></a><a class="code" href="classfsqmat.html#eb0d1358f536e4453b5f99d0418ca1e5">00125</a> <span class="keywordtype">double</span> <a class="code" href="classfsqmat.html#eb0d1358f536e4453b5f99d0418ca1e5" title="Logarithm of a determinant.">logdet</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> log ( det ( M ) );}; |
| 80 | <a name="l00126"></a><a class="code" href="classfsqmat.html#1eec8762a2299d83c7b7cd6bf6cbc1ad">00126</a> <span class="keywordtype">double</span> <a class="code" href="classfsqmat.html#1eec8762a2299d83c7b7cd6bf6cbc1ad" title="Evaluates quadratic form $x= v&#39;*V*v$;.">qform</a> (<span class="keyword">const</span> vec &v ) {<span class="keywordflow">return</span> ( v* ( M*v ) );}; |
| 81 | <a name="l00127"></a><a class="code" href="classfsqmat.html#2288389e2d47bd9df112815ef570c5c9">00127</a> vec <a class="code" href="classfsqmat.html#2288389e2d47bd9df112815ef570c5c9" title="Multiplies square root of $V$ by vector $x$.">sqrt_mult</a> (<span class="keyword">const</span> vec &v ) {it_error ( <span class="stringliteral">"not implemented"</span> );<span class="keywordflow">return</span> v;}; |
| 82 | <a name="l00128"></a>00128 |
| 83 | <a name="l00129"></a>00129 <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>;}; |
| 84 | <a name="l00130"></a>00130 <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>;}; |
| 85 | <a name="l00131"></a>00131 <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>;}; |
| 86 | <a name="l00132"></a>00132 <span class="comment">// fsqmat& operator = ( const fsqmat &A) {M=A.M; return *this;};</span> |
| 87 | <a name="l00133"></a>00133 |
| 88 | <a name="l00134"></a>00134 <span class="keyword">friend</span> std::ostream &operator<< ( std::ostream &os, <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> &sq ); |
| 89 | <a name="l00135"></a>00135 |
| 90 | <a name="l00136"></a>00136 }; |
| 91 | <a name="l00137"></a>00137 |
| 92 | <a name="l00138"></a>00138 <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> |
| 93 | <a name="l00139"></a>00139 { |
| 94 | <a name="l00140"></a>00140 <span class="keyword">public</span>: |
| 95 | <a name="l00141"></a>00141 |
| 96 | <a name="l00143"></a>00143 ldmat ( <span class="keyword">const</span> mat &L, <span class="keyword">const</span> vec &D ); |
| 97 | <a name="l00145"></a>00145 ldmat (<span class="keyword">const</span> mat &V ); |
| 98 | <a name="l00147"></a>00147 ldmat ( vec D0 ); |
| 99 | <a name="l00149"></a>00149 ldmat (); |
| 100 | <a name="l00151"></a>00151 ldmat(<span class="keyword">const</span> <span class="keywordtype">int</span> dim0); |
| 101 | <a name="l00152"></a>00152 |
| 102 | <a name="l00154"></a>00154 <span class="keyword">virtual</span> ~ldmat(){}; |
| 103 | <a name="l00155"></a>00155 |
| 104 | <a name="l00156"></a>00156 <span class="comment">// Reimplementation of compulsory operatios</span> |
| 105 | <a name="l00157"></a>00157 |
| 106 | <a name="l00158"></a>00158 <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 ); |
| 107 | <a name="l00159"></a>00159 mat <a class="code" href="classsqmat.html#9a5b6fddfeb42339e1dc9b978a2590fc" title="Conversion to full matrix.">to_mat</a>(); |
| 108 | <a name="l00160"></a>00160 <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#60fbbfa9e483b8187c135f787ee53afa" 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); |
| 109 | <a name="l00161"></a>00161 <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#6909e906da17725b1b80f3cae7cf3325" title="Inplace symmetric multiplication by a SQUARE transpose of matrix $C$, i.e. $V = C&#39;*V*C$...">mult_sym_t</a> ( <span class="keyword">const</span> mat &C); |
| 110 | <a name="l00162"></a>00162 <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 ); |
| 111 | <a name="l00163"></a>00163 <span class="keywordtype">double</span> <a class="code" href="classsqmat.html#0a772b396750eeeed85d69fa72478b45" title="Logarithm of a determinant.">logdet</a>() <span class="keyword">const</span>; |
| 112 | <a name="l00164"></a>00164 <span class="keywordtype">double</span> <a class="code" href="classsqmat.html#90f97cdf9de08ead4f0648419b3aa4ce" title="Evaluates quadratic form $x= v&#39;*V*v$;.">qform</a> (<span class="keyword">const</span> vec &v ); |
| 113 | <a name="l00165"></a>00165 <span class="comment">// sqmat& operator -= ( const sqmat & ld2 );</span> |
| 114 | <a name="l00166"></a>00166 <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#6fca246f9eabbdeb8cac03030e826b5e" title="Clearing matrix so that it corresponds to zeros.">clear</a>(); |
| 115 | <a name="l00167"></a>00167 <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#ecc2e2540f95a04f4449842588170f5b" title="Reimplementing common functions of mat: cols().">cols</a>() <span class="keyword">const</span>; |
| 116 | <a name="l00168"></a>00168 <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#071e80ced9cc3b8cbb360fa7462eb646" title="Reimplementing common functions of mat: cols().">rows</a>() <span class="keyword">const</span>; |
| 117 | <a name="l00169"></a>00169 vec <a class="code" href="classsqmat.html#975ddc7e8035d8d4e6cbd52dd99c248c" title="Multiplies square root of $V$ by vector $x$.">sqrt_mult</a> ( <span class="keyword">const</span> vec &v ); |
123 | | <a name="l00185"></a>00185 <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>;} |
124 | | <a name="l00186"></a>00186 <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>;} |
125 | | <a name="l00187"></a>00187 <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;} |
126 | | <a name="l00188"></a>00188 <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;} |
127 | | <a name="l00189"></a>00189 |
128 | | <a name="l00190"></a>00190 <span class="preprocessor">#endif // DC_H</span> |
129 | | </pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Mon Feb 18 21:48:39 2008 for mixpp by |
| 123 | <a name="l00190"></a>00190 <span class="keywordtype">void</span> <a class="code" href="classsqmat.html#6909e906da17725b1b80f3cae7cf3325" title="Inplace symmetric multiplication by a SQUARE transpose of matrix $C$, i.e. $V = C&#39;*V*C$...">mult_sym_t</a> ( <span class="keyword">const</span> mat &C, ldmat &U); |
| 124 | <a name="l00191"></a>00191 |
| 125 | <a name="l00192"></a>00192 |
| 126 | <a name="l00201"></a>00201 <span class="keywordtype">void</span> ldform (<span class="keyword">const</span> mat &A,<span class="keyword">const</span> vec &D0 ); |
| 127 | <a name="l00202"></a>00202 |
| 128 | <a name="l00204"></a>00204 <span class="keywordtype">void</span> setD (<span class="keyword">const</span> vec &nD){D=nD;} |
| 129 | <a name="l00205"></a>00205 <span class="keywordtype">void</span> setL (<span class="keyword">const</span> vec &nL){L=nL;} |
| 130 | <a name="l00206"></a>00206 |
| 131 | <a name="l00207"></a>00207 ldmat& operator += ( <span class="keyword">const</span> ldmat &ldA ); |
| 132 | <a name="l00208"></a>00208 ldmat& operator -= ( <span class="keyword">const</span> ldmat &ldA ); |
| 133 | <a name="l00209"></a>00209 ldmat& operator *= ( <span class="keywordtype">double</span> x ); |
| 134 | <a name="l00210"></a>00210 |
| 135 | <a name="l00211"></a>00211 <span class="keyword">friend</span> std::ostream &operator<< ( std::ostream &os, <span class="keyword">const</span> ldmat &sq ); |
| 136 | <a name="l00212"></a>00212 |
| 137 | <a name="l00213"></a>00213 |
| 138 | <a name="l00214"></a>00214 <span class="keyword">protected</span>: |
| 139 | <a name="l00215"></a>00215 vec D; |
| 140 | <a name="l00216"></a>00216 mat L; |
| 141 | <a name="l00217"></a>00217 |
| 142 | <a name="l00218"></a>00218 }; |
| 143 | <a name="l00219"></a>00219 |
| 144 | <a name="l00221"></a>00221 |
| 145 | <a name="l00222"></a>00222 <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>;} |
| 146 | <a name="l00223"></a>00223 <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>;} |
| 147 | <a name="l00224"></a>00224 <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="keyword"> const </span>{<span class="keywordflow">return</span> dim;} |
| 148 | <a name="l00225"></a>00225 <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="keyword"> const </span>{<span class="keywordflow">return</span> dim;} |
| 149 | <a name="l00226"></a>00226 |
| 150 | <a name="l00227"></a>00227 <span class="preprocessor">#endif // DC_H</span> |
| 151 | </pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Thu Feb 28 16:54:40 2008 for mixpp by |