1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
3 | <title>mixpp: Diagonal Matrices and Functions</title> |
---|
4 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
5 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
6 | </head><body> |
---|
7 | <!-- Generated by Doxygen 1.5.8 --> |
---|
8 | <script type="text/javascript"> |
---|
9 | <!-- |
---|
10 | function changeDisplayState (e){ |
---|
11 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
12 | var button=this.firstChild; |
---|
13 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
14 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
15 | sectionDiv.style.display='block'; |
---|
16 | button.src='open.gif'; |
---|
17 | }else{ |
---|
18 | sectionDiv.style.display='none'; |
---|
19 | button.src='closed.gif'; |
---|
20 | } |
---|
21 | } |
---|
22 | function initDynSections(){ |
---|
23 | var divs=document.getElementsByTagName('div'); |
---|
24 | var sectionCounter=1; |
---|
25 | for(var i=0;i<divs.length-1;i++){ |
---|
26 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
27 | var header=divs[i]; |
---|
28 | var section=divs[i+1]; |
---|
29 | var button=header.firstChild; |
---|
30 | if (button!='IMG'){ |
---|
31 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
32 | button=document.createElement('img'); |
---|
33 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
34 | } |
---|
35 | header.style.cursor='pointer'; |
---|
36 | header.onclick=changeDisplayState; |
---|
37 | header.id='dynheader'+sectionCounter; |
---|
38 | button.src='closed.gif'; |
---|
39 | section.id='dynsection'+sectionCounter; |
---|
40 | section.style.display='none'; |
---|
41 | section.style.marginLeft='14px'; |
---|
42 | sectionCounter++; |
---|
43 | } |
---|
44 | } |
---|
45 | } |
---|
46 | window.onload = initDynSections; |
---|
47 | --> |
---|
48 | </script> |
---|
49 | <div class="navigation" id="top"> |
---|
50 | <div class="tabs"> |
---|
51 | <ul> |
---|
52 | <li><a href="main.html"><span>Main Page</span></a></li> |
---|
53 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
54 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
55 | <li><a href="annotated.html"><span>Classes</span></a></li> |
---|
56 | <li><a href="files.html"><span>Files</span></a></li> |
---|
57 | </ul> |
---|
58 | </div> |
---|
59 | </div> |
---|
60 | <div class="contents"> |
---|
61 | <h1>Diagonal Matrices and Functions<br> |
---|
62 | <small> |
---|
63 | [<a class="el" href="group__base.html">Base Module</a>]</small> |
---|
64 | </h1><table border="0" cellpadding="0" cellspacing="0"> |
---|
65 | <tr><td></td></tr> |
---|
66 | <tr><td colspan="2"><br><h2>Functions</h2></td></tr> |
---|
67 | <tr><td class="memTemplParams" nowrap colspan="2">template<class T > </td></tr> |
---|
68 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">Mat< T > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__diag.html#g1a5019e9703cd9f87c3914ab298714ff">itpp::diag</a> (const Vec< T > &v, const int K=0)</td></tr> |
---|
69 | |
---|
70 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a diagonal matrix using vector <code>v</code> as its diagonal. <a href="#g1a5019e9703cd9f87c3914ab298714ff"></a><br></td></tr> |
---|
71 | <tr><td class="memTemplParams" nowrap colspan="2">template<class T > </td></tr> |
---|
72 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__diag.html#g853c555c28b2c812f39962d272ae33ac">itpp::diag</a> (const Vec< T > &v, Mat< T > &m)</td></tr> |
---|
73 | |
---|
74 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a diagonal matrix using vector <code>v</code> as its diagonal. <a href="#g853c555c28b2c812f39962d272ae33ac"></a><br></td></tr> |
---|
75 | <tr><td class="memTemplParams" nowrap colspan="2">template<class T > </td></tr> |
---|
76 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">Vec< T > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__diag.html#gb0938c932c1cbc19b2ce6c5ac1007553">itpp::diag</a> (const Mat< T > &m)</td></tr> |
---|
77 | |
---|
78 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the diagonal elements of the input matrix <code>m</code>. <a href="#gb0938c932c1cbc19b2ce6c5ac1007553"></a><br></td></tr> |
---|
79 | <tr><td class="memTemplParams" nowrap colspan="2">template<class T > </td></tr> |
---|
80 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">Mat< T > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__diag.html#g9f2b6719c7de2f116bc794e406c952cc">itpp::bidiag</a> (const Vec< T > &main, const Vec< T > &sup)</td></tr> |
---|
81 | |
---|
82 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a matrix with the elements of the input vector <code>main</code> on the diagonal and the elements of the input vector <code>sup</code> on the diagonal row above. <a href="#g9f2b6719c7de2f116bc794e406c952cc"></a><br></td></tr> |
---|
83 | <tr><td class="memTemplParams" nowrap colspan="2">template<class T > </td></tr> |
---|
84 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__diag.html#g2d7f36dc45fb3098131111d172f5b08d">itpp::bidiag</a> (const Vec< T > &main, const Vec< T > &sup, Mat< T > &m)</td></tr> |
---|
85 | |
---|
86 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns in the output variable <code>m</code> a matrix with the elements of the input vector <code>main</code> on the diagonal and the elements of the input vector <code>sup</code> on the diagonal row above. <a href="#g2d7f36dc45fb3098131111d172f5b08d"></a><br></td></tr> |
---|
87 | <tr><td class="memTemplParams" nowrap colspan="2">template<class T > </td></tr> |
---|
88 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__diag.html#g6b51bb44b5a610731b34f7f0ed2f4748">itpp::bidiag</a> (const Mat< T > &m, Vec< T > &main, Vec< T > &sup)</td></tr> |
---|
89 | |
---|
90 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the main diagonal and the diagonal row above in the two output vectors <code>main</code> and <code>sup</code>. <a href="#g6b51bb44b5a610731b34f7f0ed2f4748"></a><br></td></tr> |
---|
91 | <tr><td class="memTemplParams" nowrap colspan="2">template<class T > </td></tr> |
---|
92 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">Mat< T > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__diag.html#g0ff63d5f0db74b830fa918a1866c440b">itpp::tridiag</a> (const Vec< T > &main, const Vec< T > &sup, const Vec< T > &sub)</td></tr> |
---|
93 | |
---|
94 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a matrix with the elements of <code>main</code> on the diagonal, the elements of <code>sup</code> on the diagonal row above, and the elements of <code>sub</code> on the diagonal row below. <a href="#g0ff63d5f0db74b830fa918a1866c440b"></a><br></td></tr> |
---|
95 | <tr><td class="memTemplParams" nowrap colspan="2">template<class T > </td></tr> |
---|
96 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__diag.html#geb2b140f8d64b19d7a4462464c59cdca">itpp::tridiag</a> (const Vec< T > &main, const Vec< T > &sup, const Vec< T > &sub, Mat< T > &m)</td></tr> |
---|
97 | |
---|
98 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns in the output matrix <code>m</code> a matrix with the elements of <code>main</code> on the diagonal, the elements of <code>sup</code> on the diagonal row above, and the elements of <code>sub</code> on the diagonal row below. <a href="#geb2b140f8d64b19d7a4462464c59cdca"></a><br></td></tr> |
---|
99 | <tr><td class="memTemplParams" nowrap colspan="2">template<class T > </td></tr> |
---|
100 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__diag.html#g16dfe03af37710450c28943a3fc4433e">itpp::tridiag</a> (const Mat< T > &m, Vec< T > &main, Vec< T > &sup, Vec< T > &sub)</td></tr> |
---|
101 | |
---|
102 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the main diagonal, the diagonal row above, and the diagonal row below int the output vectors <code>main</code>, <code>sup</code>, and <code>sub</code>. <a href="#g16dfe03af37710450c28943a3fc4433e"></a><br></td></tr> |
---|
103 | <tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="gd10b393e16f1a426b6daed5b9b78c3fb"></a><!-- doxytag: member="diag::trace" ref="gd10b393e16f1a426b6daed5b9b78c3fb" args="(const Mat< T > &m)" --> |
---|
104 | template<class T > </td></tr> |
---|
105 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__diag.html#gd10b393e16f1a426b6daed5b9b78c3fb">itpp::trace</a> (const Mat< T > &m)</td></tr> |
---|
106 | |
---|
107 | <tr><td class="mdescLeft"> </td><td class="mdescRight">The trace of the matrix <code>m</code>, i.e. the sum of the diagonal elements. <br></td></tr> |
---|
108 | </table> |
---|
109 | <hr><h2>Function Documentation</h2> |
---|
110 | <a class="anchor" name="g6b51bb44b5a610731b34f7f0ed2f4748"></a><!-- doxytag: member="itpp::bidiag" ref="g6b51bb44b5a610731b34f7f0ed2f4748" args="(const Mat< T > &m, Vec< T > &main, Vec< T > &sup)" --> |
---|
111 | <div class="memitem"> |
---|
112 | <div class="memproto"> |
---|
113 | <div class="memtemplate"> |
---|
114 | template<class T > </div> |
---|
115 | <table class="memname"> |
---|
116 | <tr> |
---|
117 | <td class="memname">void itpp::bidiag </td> |
---|
118 | <td>(</td> |
---|
119 | <td class="paramtype">const Mat< T > & </td> |
---|
120 | <td class="paramname"> <em>m</em>, </td> |
---|
121 | </tr> |
---|
122 | <tr> |
---|
123 | <td class="paramkey"></td> |
---|
124 | <td></td> |
---|
125 | <td class="paramtype">Vec< T > & </td> |
---|
126 | <td class="paramname"> <em>main</em>, </td> |
---|
127 | </tr> |
---|
128 | <tr> |
---|
129 | <td class="paramkey"></td> |
---|
130 | <td></td> |
---|
131 | <td class="paramtype">Vec< T > & </td> |
---|
132 | <td class="paramname"> <em>sup</em></td><td> </td> |
---|
133 | </tr> |
---|
134 | <tr> |
---|
135 | <td></td> |
---|
136 | <td>)</td> |
---|
137 | <td></td><td></td><td><code> [inline]</code></td> |
---|
138 | </tr> |
---|
139 | </table> |
---|
140 | </div> |
---|
141 | <div class="memdoc"> |
---|
142 | |
---|
143 | <p> |
---|
144 | Returns the main diagonal and the diagonal row above in the two output vectors <code>main</code> and <code>sup</code>. |
---|
145 | <p> |
---|
146 | The input matrix <code>in</code> must be a square <img class="formulaInl" alt="$n \times n$" src="form_126.png"> matrix. The length of the output vector <code>main</code> will be <img class="formulaInl" alt="$n$" src="form_61.png"> and the length of the output vector <code>sup</code> will be <img class="formulaInl" alt="$n-1$" src="form_182.png">. |
---|
147 | <p>References <a class="el" href="mat_8h-source.html#l00241">itpp::Mat< Num_T >::cols()</a>, <a class="el" href="itassert_8h-source.html#l00094">it_assert</a>, <a class="el" href="mat_8h-source.html#l00243">itpp::Mat< Num_T >::rows()</a>, and <a class="el" href="vec_8h-source.html#l00676">itpp::Vec< Num_T >::set_size()</a>.</p> |
---|
148 | |
---|
149 | </div> |
---|
150 | </div><p> |
---|
151 | <a class="anchor" name="g2d7f36dc45fb3098131111d172f5b08d"></a><!-- doxytag: member="itpp::bidiag" ref="g2d7f36dc45fb3098131111d172f5b08d" args="(const Vec< T > &main, const Vec< T > &sup, Mat< T > &m)" --> |
---|
152 | <div class="memitem"> |
---|
153 | <div class="memproto"> |
---|
154 | <div class="memtemplate"> |
---|
155 | template<class T > </div> |
---|
156 | <table class="memname"> |
---|
157 | <tr> |
---|
158 | <td class="memname">void itpp::bidiag </td> |
---|
159 | <td>(</td> |
---|
160 | <td class="paramtype">const Vec< T > & </td> |
---|
161 | <td class="paramname"> <em>main</em>, </td> |
---|
162 | </tr> |
---|
163 | <tr> |
---|
164 | <td class="paramkey"></td> |
---|
165 | <td></td> |
---|
166 | <td class="paramtype">const Vec< T > & </td> |
---|
167 | <td class="paramname"> <em>sup</em>, </td> |
---|
168 | </tr> |
---|
169 | <tr> |
---|
170 | <td class="paramkey"></td> |
---|
171 | <td></td> |
---|
172 | <td class="paramtype">Mat< T > & </td> |
---|
173 | <td class="paramname"> <em>m</em></td><td> </td> |
---|
174 | </tr> |
---|
175 | <tr> |
---|
176 | <td></td> |
---|
177 | <td>)</td> |
---|
178 | <td></td><td></td><td><code> [inline]</code></td> |
---|
179 | </tr> |
---|
180 | </table> |
---|
181 | </div> |
---|
182 | <div class="memdoc"> |
---|
183 | |
---|
184 | <p> |
---|
185 | Returns in the output variable <code>m</code> a matrix with the elements of the input vector <code>main</code> on the diagonal and the elements of the input vector <code>sup</code> on the diagonal row above. |
---|
186 | <p> |
---|
187 | If the number of elements in the vector <code>main</code> is <img class="formulaInl" alt="$n$" src="form_61.png">, then the number of elements in the input vector <code>sup</code> must be <img class="formulaInl" alt="$n-1$" src="form_182.png">. The size of the output matrix <code>m</code> will be <img class="formulaInl" alt="$n \times n$" src="form_126.png">. |
---|
188 | <p>References <a class="el" href="itassert_8h-source.html#l00094">it_assert</a>, <a class="el" href="mat_8h-source.html#l00661">itpp::Mat< Num_T >::set_size()</a>, and <a class="el" href="vec_8h-source.html#l00277">itpp::Vec< Num_T >::size()</a>.</p> |
---|
189 | |
---|
190 | </div> |
---|
191 | </div><p> |
---|
192 | <a class="anchor" name="g9f2b6719c7de2f116bc794e406c952cc"></a><!-- doxytag: member="itpp::bidiag" ref="g9f2b6719c7de2f116bc794e406c952cc" args="(const Vec< T > &main, const Vec< T > &sup)" --> |
---|
193 | <div class="memitem"> |
---|
194 | <div class="memproto"> |
---|
195 | <div class="memtemplate"> |
---|
196 | template<class T > </div> |
---|
197 | <table class="memname"> |
---|
198 | <tr> |
---|
199 | <td class="memname">Mat<T> itpp::bidiag </td> |
---|
200 | <td>(</td> |
---|
201 | <td class="paramtype">const Vec< T > & </td> |
---|
202 | <td class="paramname"> <em>main</em>, </td> |
---|
203 | </tr> |
---|
204 | <tr> |
---|
205 | <td class="paramkey"></td> |
---|
206 | <td></td> |
---|
207 | <td class="paramtype">const Vec< T > & </td> |
---|
208 | <td class="paramname"> <em>sup</em></td><td> </td> |
---|
209 | </tr> |
---|
210 | <tr> |
---|
211 | <td></td> |
---|
212 | <td>)</td> |
---|
213 | <td></td><td></td><td><code> [inline]</code></td> |
---|
214 | </tr> |
---|
215 | </table> |
---|
216 | </div> |
---|
217 | <div class="memdoc"> |
---|
218 | |
---|
219 | <p> |
---|
220 | Returns a matrix with the elements of the input vector <code>main</code> on the diagonal and the elements of the input vector <code>sup</code> on the diagonal row above. |
---|
221 | <p> |
---|
222 | If the number of elements in the vector <code>main</code> is <img class="formulaInl" alt="$n$" src="form_61.png">, then the number of elements in the input vector <code>sup</code> must be <img class="formulaInl" alt="$n-1$" src="form_182.png">. The size of the return matrix will be <img class="formulaInl" alt="$n \times n$" src="form_126.png">. |
---|
223 | <p>References <a class="el" href="itassert_8h-source.html#l00094">it_assert</a>, and <a class="el" href="vec_8h-source.html#l00277">itpp::Vec< Num_T >::size()</a>.</p> |
---|
224 | |
---|
225 | </div> |
---|
226 | </div><p> |
---|
227 | <a class="anchor" name="gb0938c932c1cbc19b2ce6c5ac1007553"></a><!-- doxytag: member="itpp::diag" ref="gb0938c932c1cbc19b2ce6c5ac1007553" args="(const Mat< T > &m)" --> |
---|
228 | <div class="memitem"> |
---|
229 | <div class="memproto"> |
---|
230 | <div class="memtemplate"> |
---|
231 | template<class T > </div> |
---|
232 | <table class="memname"> |
---|
233 | <tr> |
---|
234 | <td class="memname">Vec<T> itpp::diag </td> |
---|
235 | <td>(</td> |
---|
236 | <td class="paramtype">const Mat< T > & </td> |
---|
237 | <td class="paramname"> <em>m</em> </td> |
---|
238 | <td> ) </td> |
---|
239 | <td><code> [inline]</code></td> |
---|
240 | </tr> |
---|
241 | </table> |
---|
242 | </div> |
---|
243 | <div class="memdoc"> |
---|
244 | |
---|
245 | <p> |
---|
246 | Get the diagonal elements of the input matrix <code>m</code>. |
---|
247 | <p> |
---|
248 | The size of the output vector with diagonal elements will be <img class="formulaInl" alt="$n = min(r, c)$" src="form_180.png">, where <img class="formulaInl" alt="$r \times c$" src="form_181.png"> are the dimensions of matrix <code>m</code>. |
---|
249 | <p>References <a class="el" href="mat_8h-source.html#l00241">itpp::Mat< Num_T >::cols()</a>, <a class="el" href="tcp_8h-source.html#l00115">itpp::min()</a>, <a class="el" href="mat_8h-source.html#l00243">itpp::Mat< Num_T >::rows()</a>, and <a class="el" href="vec_8h-source.html#l00277">itpp::Vec< Num_T >::size()</a>.</p> |
---|
250 | |
---|
251 | <p>Referenced by <a class="el" href="libEF__ui_8h-source.html#l00049">UImgnorm::build()</a>, <a class="el" href="arx__ui_8h-source.html#l00044">UIARX::build()</a>, <a class="el" href="ekf__templ_8h-source.html#l00023">bdm::EKFful_unQR::condition()</a>, <a class="el" href="mog__generic_8cpp-source.html#l00486">itpp::MOG_generic::convert_to_diag_internal()</a>, <a class="el" href="mog__generic_8cpp-source.html#l00506">itpp::MOG_generic::convert_to_full_internal()</a>, <a class="el" href="libEF_8cpp-source.html#l00082">bdm::egiw::est_theta_cov()</a>, <a class="el" href="libDC_8h-source.html#l00143">fsqmat::fsqmat()</a>, <a class="el" href="libDC_8h-source.html#l00167">fsqmat::getD()</a>, <a class="el" href="libDC_8cpp-source.html#l00200">ldmat::ldform()</a>, <a class="el" href="poly_8cpp-source.html#l00066">itpp::roots()</a>, <a class="el" href="fastica_8cpp-source.html#l00126">itpp::Fast_ICA::separate()</a>, <a class="el" href="libDC_8h-source.html#l00165">fsqmat::setD()</a>, <a class="el" href="chmat_8h-source.html#l00071">chmat::setD()</a>, <a class="el" href="libDC_8cpp-source.html#l00080">ldmat::to_mat()</a>, <a class="el" href="matfunc_8h-source.html#l00762">itpp::trace()</a>, <a class="el" href="libEF_8h-source.html#l00140">bdm::enorm< fsqmat >::variance()</a>, and <a class="el" href="libEF_8cpp-source.html#l00121">bdm::egiw::variance()</a>.</p> |
---|
252 | |
---|
253 | </div> |
---|
254 | </div><p> |
---|
255 | <a class="anchor" name="g853c555c28b2c812f39962d272ae33ac"></a><!-- doxytag: member="itpp::diag" ref="g853c555c28b2c812f39962d272ae33ac" args="(const Vec< T > &v, Mat< T > &m)" --> |
---|
256 | <div class="memitem"> |
---|
257 | <div class="memproto"> |
---|
258 | <div class="memtemplate"> |
---|
259 | template<class T > </div> |
---|
260 | <table class="memname"> |
---|
261 | <tr> |
---|
262 | <td class="memname">void itpp::diag </td> |
---|
263 | <td>(</td> |
---|
264 | <td class="paramtype">const Vec< T > & </td> |
---|
265 | <td class="paramname"> <em>v</em>, </td> |
---|
266 | </tr> |
---|
267 | <tr> |
---|
268 | <td class="paramkey"></td> |
---|
269 | <td></td> |
---|
270 | <td class="paramtype">Mat< T > & </td> |
---|
271 | <td class="paramname"> <em>m</em></td><td> </td> |
---|
272 | </tr> |
---|
273 | <tr> |
---|
274 | <td></td> |
---|
275 | <td>)</td> |
---|
276 | <td></td><td></td><td><code> [inline]</code></td> |
---|
277 | </tr> |
---|
278 | </table> |
---|
279 | </div> |
---|
280 | <div class="memdoc"> |
---|
281 | |
---|
282 | <p> |
---|
283 | Create a diagonal matrix using vector <code>v</code> as its diagonal. |
---|
284 | <p> |
---|
285 | All other matrix elements except the ones on its diagonal are set to zero.<p> |
---|
286 | The size of the diagonal matrix will be <img class="formulaInl" alt="$n \times n$" src="form_126.png">, where <img class="formulaInl" alt="$n$" src="form_61.png"> is the length of the input vector <code>v</code>. |
---|
287 | <p>References <a class="el" href="mat_8h-source.html#l00661">itpp::Mat< Num_T >::set_size()</a>, and <a class="el" href="vec_8h-source.html#l00277">itpp::Vec< Num_T >::size()</a>.</p> |
---|
288 | |
---|
289 | </div> |
---|
290 | </div><p> |
---|
291 | <a class="anchor" name="g1a5019e9703cd9f87c3914ab298714ff"></a><!-- doxytag: member="itpp::diag" ref="g1a5019e9703cd9f87c3914ab298714ff" args="(const Vec< T > &v, const int K=0)" --> |
---|
292 | <div class="memitem"> |
---|
293 | <div class="memproto"> |
---|
294 | <div class="memtemplate"> |
---|
295 | template<class T > </div> |
---|
296 | <table class="memname"> |
---|
297 | <tr> |
---|
298 | <td class="memname">Mat<T> itpp::diag </td> |
---|
299 | <td>(</td> |
---|
300 | <td class="paramtype">const Vec< T > & </td> |
---|
301 | <td class="paramname"> <em>v</em>, </td> |
---|
302 | </tr> |
---|
303 | <tr> |
---|
304 | <td class="paramkey"></td> |
---|
305 | <td></td> |
---|
306 | <td class="paramtype">const int </td> |
---|
307 | <td class="paramname"> <em>K</em> = <code>0</code></td><td> </td> |
---|
308 | </tr> |
---|
309 | <tr> |
---|
310 | <td></td> |
---|
311 | <td>)</td> |
---|
312 | <td></td><td></td><td><code> [inline]</code></td> |
---|
313 | </tr> |
---|
314 | </table> |
---|
315 | </div> |
---|
316 | <div class="memdoc"> |
---|
317 | |
---|
318 | <p> |
---|
319 | Create a diagonal matrix using vector <code>v</code> as its diagonal. |
---|
320 | <p> |
---|
321 | All other matrix elements except the ones on its diagonal are set to zero. An optional parameter <code>K</code> can be used to shift the diagonal in the resulting matrix. By default <code>K</code> is equal to zero.<p> |
---|
322 | The size of the diagonal matrix will be <img class="formulaInl" alt="$n+|K| \times n+|K|$" src="form_179.png">, where <img class="formulaInl" alt="$n$" src="form_61.png"> is the length of the input vector <code>v</code>. |
---|
323 | <p>References <a class="el" href="fix__functions_8cpp-source.html#l00076">itpp::abs()</a>, and <a class="el" href="vec_8h-source.html#l00277">itpp::Vec< Num_T >::size()</a>.</p> |
---|
324 | |
---|
325 | </div> |
---|
326 | </div><p> |
---|
327 | <a class="anchor" name="g16dfe03af37710450c28943a3fc4433e"></a><!-- doxytag: member="itpp::tridiag" ref="g16dfe03af37710450c28943a3fc4433e" args="(const Mat< T > &m, Vec< T > &main, Vec< T > &sup, Vec< T > &sub)" --> |
---|
328 | <div class="memitem"> |
---|
329 | <div class="memproto"> |
---|
330 | <div class="memtemplate"> |
---|
331 | template<class T > </div> |
---|
332 | <table class="memname"> |
---|
333 | <tr> |
---|
334 | <td class="memname">void itpp::tridiag </td> |
---|
335 | <td>(</td> |
---|
336 | <td class="paramtype">const Mat< T > & </td> |
---|
337 | <td class="paramname"> <em>m</em>, </td> |
---|
338 | </tr> |
---|
339 | <tr> |
---|
340 | <td class="paramkey"></td> |
---|
341 | <td></td> |
---|
342 | <td class="paramtype">Vec< T > & </td> |
---|
343 | <td class="paramname"> <em>main</em>, </td> |
---|
344 | </tr> |
---|
345 | <tr> |
---|
346 | <td class="paramkey"></td> |
---|
347 | <td></td> |
---|
348 | <td class="paramtype">Vec< T > & </td> |
---|
349 | <td class="paramname"> <em>sup</em>, </td> |
---|
350 | </tr> |
---|
351 | <tr> |
---|
352 | <td class="paramkey"></td> |
---|
353 | <td></td> |
---|
354 | <td class="paramtype">Vec< T > & </td> |
---|
355 | <td class="paramname"> <em>sub</em></td><td> </td> |
---|
356 | </tr> |
---|
357 | <tr> |
---|
358 | <td></td> |
---|
359 | <td>)</td> |
---|
360 | <td></td><td></td><td><code> [inline]</code></td> |
---|
361 | </tr> |
---|
362 | </table> |
---|
363 | </div> |
---|
364 | <div class="memdoc"> |
---|
365 | |
---|
366 | <p> |
---|
367 | Returns the main diagonal, the diagonal row above, and the diagonal row below int the output vectors <code>main</code>, <code>sup</code>, and <code>sub</code>. |
---|
368 | <p> |
---|
369 | The input matrix <code>m</code> must be a square <img class="formulaInl" alt="$n \times n$" src="form_126.png"> matrix. The length of the output vector <code>main</code> will be <img class="formulaInl" alt="$n$" src="form_61.png"> and the length of the output vectors <code>sup</code> and <code>sup</code> will be <img class="formulaInl" alt="$n-1$" src="form_182.png">. |
---|
370 | <p>References <a class="el" href="mat_8h-source.html#l00241">itpp::Mat< Num_T >::cols()</a>, <a class="el" href="itassert_8h-source.html#l00094">it_assert</a>, <a class="el" href="mat_8h-source.html#l00243">itpp::Mat< Num_T >::rows()</a>, and <a class="el" href="vec_8h-source.html#l00676">itpp::Vec< Num_T >::set_size()</a>.</p> |
---|
371 | |
---|
372 | </div> |
---|
373 | </div><p> |
---|
374 | <a class="anchor" name="geb2b140f8d64b19d7a4462464c59cdca"></a><!-- doxytag: member="itpp::tridiag" ref="geb2b140f8d64b19d7a4462464c59cdca" args="(const Vec< T > &main, const Vec< T > &sup, const Vec< T > &sub, Mat< T > &m)" --> |
---|
375 | <div class="memitem"> |
---|
376 | <div class="memproto"> |
---|
377 | <div class="memtemplate"> |
---|
378 | template<class T > </div> |
---|
379 | <table class="memname"> |
---|
380 | <tr> |
---|
381 | <td class="memname">void itpp::tridiag </td> |
---|
382 | <td>(</td> |
---|
383 | <td class="paramtype">const Vec< T > & </td> |
---|
384 | <td class="paramname"> <em>main</em>, </td> |
---|
385 | </tr> |
---|
386 | <tr> |
---|
387 | <td class="paramkey"></td> |
---|
388 | <td></td> |
---|
389 | <td class="paramtype">const Vec< T > & </td> |
---|
390 | <td class="paramname"> <em>sup</em>, </td> |
---|
391 | </tr> |
---|
392 | <tr> |
---|
393 | <td class="paramkey"></td> |
---|
394 | <td></td> |
---|
395 | <td class="paramtype">const Vec< T > & </td> |
---|
396 | <td class="paramname"> <em>sub</em>, </td> |
---|
397 | </tr> |
---|
398 | <tr> |
---|
399 | <td class="paramkey"></td> |
---|
400 | <td></td> |
---|
401 | <td class="paramtype">Mat< T > & </td> |
---|
402 | <td class="paramname"> <em>m</em></td><td> </td> |
---|
403 | </tr> |
---|
404 | <tr> |
---|
405 | <td></td> |
---|
406 | <td>)</td> |
---|
407 | <td></td><td></td><td><code> [inline]</code></td> |
---|
408 | </tr> |
---|
409 | </table> |
---|
410 | </div> |
---|
411 | <div class="memdoc"> |
---|
412 | |
---|
413 | <p> |
---|
414 | Returns in the output matrix <code>m</code> a matrix with the elements of <code>main</code> on the diagonal, the elements of <code>sup</code> on the diagonal row above, and the elements of <code>sub</code> on the diagonal row below. |
---|
415 | <p> |
---|
416 | If the length of the input vector <code>main</code> is <img class="formulaInl" alt="$n$" src="form_61.png"> then the lengths of the vectors <code>sup</code> and <code>sub</code> must equal <img class="formulaInl" alt="$n-1$" src="form_182.png">. The size of the output matrix <code>m</code> will be <img class="formulaInl" alt="$n \times n$" src="form_126.png">. |
---|
417 | <p>References <a class="el" href="itassert_8h-source.html#l00094">it_assert</a>, <a class="el" href="mat_8h-source.html#l00661">itpp::Mat< Num_T >::set_size()</a>, and <a class="el" href="vec_8h-source.html#l00277">itpp::Vec< Num_T >::size()</a>.</p> |
---|
418 | |
---|
419 | </div> |
---|
420 | </div><p> |
---|
421 | <a class="anchor" name="g0ff63d5f0db74b830fa918a1866c440b"></a><!-- doxytag: member="itpp::tridiag" ref="g0ff63d5f0db74b830fa918a1866c440b" args="(const Vec< T > &main, const Vec< T > &sup, const Vec< T > &sub)" --> |
---|
422 | <div class="memitem"> |
---|
423 | <div class="memproto"> |
---|
424 | <div class="memtemplate"> |
---|
425 | template<class T > </div> |
---|
426 | <table class="memname"> |
---|
427 | <tr> |
---|
428 | <td class="memname">Mat<T> itpp::tridiag </td> |
---|
429 | <td>(</td> |
---|
430 | <td class="paramtype">const Vec< T > & </td> |
---|
431 | <td class="paramname"> <em>main</em>, </td> |
---|
432 | </tr> |
---|
433 | <tr> |
---|
434 | <td class="paramkey"></td> |
---|
435 | <td></td> |
---|
436 | <td class="paramtype">const Vec< T > & </td> |
---|
437 | <td class="paramname"> <em>sup</em>, </td> |
---|
438 | </tr> |
---|
439 | <tr> |
---|
440 | <td class="paramkey"></td> |
---|
441 | <td></td> |
---|
442 | <td class="paramtype">const Vec< T > & </td> |
---|
443 | <td class="paramname"> <em>sub</em></td><td> </td> |
---|
444 | </tr> |
---|
445 | <tr> |
---|
446 | <td></td> |
---|
447 | <td>)</td> |
---|
448 | <td></td><td></td><td><code> [inline]</code></td> |
---|
449 | </tr> |
---|
450 | </table> |
---|
451 | </div> |
---|
452 | <div class="memdoc"> |
---|
453 | |
---|
454 | <p> |
---|
455 | Returns a matrix with the elements of <code>main</code> on the diagonal, the elements of <code>sup</code> on the diagonal row above, and the elements of <code>sub</code> on the diagonal row below. |
---|
456 | <p> |
---|
457 | If the length of the input vector <code>main</code> is <img class="formulaInl" alt="$n$" src="form_61.png"> then the lengths of the vectors <code>sup</code> and <code>sub</code> must equal <img class="formulaInl" alt="$n-1$" src="form_182.png">. The size of the return matrix will be <img class="formulaInl" alt="$n \times n$" src="form_126.png">. |
---|
458 | <p>References <a class="el" href="itassert_8h-source.html#l00094">it_assert</a>, and <a class="el" href="vec_8h-source.html#l00277">itpp::Vec< Num_T >::size()</a>.</p> |
---|
459 | |
---|
460 | </div> |
---|
461 | </div><p> |
---|
462 | </div> |
---|
463 | <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:14 2009 for mixpp by |
---|
464 | <a href="http://www.doxygen.org/index.html"> |
---|
465 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
---|
466 | </body> |
---|
467 | </html> |
---|