2020-06-28 23:07:29 +08:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv = "Content-Type" content = "text/xhtml;charset=UTF-8" / >
2021-10-26 03:34:27 +08:00
< meta http-equiv = "X-UA-Compatible" content = "IE=11" / >
2022-06-08 02:13:03 +08:00
< meta name = "generator" content = "Doxygen 1.9.4" / >
2020-06-28 23:07:29 +08:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
< title > Algorithms_in_C: numerical_methods/qr_decompose.h File Reference< / title >
< link href = "../../tabs.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "../../jquery.js" > < / script >
< script type = "text/javascript" src = "../../dynsections.js" > < / script >
< link href = "../../navtree.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "../../resize.js" > < / script >
< script type = "text/javascript" src = "../../navtreedata.js" > < / script >
< script type = "text/javascript" src = "../../navtree.js" > < / script >
< link href = "../../search/search.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "../../search/searchdata.js" > < / script >
< script type = "text/javascript" src = "../../search/search.js" > < / script >
< script type = "text/x-mathjax-config" >
2021-10-26 03:34:27 +08:00
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
2020-06-28 23:07:29 +08:00
});
< / script >
< script type = "text/javascript" async = "async" src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js" > < / script >
< link href = "../../doxygen.css" rel = "stylesheet" type = "text/css" / >
< / head >
< body >
< div id = "top" > <!-- do not remove this div, it is closed by doxygen! -->
< div id = "titlearea" >
< table cellspacing = "0" cellpadding = "0" >
< tbody >
2022-01-15 04:11:27 +08:00
< tr id = "projectrow" >
< td id = "projectalign" >
2021-10-26 03:34:27 +08:00
< div id = "projectname" > Algorithms_in_C< span id = "projectnumber" >   1.0.0< / span >
2020-06-28 23:07:29 +08:00
< / div >
< div id = "projectbrief" > Set of algorithms implemented in C.< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
<!-- end header part -->
2022-06-08 02:13:03 +08:00
<!-- Generated by Doxygen 1.9.4 -->
2020-06-28 23:07:29 +08:00
< script type = "text/javascript" >
2021-10-26 03:34:27 +08:00
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
2020-06-28 23:07:29 +08:00
/* @license-end */
< / script >
< script type = "text/javascript" src = "../../menudata.js" > < / script >
< script type = "text/javascript" src = "../../menu.js" > < / script >
< script type = "text/javascript" >
2021-10-26 03:34:27 +08:00
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
2020-06-28 23:07:29 +08:00
$(function() {
initMenu('../../',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
2021-10-26 03:34:27 +08:00
/* @license-end */
< / script >
2020-06-28 23:07:29 +08:00
< div id = "main-nav" > < / div >
< / div > <!-- top -->
< div id = "side-nav" class = "ui-resizable side-nav-resizable" >
< div id = "nav-tree" >
< div id = "nav-tree-contents" >
< div id = "nav-sync" class = "sync" > < / div >
< / div >
< / div >
< div id = "splitbar" style = "-moz-user-select:none;"
class="ui-resizable-handle">
< / div >
< / div >
< script type = "text/javascript" >
2021-10-26 03:34:27 +08:00
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
2020-06-28 23:07:29 +08:00
$(document).ready(function(){initNavTree('d4/d68/qr__decompose_8h.html','../../'); initResizable(); });
/* @license-end */
< / script >
< div id = "doc-content" >
<!-- window showing the filter options -->
< div id = "MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
< / div >
<!-- iframe showing the search results (closed by default) -->
< div id = "MSearchResultsWindow" >
< iframe src = "javascript:void(0)" frameborder = "0"
name="MSearchResults" id="MSearchResults">
< / iframe >
< / div >
< div class = "header" >
< div class = "summary" >
< a href = "#func-members" > Functions< / a > < / div >
2021-10-26 03:34:27 +08:00
< div class = "headertitle" > < div class = "title" > qr_decompose.h File Reference< / div > < / div >
2020-06-28 23:07:29 +08:00
< / div > <!-- header -->
< div class = "contents" >
2021-10-26 03:34:27 +08:00
< p > Library functions to compute < a href = "https://en.wikipedia.org/wiki/QR_decomposition" target = "_blank" > QR decomposition< / a > of a given matrix.
2020-06-28 23:07:29 +08:00
< a href = "#details" > More...< / a > < / p >
< div class = "textblock" > < code > #include < math.h> < / code > < br / >
< code > #include < stdio.h> < / code > < br / >
< code > #include < stdlib.h> < / code > < br / >
2022-06-08 02:13:03 +08:00
< code > #include < omp.h> < / code > < br / >
2020-06-28 23:07:29 +08:00
< / div > < div class = "textblock" > < div class = "dynheader" >
Include dependency graph for qr_decompose.h:< / div >
< div class = "dyncontent" >
2022-06-08 02:13:03 +08:00
< div class = "center" > < iframe scrolling = "no" frameborder = "0" src = "../../d0/d04/qr__decompose_8h__incl.svg" width = "331" height = "127" > < p > < b > This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.< / b > < / p > < / iframe >
2020-06-28 23:07:29 +08:00
< / div >
< / div >
< / div > < div class = "textblock" > < div class = "dynheader" >
This graph shows which files directly or indirectly include this file:< / div >
< div class = "dyncontent" >
2021-12-10 01:57:52 +08:00
< div class = "center" > < iframe scrolling = "no" frameborder = "0" src = "../../dc/d5f/qr__decompose_8h__dep__incl.svg" width = "336" height = "142" > < p > < b > This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.< / b > < / p > < / iframe >
2020-06-28 23:07:29 +08:00
< / div >
< / div >
< / div >
< p > < a href = "../../d4/d68/qr__decompose_8h_source.html" > Go to the source code of this file.< / a > < / p >
< table class = "memberdecls" >
2021-10-26 03:34:27 +08:00
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a id = "func-members" name = "func-members" > < / a >
2020-06-28 23:07:29 +08:00
Functions< / h2 > < / td > < / tr >
2020-07-17 04:36:47 +08:00
< tr class = "memitem:a90562ce8c3707401e9c5809dece68d6a" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d4/d68/qr__decompose_8h.html#a90562ce8c3707401e9c5809dece68d6a" > print_matrix< / a > (double **A, int M, int N)< / td > < / tr >
2020-06-29 04:40:24 +08:00
< tr class = "memdesc:a90562ce8c3707401e9c5809dece68d6a" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > function to display matrix on stdout < a href = "../../d4/d68/qr__decompose_8h.html#a90562ce8c3707401e9c5809dece68d6a" > More...< / a > < br / > < / td > < / tr >
2020-06-28 23:07:29 +08:00
< tr class = "separator:a90562ce8c3707401e9c5809dece68d6a" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a3a584b79941a43d775f9d4ce446dbe05" > < td class = "memItemLeft" align = "right" valign = "top" > double  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d4/d68/qr__decompose_8h.html#a3a584b79941a43d775f9d4ce446dbe05" > vector_dot< / a > (double *a, double *b, int < a class = "el" href = "../../df/db3/struct_l.html" > L< / a > )< / td > < / tr >
2020-06-29 04:40:24 +08:00
< tr class = "memdesc:a3a584b79941a43d775f9d4ce446dbe05" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Compute dot product of two vectors of equal lengths. < a href = "../../d4/d68/qr__decompose_8h.html#a3a584b79941a43d775f9d4ce446dbe05" > More...< / a > < br / > < / td > < / tr >
2020-06-28 23:07:29 +08:00
< tr class = "separator:a3a584b79941a43d775f9d4ce446dbe05" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:abeec1f78a7a7e7251687e75340331212" > < td class = "memItemLeft" align = "right" valign = "top" > double  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d4/d68/qr__decompose_8h.html#abeec1f78a7a7e7251687e75340331212" > vector_mag< / a > (double *vector, int < a class = "el" href = "../../df/db3/struct_l.html" > L< / a > )< / td > < / tr >
2020-06-29 04:40:24 +08:00
< tr class = "memdesc:abeec1f78a7a7e7251687e75340331212" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Compute magnitude of vector. < a href = "../../d4/d68/qr__decompose_8h.html#abeec1f78a7a7e7251687e75340331212" > More...< / a > < br / > < / td > < / tr >
2020-06-28 23:07:29 +08:00
< tr class = "separator:abeec1f78a7a7e7251687e75340331212" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2021-10-26 03:34:27 +08:00
< tr class = "memitem:a2ed4977f38642dca8b10c16a823c740b" > < td class = "memItemLeft" align = "right" valign = "top" > double *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d4/d68/qr__decompose_8h.html#a2ed4977f38642dca8b10c16a823c740b" > vector_proj< / a > (double *a, double *b, double *out, int < a class = "el" href = "../../df/db3/struct_l.html" > L< / a > )< / td > < / tr >
< tr class = "memdesc:a2ed4977f38642dca8b10c16a823c740b" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Compute projection of vector \(\vec{a}\) on \(\vec{b}\) defined as. < a href = "../../d4/d68/qr__decompose_8h.html#a2ed4977f38642dca8b10c16a823c740b" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:a2ed4977f38642dca8b10c16a823c740b" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a5ee39e7c8fce8a604dcf7009ce101c02" > < td class = "memItemLeft" align = "right" valign = "top" > double *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d4/d68/qr__decompose_8h.html#a5ee39e7c8fce8a604dcf7009ce101c02" > vector_sub< / a > (double *a, double *b, double *out, int < a class = "el" href = "../../df/db3/struct_l.html" > L< / a > )< / td > < / tr >
< tr class = "memdesc:a5ee39e7c8fce8a604dcf7009ce101c02" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Compute vector subtraction. < a href = "../../d4/d68/qr__decompose_8h.html#a5ee39e7c8fce8a604dcf7009ce101c02" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:a5ee39e7c8fce8a604dcf7009ce101c02" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2020-07-17 04:36:47 +08:00
< tr class = "memitem:a45c7640d9d22c89c11beb1f567843c56" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d4/d68/qr__decompose_8h.html#a45c7640d9d22c89c11beb1f567843c56" > qr_decompose< / a > (double **A, double **Q, double **R, int M, int N)< / td > < / tr >
2021-10-26 03:34:27 +08:00
< tr class = "memdesc:a45c7640d9d22c89c11beb1f567843c56" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Decompose matrix \(A\) using < a href = "https://en.wikipedia.org/wiki/QR_decomposition" target = "_blank" > Gram-Schmidt process< / a > . < a href = "../../d4/d68/qr__decompose_8h.html#a45c7640d9d22c89c11beb1f567843c56" > More...< / a > < br / > < / td > < / tr >
2020-06-28 23:07:29 +08:00
< tr class = "separator:a45c7640d9d22c89c11beb1f567843c56" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table >
< a name = "details" id = "details" > < / a > < h2 class = "groupheader" > Detailed Description< / h2 >
2021-10-26 03:34:27 +08:00
< div class = "textblock" > < p > Library functions to compute < a href = "https://en.wikipedia.org/wiki/QR_decomposition" target = "_blank" > QR decomposition< / a > of a given matrix. < / p >
< dl class = "section author" > < dt > Author< / dt > < dd > < a href = "https://github.com/kvedala" target = "_blank" > Krishna Vedala< / a > < / dd > < / dl >
2020-06-28 23:07:29 +08:00
< / div > < h2 class = "groupheader" > Function Documentation< / h2 >
2021-10-26 03:34:27 +08:00
< a id = "a90562ce8c3707401e9c5809dece68d6a" name = "a90562ce8c3707401e9c5809dece68d6a" > < / a >
2020-06-28 23:07:29 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a90562ce8c3707401e9c5809dece68d6a" > ◆ < / a > < / span > print_matrix()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > void print_matrix < / td >
< td > (< / td >
< td class = "paramtype" > double **  < / td >
< td class = "paramname" > < em > A< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > M< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > N< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2020-06-29 04:40:24 +08:00
2020-06-28 23:07:29 +08:00
< p > function to display matrix on stdout < / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
2022-06-08 02:13:03 +08:00
< tr > < td class = "paramname" > A< / td > < td > matrix to print< / td > < / tr >
< tr > < td class = "paramname" > M< / td > < td > number of rows of matrix< / td > < / tr >
2020-06-28 23:07:29 +08:00
< tr > < td class = "paramname" > N< / td > < td > number of columns of matrix < / td > < / tr >
< / table >
< / dd >
< / dl >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 25< / span > {< / div >
< div class = "line" > < span class = "lineno" > 26< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > row = 0; row < M; row++)< / div >
< div class = "line" > < span class = "lineno" > 27< / span > {< / div >
< div class = "line" > < span class = "lineno" > 28< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > col = 0; col < N; col++) printf(< span class = "stringliteral" > " % 9.3g\t" < / span > , A[row][col]);< / div >
< div class = "line" > < span class = "lineno" > 29< / span > putchar(< span class = "charliteral" > ' \n' < / span > );< / div >
< div class = "line" > < span class = "lineno" > 30< / span > }< / div >
< div class = "line" > < span class = "lineno" > 31< / span > putchar(< span class = "charliteral" > ' \n' < / span > );< / div >
< div class = "line" > < span class = "lineno" > 32< / span > }< / div >
2020-06-28 23:07:29 +08:00
< / div > <!-- fragment -->
< / div >
< / div >
2021-10-26 03:34:27 +08:00
< a id = "a45c7640d9d22c89c11beb1f567843c56" name = "a45c7640d9d22c89c11beb1f567843c56" > < / a >
2020-06-28 23:07:29 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a45c7640d9d22c89c11beb1f567843c56" > ◆ < / a > < / span > qr_decompose()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > void qr_decompose < / td >
< td > (< / td >
< td class = "paramtype" > double **  < / td >
< td class = "paramname" > < em > A< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > double **  < / td >
< td class = "paramname" > < em > Q< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > double **  < / td >
< td class = "paramname" > < em > R< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > M< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > N< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2020-06-29 04:40:24 +08:00
2021-10-26 03:34:27 +08:00
< p > Decompose matrix \(A\) using < a href = "https://en.wikipedia.org/wiki/QR_decomposition" target = "_blank" > Gram-Schmidt process< / a > . < / p >
2020-06-28 23:07:29 +08:00
< p class = "formulaDsp" >
2022-06-08 02:13:03 +08:00
\begin{eqnarray*}
\text{given that}\quad A & =&
*\left[\mathbf{a}_1,\mathbf{a}_2,\ldots,\mathbf{a}_{N-1},\right]\\
\text{where}\quad\mathbf{a}_i & =&
*\left[a_{0i},a_{1i},a_{2i},\ldots,a_{(M-1)i}\right]^T\quad\ldots\mbox{(column
*vectors)}\\
\text{then}\quad\mathbf{u}_i & =& \mathbf{a}_i
*-\sum_{j=0}^{i-1}\text{proj}_{\mathbf{u}_j}\mathbf{a}_i\\
\mathbf{e}_i & =& \frac{\mathbf{u}_i}{\left|\mathbf{u}_i\right|}\\
Q & =& \begin{bmatrix}\mathbf{e}_0 & \mathbf{e}_1 & \mathbf{e}_2 & \dots &
*\mathbf{e}_{N-1}\end{bmatrix}\\
R & =& \begin{bmatrix}\langle\mathbf{e}_0\,,\mathbf{a}_0\rangle &
*\langle\mathbf{e}_1\,,\mathbf{a}_1\rangle &
*\langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots \\
0 & \langle\mathbf{e}_1\,,\mathbf{a}_1\rangle &
*\langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots\\
0 & 0 & \langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots\\
\vdots & \vdots & \vdots & \ddots
\end{bmatrix}\\
\end{eqnarray*}
2020-06-28 23:07:29 +08:00
< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
2022-06-08 02:13:03 +08:00
< tr > < td class = "paramname" > A< / td > < td > input matrix to decompose< / td > < / tr >
< tr > < td class = "paramname" > Q< / td > < td > output decomposed matrix< / td > < / tr >
< tr > < td class = "paramname" > R< / td > < td > output decomposed matrix< / td > < / tr >
< tr > < td class = "paramname" > M< / td > < td > number of rows of matrix A< / td > < / tr >
2020-06-28 23:07:29 +08:00
< tr > < td class = "paramname" > N< / td > < td > number of columns of matrix A < / td > < / tr >
< / table >
< / dd >
< / dl >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 148< / span > {< / div >
< div class = "line" > < span class = "lineno" > 149< / span > < span class = "keywordtype" > double< / span > *col_vector = (< span class = "keywordtype" > double< / span > *)< a class = "code hl_define" href = "../../d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee" > malloc< / a > (M * < span class = "keyword" > sizeof< / span > (< span class = "keywordtype" > double< / span > ));< / div >
< div class = "line" > < span class = "lineno" > 150< / span > < span class = "keywordtype" > double< / span > *col_vector2 = (< span class = "keywordtype" > double< / span > *)< a class = "code hl_define" href = "../../d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee" > malloc< / a > (M * < span class = "keyword" > sizeof< / span > (< span class = "keywordtype" > double< / span > ));< / div >
< div class = "line" > < span class = "lineno" > 151< / span > < span class = "keywordtype" > double< / span > *tmp_vector = (< span class = "keywordtype" > double< / span > *)< a class = "code hl_define" href = "../../d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee" > malloc< / a > (M * < span class = "keyword" > sizeof< / span > (< span class = "keywordtype" > double< / span > ));< / div >
< div class = "line" > < span class = "lineno" > 152< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > i = 0; i < N;< / div >
< div class = "line" > < span class = "lineno" > 153< / span > i++) < span class = "comment" > /* for each column => R is a square matrix of NxN */< / span > < / div >
< div class = "line" > < span class = "lineno" > 154< / span > {< / div >
< div class = "line" > < span class = "lineno" > 155< / span > < span class = "keywordtype" > int< / span > j;< / div >
< div class = "line" > < span class = "lineno" > 156< / span > < span class = "preprocessor" > #ifdef _OPENMP< / span > < / div >
< div class = "line" > < span class = "lineno" > 157< / span > < span class = "comment" > // parallelize on threads< / span > < / div >
< div class = "line" > < span class = "lineno" > 158< / span > < span class = "preprocessor" > #pragma omp for< / span > < / div >
< div class = "line" > < span class = "lineno" > 159< / span > < span class = "preprocessor" > #endif< / span > < / div >
< div class = "line" > < span class = "lineno" > 160< / span > < span class = "keywordflow" > for< / span > (j = 0; j < i; j++) < span class = "comment" > /* second dimension of column */< / span > < / div >
< div class = "line" > < span class = "lineno" > 161< / span > R[i][j] = 0.; < span class = "comment" > /* make R upper triangular */< / span > < / div >
< div class = "line" > < span class = "lineno" > 162< / span > < / div >
< div class = "line" > < span class = "lineno" > 163< / span > < span class = "comment" > /* get corresponding Q vector */< / span > < / div >
< div class = "line" > < span class = "lineno" > 164< / span > < span class = "preprocessor" > #ifdef _OPENMP< / span > < / div >
< div class = "line" > < span class = "lineno" > 165< / span > < span class = "comment" > // parallelize on threads< / span > < / div >
< div class = "line" > < span class = "lineno" > 166< / span > < span class = "preprocessor" > #pragma omp for< / span > < / div >
< div class = "line" > < span class = "lineno" > 167< / span > < span class = "preprocessor" > #endif< / span > < / div >
< div class = "line" > < span class = "lineno" > 168< / span > < span class = "keywordflow" > for< / span > (j = 0; j < M; j++)< / div >
< div class = "line" > < span class = "lineno" > 169< / span > {< / div >
< div class = "line" > < span class = "lineno" > 170< / span > tmp_vector[j] = A[j][i]; < span class = "comment" > /* accumulator for uk */< / span > < / div >
< div class = "line" > < span class = "lineno" > 171< / span > col_vector[j] = A[j][i];< / div >
< div class = "line" > < span class = "lineno" > 172< / span > }< / div >
< div class = "line" > < span class = "lineno" > 173< / span > < span class = "keywordflow" > for< / span > (j = 0; j < i; j++)< / div >
< div class = "line" > < span class = "lineno" > 174< / span > {< / div >
< div class = "line" > < span class = "lineno" > 175< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > k = 0; k < M; k++) col_vector2[k] = Q[k][j];< / div >
< div class = "line" > < span class = "lineno" > 176< / span > < a class = "code hl_function" href = "../../d4/d68/qr__decompose_8h.html#a2ed4977f38642dca8b10c16a823c740b" > vector_proj< / a > (col_vector, col_vector2, col_vector2, M);< / div >
< div class = "line" > < span class = "lineno" > 177< / span > < a class = "code hl_function" href = "../../d4/d68/qr__decompose_8h.html#a5ee39e7c8fce8a604dcf7009ce101c02" > vector_sub< / a > (tmp_vector, col_vector2, tmp_vector, M);< / div >
< div class = "line" > < span class = "lineno" > 178< / span > }< / div >
< div class = "line" > < span class = "lineno" > 179< / span > < span class = "keywordtype" > double< / span > mag = < a class = "code hl_function" href = "../../d4/d68/qr__decompose_8h.html#abeec1f78a7a7e7251687e75340331212" > vector_mag< / a > (tmp_vector, M);< / div >
< div class = "line" > < span class = "lineno" > 180< / span > < / div >
< div class = "line" > < span class = "lineno" > 181< / span > < span class = "preprocessor" > #ifdef _OPENMP< / span > < / div >
< div class = "line" > < span class = "lineno" > 182< / span > < span class = "comment" > // parallelize on threads< / span > < / div >
< div class = "line" > < span class = "lineno" > 183< / span > < span class = "preprocessor" > #pragma omp for< / span > < / div >
< div class = "line" > < span class = "lineno" > 184< / span > < span class = "preprocessor" > #endif< / span > < / div >
< div class = "line" > < span class = "lineno" > 185< / span > < span class = "keywordflow" > for< / span > (j = 0; j < M; j++) Q[j][i] = tmp_vector[j] / mag;< / div >
< div class = "line" > < span class = "lineno" > 186< / span > < / div >
< div class = "line" > < span class = "lineno" > 187< / span > < span class = "comment" > /* compute upper triangular values of R */< / span > < / div >
< div class = "line" > < span class = "lineno" > 188< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > kk = 0; kk < M; kk++) col_vector[kk] = Q[kk][i];< / div >
< div class = "line" > < span class = "lineno" > 189< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > k = i; k < N; k++)< / div >
< div class = "line" > < span class = "lineno" > 190< / span > {< / div >
< div class = "line" > < span class = "lineno" > 191< / span > < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > kk = 0; kk < M; kk++) col_vector2[kk] = A[kk][k];< / div >
< div class = "line" > < span class = "lineno" > 192< / span > R[i][k] = < a class = "code hl_function" href = "../../d4/d68/qr__decompose_8h.html#a3a584b79941a43d775f9d4ce446dbe05" > vector_dot< / a > (col_vector, col_vector2, M);< / div >
< div class = "line" > < span class = "lineno" > 193< / span > }< / div >
< div class = "line" > < span class = "lineno" > 194< / span > }< / div >
< div class = "line" > < span class = "lineno" > 195< / span > < / div >
< div class = "line" > < span class = "lineno" > 196< / span > < a class = "code hl_define" href = "../../d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768" > free< / a > (col_vector);< / div >
< div class = "line" > < span class = "lineno" > 197< / span > < a class = "code hl_define" href = "../../d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768" > free< / a > (col_vector2);< / div >
< div class = "line" > < span class = "lineno" > 198< / span > < a class = "code hl_define" href = "../../d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768" > free< / a > (tmp_vector);< / div >
< div class = "line" > < span class = "lineno" > 199< / span > }< / div >
2021-02-18 06:41:16 +08:00
< div class = "ttc" id = "amalloc__dbg_8h_html_a725f50ecaf1959d96de79b36b4788fee" > < div class = "ttname" > < a href = "../../d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee" > malloc< / a > < / div > < div class = "ttdeci" > #define malloc(bytes)< / div > < div class = "ttdoc" > This macro replace the standard malloc function with malloc_dbg.< / div > < div class = "ttdef" > < b > Definition:< / b > malloc_dbg.h:18< / div > < / div >
< div class = "ttc" id = "amalloc__dbg_8h_html_a9cc854374299a1dd933bf62029761768" > < div class = "ttname" > < a href = "../../d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768" > free< / a > < / div > < div class = "ttdeci" > #define free(ptr)< / div > < div class = "ttdoc" > This macro replace the standard free function with free_dbg.< / div > < div class = "ttdef" > < b > Definition:< / b > malloc_dbg.h:26< / div > < / div >
2021-10-26 03:34:27 +08:00
< div class = "ttc" id = "aqr__decompose_8h_html_a2ed4977f38642dca8b10c16a823c740b" > < div class = "ttname" > < a href = "../../d4/d68/qr__decompose_8h.html#a2ed4977f38642dca8b10c16a823c740b" > vector_proj< / a > < / div > < div class = "ttdeci" > double * vector_proj(double *a, double *b, double *out, int L)< / div > < div class = "ttdoc" > Compute projection of vector on defined as.< / div > < div class = "ttdef" > < b > Definition:< / b > qr_decompose.h:76< / div > < / div >
2021-02-06 03:52:57 +08:00
< div class = "ttc" id = "aqr__decompose_8h_html_a3a584b79941a43d775f9d4ce446dbe05" > < div class = "ttname" > < a href = "../../d4/d68/qr__decompose_8h.html#a3a584b79941a43d775f9d4ce446dbe05" > vector_dot< / a > < / div > < div class = "ttdeci" > double vector_dot(double *a, double *b, int L)< / div > < div class = "ttdoc" > Compute dot product of two vectors of equal lengths.< / div > < div class = "ttdef" > < b > Definition:< / b > qr_decompose.h:43< / div > < / div >
2021-10-26 03:34:27 +08:00
< div class = "ttc" id = "aqr__decompose_8h_html_a5ee39e7c8fce8a604dcf7009ce101c02" > < div class = "ttname" > < a href = "../../d4/d68/qr__decompose_8h.html#a5ee39e7c8fce8a604dcf7009ce101c02" > vector_sub< / a > < / div > < div class = "ttdeci" > double * vector_sub(double *a, double *b, double *out, int L)< / div > < div class = "ttdoc" > Compute vector subtraction.< / div > < div class = "ttdef" > < b > Definition:< / b > qr_decompose.h:101< / div > < / div >
2021-02-06 03:52:57 +08:00
< div class = "ttc" id = "aqr__decompose_8h_html_abeec1f78a7a7e7251687e75340331212" > < div class = "ttname" > < a href = "../../d4/d68/qr__decompose_8h.html#abeec1f78a7a7e7251687e75340331212" > vector_mag< / a > < / div > < div class = "ttdeci" > double vector_mag(double *vector, int L)< / div > < div class = "ttdoc" > Compute magnitude of vector.< / div > < div class = "ttdef" > < b > Definition:< / b > qr_decompose.h:64< / div > < / div >
2020-06-28 23:07:29 +08:00
< / div > <!-- fragment --> < div class = "dynheader" >
Here is the call graph for this function:< / div >
< div class = "dyncontent" >
2021-12-10 01:57:52 +08:00
< div class = "center" > < iframe scrolling = "no" frameborder = "0" src = "../../d4/d68/qr__decompose_8h_a45c7640d9d22c89c11beb1f567843c56_cgraph.svg" width = "387" height = "156" > < p > < b > This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.< / b > < / p > < / iframe >
2020-06-28 23:07:29 +08:00
< / div >
< / div >
< / div >
< / div >
2021-10-26 03:34:27 +08:00
< a id = "a3a584b79941a43d775f9d4ce446dbe05" name = "a3a584b79941a43d775f9d4ce446dbe05" > < / a >
2020-06-28 23:07:29 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a3a584b79941a43d775f9d4ce446dbe05" > ◆ < / a > < / span > vector_dot()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > double vector_dot < / td >
< td > (< / td >
< td class = "paramtype" > double *  < / td >
< td class = "paramname" > < em > a< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > double *  < / td >
< td class = "paramname" > < em > b< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > L< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2020-06-29 04:40:24 +08:00
< p > Compute dot product of two vectors of equal lengths. < / p >
2021-10-26 03:34:27 +08:00
< p > If \(\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\) and \(\vec{b}=\left[b_0,b_1,b_1,...,b_L\right]\) then \(\vec{a}\cdot\vec{b}=\displaystyle\sum_{i=0}^L a_i\times b_i\)< / p >
2020-06-28 23:07:29 +08:00
< dl class = "section return" > < dt > Returns< / dt > < dd > \(\vec{a}\cdot\vec{b}\) < / dd > < / dl >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 44< / span > {< / div >
< div class = "line" > < span class = "lineno" > 45< / span > < span class = "keywordtype" > double< / span > mag = 0.f;< / div >
< div class = "line" > < span class = "lineno" > 46< / span > < span class = "keywordtype" > int< / span > i;< / div >
< div class = "line" > < span class = "lineno" > 47< / span > < span class = "preprocessor" > #ifdef _OPENMP< / span > < / div >
< div class = "line" > < span class = "lineno" > 48< / span > < span class = "comment" > // parallelize on threads< / span > < / div >
< div class = "line" > < span class = "lineno" > 49< / span > < span class = "preprocessor" > #pragma omp parallel for reduction(+ : mag)< / span > < / div >
< div class = "line" > < span class = "lineno" > 50< / span > < span class = "preprocessor" > #endif< / span > < / div >
< div class = "line" > < span class = "lineno" > 51< / span > < span class = "keywordflow" > for< / span > (i = 0; i < < a class = "code hl_struct" href = "../../df/db3/struct_l.html" > L< / a > ; i++) mag += a[i] * b[i];< / div >
< div class = "line" > < span class = "lineno" > 52< / span > < / div >
< div class = "line" > < span class = "lineno" > 53< / span > < span class = "keywordflow" > return< / span > mag;< / div >
< div class = "line" > < span class = "lineno" > 54< / span > }< / div >
2021-02-06 03:52:57 +08:00
< div class = "ttc" id = "astruct_l_html" > < div class = "ttname" > < a href = "../../df/db3/struct_l.html" > L< / a > < / div > < div class = "ttdef" > < b > Definition:< / b > list.h:8< / div > < / div >
2020-06-28 23:07:29 +08:00
< / div > <!-- fragment -->
< / div >
< / div >
2021-10-26 03:34:27 +08:00
< a id = "abeec1f78a7a7e7251687e75340331212" name = "abeec1f78a7a7e7251687e75340331212" > < / a >
2020-06-28 23:07:29 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#abeec1f78a7a7e7251687e75340331212" > ◆ < / a > < / span > vector_mag()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > double vector_mag < / td >
< td > (< / td >
< td class = "paramtype" > double *  < / td >
< td class = "paramname" > < em > vector< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > L< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2020-06-29 04:40:24 +08:00
< p > Compute magnitude of vector. < / p >
2021-10-26 03:34:27 +08:00
< p > If \(\vec{a}=\left[a_0,a_1,a_2,...,a_L\right]\) then \(\left|\vec{a}\right|=\sqrt{\displaystyle\sum_{i=0}^L a_i^2}\)< / p >
2020-06-28 23:07:29 +08:00
< dl class = "section return" > < dt > Returns< / dt > < dd > \(\left|\vec{a}\right|\) < / dd > < / dl >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 65< / span > {< / div >
< div class = "line" > < span class = "lineno" > 66< / span > < span class = "keywordtype" > double< / span > dot = < a class = "code hl_function" href = "../../d4/d68/qr__decompose_8h.html#a3a584b79941a43d775f9d4ce446dbe05" > vector_dot< / a > (vector, vector, < a class = "code hl_struct" href = "../../df/db3/struct_l.html" > L< / a > );< / div >
< div class = "line" > < span class = "lineno" > 67< / span > < span class = "keywordflow" > return< / span > sqrt(dot);< / div >
< div class = "line" > < span class = "lineno" > 68< / span > }< / div >
2020-06-28 23:07:29 +08:00
< / div > <!-- fragment --> < div class = "dynheader" >
Here is the call graph for this function:< / div >
< div class = "dyncontent" >
2021-12-10 01:57:52 +08:00
< div class = "center" > < iframe scrolling = "no" frameborder = "0" src = "../../d4/d68/qr__decompose_8h_abeec1f78a7a7e7251687e75340331212_cgraph.svg" width = "232" height = "38" > < p > < b > This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.< / b > < / p > < / iframe >
2020-06-28 23:07:29 +08:00
< / div >
< / div >
< / div >
< / div >
2021-10-26 03:34:27 +08:00
< a id = "a2ed4977f38642dca8b10c16a823c740b" name = "a2ed4977f38642dca8b10c16a823c740b" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a2ed4977f38642dca8b10c16a823c740b" > ◆ < / a > < / span > vector_proj()< / h2 >
2020-06-28 23:07:29 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2021-10-26 03:34:27 +08:00
< td class = "memname" > double * vector_proj < / td >
2020-06-28 23:07:29 +08:00
< td > (< / td >
< td class = "paramtype" > double *  < / td >
< td class = "paramname" > < em > a< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > double *  < / td >
< td class = "paramname" > < em > b< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > double *  < / td >
< td class = "paramname" > < em > out< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > L< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2020-06-29 04:40:24 +08:00
< p > Compute projection of vector \(\vec{a}\) on \(\vec{b}\) defined as. < / p >
< p class = "formulaDsp" >
2020-06-28 23:07:29 +08:00
\[\text{proj}_\vec{b}\vec{a}=\frac{\vec{a}\cdot\vec{b}}{\left|\vec{b}\right|^2}\vec{b}\]
< / p >
< dl class = "section return" > < dt > Returns< / dt > < dd > NULL if error, otherwise pointer to output < / dd > < / dl >
2021-10-26 03:34:27 +08:00
< p > check for division by zero< / p >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 77< / span > {< / div >
< div class = "line" > < span class = "lineno" > 78< / span > < span class = "keyword" > const< / span > < span class = "keywordtype" > double< / span > num = < a class = "code hl_function" href = "../../d4/d68/qr__decompose_8h.html#a3a584b79941a43d775f9d4ce446dbe05" > vector_dot< / a > (a, b, < a class = "code hl_struct" href = "../../df/db3/struct_l.html" > L< / a > );< / div >
< div class = "line" > < span class = "lineno" > 79< / span > < span class = "keyword" > const< / span > < span class = "keywordtype" > double< / span > deno = < a class = "code hl_function" href = "../../d4/d68/qr__decompose_8h.html#a3a584b79941a43d775f9d4ce446dbe05" > vector_dot< / a > (b, b, < a class = "code hl_struct" href = "../../df/db3/struct_l.html" > L< / a > );< / div >
< div class = "line" > < span class = "lineno" > 80< / span > < span class = "keywordflow" > if< / span > (deno == 0) < span class = "comment" > /*! check for division by zero */< / span > < / div >
< div class = "line" > < span class = "lineno" > 81< / span > < span class = "keywordflow" > return< / span > NULL;< / div >
< div class = "line" > < span class = "lineno" > 82< / span > < / div >
< div class = "line" > < span class = "lineno" > 83< / span > < span class = "keyword" > const< / span > < span class = "keywordtype" > double< / span > scalar = num / deno;< / div >
< div class = "line" > < span class = "lineno" > 84< / span > < span class = "keywordtype" > int< / span > i;< / div >
< div class = "line" > < span class = "lineno" > 85< / span > < span class = "preprocessor" > #ifdef _OPENMP< / span > < / div >
< div class = "line" > < span class = "lineno" > 86< / span > < span class = "comment" > // parallelize on threads< / span > < / div >
< div class = "line" > < span class = "lineno" > 87< / span > < span class = "preprocessor" > #pragma omp for< / span > < / div >
< div class = "line" > < span class = "lineno" > 88< / span > < span class = "preprocessor" > #endif< / span > < / div >
< div class = "line" > < span class = "lineno" > 89< / span > < span class = "keywordflow" > for< / span > (i = 0; i < < a class = "code hl_struct" href = "../../df/db3/struct_l.html" > L< / a > ; i++) out[i] = scalar * b[i];< / div >
< div class = "line" > < span class = "lineno" > 90< / span > < / div >
< div class = "line" > < span class = "lineno" > 91< / span > < span class = "keywordflow" > return< / span > out;< / div >
< div class = "line" > < span class = "lineno" > 92< / span > }< / div >
2020-06-28 23:07:29 +08:00
< / div > <!-- fragment --> < div class = "dynheader" >
Here is the call graph for this function:< / div >
< div class = "dyncontent" >
2021-12-10 01:57:52 +08:00
< div class = "center" > < iframe scrolling = "no" frameborder = "0" src = "../../d4/d68/qr__decompose_8h_a2ed4977f38642dca8b10c16a823c740b_cgraph.svg" width = "228" height = "38" > < p > < b > This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.< / b > < / p > < / iframe >
2020-06-28 23:07:29 +08:00
< / div >
< / div >
< / div >
< / div >
2021-10-26 03:34:27 +08:00
< a id = "a5ee39e7c8fce8a604dcf7009ce101c02" name = "a5ee39e7c8fce8a604dcf7009ce101c02" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a5ee39e7c8fce8a604dcf7009ce101c02" > ◆ < / a > < / span > vector_sub()< / h2 >
2020-06-28 23:07:29 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2021-10-26 03:34:27 +08:00
< td class = "memname" > double * vector_sub < / td >
2020-06-28 23:07:29 +08:00
< td > (< / td >
< td class = "paramtype" > double *  < / td >
< td class = "paramname" > < em > a< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > double *  < / td >
< td class = "paramname" > < em > b< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > double *  < / td >
< td class = "paramname" > < em > out< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > L< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2020-06-29 04:40:24 +08:00
< p > Compute vector subtraction. < / p >
2021-10-26 03:34:27 +08:00
< p > \(\vec{c}=\vec{a}-\vec{b}\)< / p >
2020-06-28 23:07:29 +08:00
< dl class = "section return" > < dt > Returns< / dt > < dd > pointer to output vector < / dd > < / dl >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
2022-06-08 02:13:03 +08:00
< tr > < td class = "paramname" > a< / td > < td > minuend< / td > < / tr >
< tr > < td class = "paramname" > b< / td > < td > subtrahend< / td > < / tr >
< tr > < td class = "paramname" > out< / td > < td > resultant vector< / td > < / tr >
2020-06-28 23:07:29 +08:00
< tr > < td class = "paramname" > < a class = "el" href = "../../df/db3/struct_l.html" > L< / a > < / td > < td > length of vectors < / td > < / tr >
< / table >
< / dd >
< / dl >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 106< / span > {< / div >
< div class = "line" > < span class = "lineno" > 107< / span > < span class = "keywordtype" > int< / span > i;< / div >
< div class = "line" > < span class = "lineno" > 108< / span > < span class = "preprocessor" > #ifdef _OPENMP< / span > < / div >
< div class = "line" > < span class = "lineno" > 109< / span > < span class = "comment" > // parallelize on threads< / span > < / div >
< div class = "line" > < span class = "lineno" > 110< / span > < span class = "preprocessor" > #pragma omp for< / span > < / div >
< div class = "line" > < span class = "lineno" > 111< / span > < span class = "preprocessor" > #endif< / span > < / div >
< div class = "line" > < span class = "lineno" > 112< / span > < span class = "keywordflow" > for< / span > (i = 0; i < < a class = "code hl_struct" href = "../../df/db3/struct_l.html" > L< / a > ; i++) out[i] = a[i] - b[i];< / div >
< div class = "line" > < span class = "lineno" > 113< / span > < / div >
< div class = "line" > < span class = "lineno" > 114< / span > < span class = "keywordflow" > return< / span > out;< / div >
< div class = "line" > < span class = "lineno" > 115< / span > }< / div >
2020-06-28 23:07:29 +08:00
< / div > <!-- fragment -->
< / div >
< / div >
< / div > <!-- contents -->
< / div > <!-- doc - content -->
<!-- start footer part -->
< div id = "nav-path" class = "navpath" > <!-- id is needed for treeview function! -->
< ul >
< li class = "navelem" > < a class = "el" href = "../../dir_9c6faab82c22511b50177aa2e38e2780.html" > numerical_methods< / a > < / li > < li class = "navelem" > < a class = "el" href = "../../d4/d68/qr__decompose_8h.html" > qr_decompose.h< / a > < / li >
2022-06-08 02:13:03 +08:00
< li class = "footer" > Generated by < a href = "https://www.doxygen.org/index.html" > < img class = "footer" src = "../../doxygen.svg" width = "104" height = "31" alt = "doxygen" / > < / a > 1.9.4 < / li >
2020-06-28 23:07:29 +08:00
< / ul >
< / div >
< / body >
< / html >