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 ); |
78 | | <a name="l00124"></a>00124 |
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(){}; |
| 52 | <a name="l00086"></a><a class="code" href="classsqmat.html#4268750c040c716b2c05037f725078a2">00086</a> <a class="code" href="classsqmat.html#4268750c040c716b2c05037f725078a2" title="Default constructor.">sqmat</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> dim0): <a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>(dim0){}; |
| 53 | <a name="l00087"></a>00087 <span class="keyword">protected</span>: |
| 54 | <a name="l00089"></a>00089 <span class="keywordtype">int</span> <a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>; |
| 55 | <a name="l00090"></a>00090 }; |
| 56 | <a name="l00091"></a>00091 |
| 57 | <a name="l00092"></a>00092 |
| 58 | <a name="l00097"></a><a class="code" href="classfsqmat.html">00097</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> |
| 59 | <a name="l00098"></a>00098 { |
| 60 | <a name="l00099"></a>00099 <span class="keyword">protected</span>: |
| 61 | <a name="l00101"></a><a class="code" href="classfsqmat.html#a7a1fcb9aae19d1e4daddfc9c22ce453">00101</a> mat <a class="code" href="classfsqmat.html#a7a1fcb9aae19d1e4daddfc9c22ce453" title="Full matrix on which the operations are performed.">M</a>; |
| 62 | <a name="l00102"></a>00102 <span class="keyword">public</span>: |
| 63 | <a name="l00103"></a>00103 <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 ); |
| 64 | <a name="l00104"></a>00104 mat <a class="code" href="classfsqmat.html#cedf4f048309056f4262c930914dfda8" title="Conversion to full matrix.">to_mat</a>() ; |
| 65 | <a name="l00105"></a>00105 <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); |
| 66 | <a name="l00106"></a>00106 <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); |
| 67 | <a name="l00108"></a>00108 <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) <span class="keyword">const</span>; |
| 68 | <a name="l00110"></a>00110 <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) <span class="keyword">const</span>; |
| 69 | <a name="l00111"></a>00111 <span class="keywordtype">void</span> <a class="code" href="classfsqmat.html#cfa4c359483d2322f32d1d50050f8ac4" title="Clearing matrix so that it corresponds to zeros.">clear</a>(); |
| 70 | <a name="l00112"></a>00112 |
| 71 | <a name="l00114"></a>00114 <a class="code" href="classfsqmat.html#79e3f73e0ccd663c7f7e08083d272940" title="Default initialization.">fsqmat</a>(); <span class="comment">// mat will be initialized OK</span> |
| 72 | <a name="l00116"></a>00116 <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> |
| 73 | <a name="l00118"></a>00118 <span class="comment"></span> <a class="code" href="classfsqmat.html#79e3f73e0ccd663c7f7e08083d272940" title="Default initialization.">fsqmat</a> ( <span class="keyword">const</span> mat &<a class="code" href="classfsqmat.html#a7a1fcb9aae19d1e4daddfc9c22ce453" title="Full matrix on which the operations are performed.">M</a> ); |
| 74 | <a name="l00119"></a>00119 |
| 75 | <a name="l00121"></a><a class="code" href="classfsqmat.html#2a8f104e4befbc2aa90d8b11edfedb2e">00121</a> <span class="keyword">virtual</span> <a class="code" href="classfsqmat.html#2a8f104e4befbc2aa90d8b11edfedb2e" title="Destructor for future use;.">~fsqmat</a>(){}; |
| 76 | <a name="l00122"></a>00122 |
| 77 | <a name="l00123"></a>00123 |
| 78 | <a name="l00129"></a>00129 <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 ); |
| 79 | <a name="l00130"></a>00130 |
| 80 | <a name="l00131"></a><a class="code" href="classfsqmat.html#eb0d1358f536e4453b5f99d0418ca1e5">00131</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 ( <a class="code" href="classfsqmat.html#a7a1fcb9aae19d1e4daddfc9c22ce453" title="Full matrix on which the operations are performed.">M</a> ) );}; |
| 81 | <a name="l00132"></a><a class="code" href="classfsqmat.html#a6c91b0389e73404324b2314b08d6e87">00132</a> <span class="keywordtype">double</span> <a class="code" href="classfsqmat.html#a6c91b0389e73404324b2314b08d6e87" title="Evaluates quadratic form $x= v&#39;*V*v$;.">qform</a> (<span class="keyword">const</span> vec &v )<span class="keyword"> const </span>{<span class="keywordflow">return</span> ( v* ( <a class="code" href="classfsqmat.html#a7a1fcb9aae19d1e4daddfc9c22ce453" title="Full matrix on which the operations are performed.">M</a>*v ) );}; |
| 82 | <a name="l00133"></a><a class="code" href="classfsqmat.html#842a774077ee34ac3c36d180ab33e103">00133</a> vec <a class="code" href="classfsqmat.html#842a774077ee34ac3c36d180ab33e103" title="Multiplies square root of $V$ by vector $x$.">sqrt_mult</a> (<span class="keyword">const</span> vec &v )<span class="keyword"> const </span>{it_error ( <span class="stringliteral">"not implemented"</span> );<span class="keywordflow">return</span> v;}; |
| 83 | <a name="l00134"></a>00134 |
| 84 | <a name="l00136"></a><a class="code" href="classfsqmat.html#514d1fdd8a382dbd6a774f2cf1ebd3de">00136</a> <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="classfsqmat.html#514d1fdd8a382dbd6a774f2cf1ebd3de" title="add another fsqmat matrix">operator += </a>( <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 ) {<a class="code" href="classfsqmat.html#a7a1fcb9aae19d1e4daddfc9c22ce453" title="Full matrix on which the operations are performed.">M</a>+=A.<a class="code" href="classfsqmat.html#a7a1fcb9aae19d1e4daddfc9c22ce453" title="Full matrix on which the operations are performed.">M</a>;<span class="keywordflow">return</span> *<span class="keyword">this</span>;}; |
| 85 | <a name="l00138"></a><a class="code" href="classfsqmat.html#e976bc9d899961e1d2087b0630ed33b7">00138</a> <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="classfsqmat.html#e976bc9d899961e1d2087b0630ed33b7" title="subtrack another fsqmat matrix">operator -= </a>( <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 ) {<a class="code" href="classfsqmat.html#a7a1fcb9aae19d1e4daddfc9c22ce453" title="Full matrix on which the operations are performed.">M</a>-=A.<a class="code" href="classfsqmat.html#a7a1fcb9aae19d1e4daddfc9c22ce453" title="Full matrix on which the operations are performed.">M</a>;<span class="keywordflow">return</span> *<span class="keyword">this</span>;}; |
| 86 | <a name="l00140"></a><a class="code" href="classfsqmat.html#8f7ce97628a50e06641281096b2af9b7">00140</a> <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="classfsqmat.html#8f7ce97628a50e06641281096b2af9b7" title="multiply by a scalar">operator *= </a>( <span class="keywordtype">double</span> x ) {<a class="code" href="classfsqmat.html#a7a1fcb9aae19d1e4daddfc9c22ce453" title="Full matrix on which the operations are performed.">M</a>*=x;<span class="keywordflow">return</span> *<span class="keyword">this</span>;}; |
| 87 | <a name="l00141"></a>00141 <span class="comment">// fsqmat& operator = ( const fsqmat &A) {M=A.M; return *this;};</span> |
| 88 | <a name="l00143"></a>00143 <span class="comment"></span> <span class="keyword">friend</span> std::ostream &<a class="code" href="classfsqmat.html#e06aba54d61e807b41bd68b5ee6ac22f" title="print full matrix">operator<< </a>( 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="l00144"></a>00144 |
| 90 | <a name="l00145"></a>00145 }; |
| 91 | <a name="l00146"></a>00146 |
| 92 | <a name="l00152"></a><a class="code" href="classldmat.html">00152</a> <span class="keyword">class </span><a class="code" href="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a>: <a class="code" href="classsqmat.html" title="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</a> |
| 93 | <a name="l00153"></a>00153 { |
| 94 | <a name="l00154"></a>00154 <span class="keyword">public</span>: |
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 ); |
118 | | <a name="l00170"></a>00170 |
119 | | <a name="l00176"></a>00176 <span class="keyword">virtual</span> <span class="keywordtype">void</span> inv ( ldmat &Inv ); |
120 | | <a name="l00177"></a>00177 |
121 | | <a name="l00183"></a>00183 <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, ldmat &U); |
122 | | <a name="l00184"></a>00184 |
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 ); |
| 96 | <a name="l00157"></a>00157 <a class="code" href="classldmat.html#a12dda6f529580b0377cc45226b43303" title="Default constructor.">ldmat</a> ( <span class="keyword">const</span> mat &<a class="code" href="classldmat.html#f74a64b99fe58a75ebd37bb679e121ea" title="Lower-triangular matrix $L$.">L</a>, <span class="keyword">const</span> vec &<a class="code" href="classldmat.html#4cce04824539c4a8d062d9a36d6e014e" title="Positive vector $D$.">D</a> ); |
| 97 | <a name="l00159"></a>00159 <a class="code" href="classldmat.html#a12dda6f529580b0377cc45226b43303" title="Default constructor.">ldmat</a> (<span class="keyword">const</span> mat &V ); |
| 98 | <a name="l00161"></a>00161 <a class="code" href="classldmat.html#a12dda6f529580b0377cc45226b43303" title="Default constructor.">ldmat</a> ( vec D0 ); |
| 99 | <a name="l00163"></a>00163 <a class="code" href="classldmat.html#a12dda6f529580b0377cc45226b43303" title="Default constructor.">ldmat</a> (); |
| 100 | <a name="l00165"></a>00165 <a class="code" href="classldmat.html#a12dda6f529580b0377cc45226b43303" title="Default constructor.">ldmat</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> dim0); |
| 101 | <a name="l00166"></a>00166 |
| 102 | <a name="l00168"></a><a class="code" href="classldmat.html#1e2734c0164ce5233c4d709679555138">00168</a> <span class="keyword">virtual</span> <a class="code" href="classldmat.html#1e2734c0164ce5233c4d709679555138" title="Destructor for future use;.">~ldmat</a>(){}; |
| 103 | <a name="l00169"></a>00169 |
| 104 | <a name="l00170"></a>00170 <span class="comment">// Reimplementation of compulsory operatios</span> |
| 105 | <a name="l00171"></a>00171 |
| 106 | <a name="l00172"></a>00172 <span class="keywordtype">void</span> <a class="code" href="classldmat.html#0f0f6e083e6d947cf58097ffce3ccd1a">opupdt</a> ( <span class="keyword">const</span> vec &v, <span class="keywordtype">double</span> w ); |
| 107 | <a name="l00173"></a>00173 mat <a class="code" href="classldmat.html#5b0515da8dc2293d9e4360b74cc26c9e" title="Conversion to full matrix.">to_mat</a>(); |
| 108 | <a name="l00174"></a>00174 <span class="keywordtype">void</span> <a class="code" href="classldmat.html#e967b9425007f0cb6cd59b845f9756d8" 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="l00175"></a>00175 <span class="keywordtype">void</span> <a class="code" href="classldmat.html#4fd155f38eb6dd5af4bdf9c98a7999a9" 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="l00177"></a>00177 <span class="keywordtype">void</span> <span class="keyword">add</span> ( <span class="keyword">const</span> <a class="code" href="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a> &ld2, <span class="keywordtype">double</span> w=1.0 ); |
| 111 | <a name="l00178"></a>00178 <span class="keywordtype">double</span> <a class="code" href="classldmat.html#2b42750ba4962d439aa52a77ae12949b" title="Logarithm of a determinant.">logdet</a>() <span class="keyword">const</span>; |
| 112 | <a name="l00179"></a>00179 <span class="keywordtype">double</span> <a class="code" href="classldmat.html#d64f331b781903e913cb2ee836886f3f" title="Evaluates quadratic form $x= v&#39;*V*v$;.">qform</a> (<span class="keyword">const</span> vec &v ) <span class="keyword">const</span>; |
| 113 | <a name="l00180"></a>00180 <span class="comment">// sqmat& operator -= ( const sqmat & ld2 );</span> |
| 114 | <a name="l00181"></a>00181 <span class="keywordtype">void</span> <a class="code" href="classldmat.html#4d6e401de9607332305c27e67972a07a" title="Clearing matrix so that it corresponds to zeros.">clear</a>(); |
| 115 | <a name="l00182"></a>00182 <span class="keywordtype">int</span> <a class="code" href="classldmat.html#0fceb6b5b637cec89bb0a3d2e6be1306" title="access function">cols</a>() <span class="keyword">const</span>; |
| 116 | <a name="l00183"></a>00183 <span class="keywordtype">int</span> <a class="code" href="classldmat.html#96dfb21865db4f5bd36fa70f9b0b1163" title="access function">rows</a>() <span class="keyword">const</span>; |
| 117 | <a name="l00184"></a>00184 vec <a class="code" href="classldmat.html#fc380626ced6f9244fb58c5f0231174d" title="Multiplies square root of $V$ by vector $x$.">sqrt_mult</a> ( <span class="keyword">const</span> vec &v ) <span class="keyword">const</span>; |
| 118 | <a name="l00185"></a>00185 |
| 119 | <a name="l00189"></a>00189 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classldmat.html#2c160cb123c1102face7a50ec566a031" title="Matrix inversion preserving the chosen form.">inv</a> ( <a class="code" href="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a> &Inv ) <span class="keyword">const</span>; |
| 120 | <a name="l00190"></a>00190 |
| 121 | <a name="l00195"></a>00195 <span class="keywordtype">void</span> <a class="code" href="classldmat.html#e967b9425007f0cb6cd59b845f9756d8" 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="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a> &U) <span class="keyword">const</span>; |
| 122 | <a name="l00196"></a>00196 |
| 123 | <a name="l00201"></a>00201 <span class="keywordtype">void</span> <a class="code" href="classldmat.html#4fd155f38eb6dd5af4bdf9c98a7999a9" 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="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a> &U) <span class="keyword">const</span>; |
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 |
| 125 | <a name="l00203"></a>00203 |
| 126 | <a name="l00210"></a>00210 <span class="keywordtype">void</span> <a class="code" href="classldmat.html#f291faa073e7bc8dfafc7ae93daa2506" title="Transforms general $A&#39;D0 A$ into pure $L&#39;DL$.">ldform</a> (<span class="keyword">const</span> mat &A,<span class="keyword">const</span> vec &D0 ); |
| 127 | <a name="l00211"></a>00211 |
| 128 | <a name="l00213"></a><a class="code" href="classldmat.html#0884a613b94fde61bfc84288e73ce57f">00213</a> <span class="keywordtype">void</span> <a class="code" href="classldmat.html#0884a613b94fde61bfc84288e73ce57f" title="Access functions.">setD</a> (<span class="keyword">const</span> vec &nD){D=nD;} |
| 129 | <a name="l00215"></a><a class="code" href="classldmat.html#7619922b4de18830ce5351c6b5667e60">00215</a> <span class="keywordtype">void</span> <a class="code" href="classldmat.html#0884a613b94fde61bfc84288e73ce57f" title="Access functions.">setD</a> (<span class="keyword">const</span> vec &nD, <span class="keywordtype">int</span> i){D.replace_mid(i,nD);} <span class="comment">//Fixme can be more general</span> |
| 130 | <a name="l00217"></a><a class="code" href="classldmat.html#32ff66296627ff5341d7c0b973249614">00217</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classldmat.html#32ff66296627ff5341d7c0b973249614" title="Access functions.">setL</a> (<span class="keyword">const</span> vec &nL){L=nL;} |
| 131 | <a name="l00218"></a>00218 |
| 132 | <a name="l00220"></a>00220 <a class="code" href="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a>& <a class="code" href="classldmat.html#ca445ee152a56043af946ea095b2d8f8" title="add another ldmat matrix">operator += </a>( <span class="keyword">const</span> <a class="code" href="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a> &ldA ); |
| 133 | <a name="l00222"></a>00222 <a class="code" href="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a>& <a class="code" href="classldmat.html#e3f4d2d85ab1ba384c852329aa31d0fb" title="subtract another ldmat matrix">operator -= </a>( <span class="keyword">const</span> <a class="code" href="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a> &ldA ); |
| 134 | <a name="l00224"></a>00224 <a class="code" href="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a>& <a class="code" href="classldmat.html#16871b2d54be6e5dc73f78b8cb90771c" title="multiply by a scalar">operator *= </a>( <span class="keywordtype">double</span> x ); |
| 135 | <a name="l00225"></a>00225 |
| 136 | <a name="l00227"></a>00227 <span class="keyword">friend</span> std::ostream &<a class="code" href="classldmat.html#eaaa0baa6026b84cfcbced41c84599d1" title="print both L and D ">operator<< </a>( std::ostream &os, <span class="keyword">const</span> <a class="code" href="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a> &sq ); |
| 137 | <a name="l00228"></a>00228 |
| 138 | <a name="l00229"></a>00229 |
| 139 | <a name="l00230"></a>00230 <span class="keyword">protected</span>: |
| 140 | <a name="l00232"></a><a class="code" href="classldmat.html#4cce04824539c4a8d062d9a36d6e014e">00232</a> vec D; |
| 141 | <a name="l00234"></a><a class="code" href="classldmat.html#f74a64b99fe58a75ebd37bb679e121ea">00234</a> mat L; |
| 142 | <a name="l00235"></a>00235 |
| 143 | <a name="l00236"></a>00236 }; |
| 144 | <a name="l00237"></a>00237 |
| 145 | <a name="l00240"></a><a class="code" href="classldmat.html#ca445ee152a56043af946ea095b2d8f8">00240</a> <span class="keyword">inline</span> <a class="code" href="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a>& <a class="code" href="classldmat.html#ca445ee152a56043af946ea095b2d8f8" title="add another ldmat matrix">ldmat::operator += </a>( <span class="keyword">const</span> <a class="code" href="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a> &ldA ) {this-><span class="keyword">add</span> ( ldA );<span class="keywordflow">return</span> *<span class="keyword">this</span>;} |
| 146 | <a name="l00242"></a><a class="code" href="classldmat.html#e3f4d2d85ab1ba384c852329aa31d0fb">00242</a> <span class="keyword">inline</span> <a class="code" href="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a>& <a class="code" href="classldmat.html#e3f4d2d85ab1ba384c852329aa31d0fb" title="subtract another ldmat matrix">ldmat::operator -= </a>( <span class="keyword">const</span> <a class="code" href="classldmat.html" title="Matrix stored in LD form, (typically known as UD).">ldmat</a> &ldA ) {this-><span class="keyword">add</span> ( ldA,-1.0 );<span class="keywordflow">return</span> *<span class="keyword">this</span>;} |
| 147 | <a name="l00244"></a><a class="code" href="classldmat.html#0fceb6b5b637cec89bb0a3d2e6be1306">00244</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classldmat.html#0fceb6b5b637cec89bb0a3d2e6be1306" title="access function">ldmat::cols</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>;} |
| 148 | <a name="l00246"></a><a class="code" href="classldmat.html#96dfb21865db4f5bd36fa70f9b0b1163">00246</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classldmat.html#96dfb21865db4f5bd36fa70f9b0b1163" title="access function">ldmat::rows</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classsqmat.html#0abed904bdc0882373ba9adba919689d" title="dimension of the square matrix">dim</a>;} |
| 149 | <a name="l00247"></a>00247 |
| 150 | <a name="l00248"></a>00248 <span class="preprocessor">#endif // DC_H</span> |
| 151 | </pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Wed Mar 5 15:40:00 2008 for mixpp by |