File: manual-structured-matrix.html

package info (click to toggle)
viennacl 1.7.1%2Bdfsg1-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 114,428 kB
  • sloc: sh: 454,206; cpp: 109,088; ansic: 2,103; perl: 104; makefile: 22
file content (156 lines) | stat: -rw-r--r-- 11,656 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>ViennaCL - The Vienna Computing Library: Structured Matrix Types</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="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</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>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">ViennaCL - The Vienna Computing Library
   &#160;<span id="projectnumber">1.7.1</span>
   </div>
   <div id="projectbrief">Free open-source GPU-accelerated linear algebra and solver library.</div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</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">
$(document).ready(function(){initNavTree('manual-structured-matrix.html','');});
</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)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(11)"><span class="SelectionMark">&#160;</span>Pages</a></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="headertitle">
<div class="title">Structured Matrix Types </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><dl class="section warning"><dt>Warning</dt><dd>Structured matrix types are experimental in ViennaCL. Interface changes as well as considerable performance improvements may be included in future releases!</dd></dl>
<p>There are a number of structured dense matrices for which some algorithms such as matrix-vector products can be computed with much lower computational effort than for the general dense matrix case. In the following, four structured dense matrix types included in ViennaCL are discussed. Example code can be found in <code><a class="el" href="examples_2tutorial_2structured-matrices_8cpp.html">examples/tutorial/structured-matrices.cpp</a></code>.</p>
<h1><a class="anchor" id="manual-structured-matrix-circulant"></a>
Circulant Matrix</h1>
<p>A circulant matrix is a matrix of the form </p>
<p class="formulaDsp">
<img class="formulaDsp" alt="\[ \left( \begin{array}{ccccc} c_0 &amp; c_{n-1} &amp; \ldots &amp; c_2 &amp; c_1 \\ c_1 &amp; c_0 &amp; c_{n-1} &amp; &amp; c_2 \\ \vdots &amp; c_1 &amp; c_0 &amp; \ddots &amp; \vdots \\ c_{n-2} &amp; &amp; \ddots &amp; \ddots &amp; c_{n-1} \\ c_{n-1} &amp; c_{n-2} &amp; \hdots &amp; c_1 &amp; c_0 \\ \end{array} \right) \]" src="form_97.png"/>
</p>
<p> and available in ViennaCL via </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="circulant__matrix_8hpp.html">viennacl/circulant_matrix.hpp</a>&quot;</span></div>
<div class="line"></div>
<div class="line">std::size_t s = 42;</div>
<div class="line"><a class="code" href="classviennacl_1_1circulant__matrix.html">viennacl::circulant_matrix</a> circ_mat(s, s);</div>
</div><!-- fragment --><p> The <code>circulant_matrix</code> type can be manipulated in the same way as the dense matrix type <code>matrix</code>. Note that writing to a single element of the matrix is structure-preserving, e.g. changing <code>circ_mat(1,2)</code> will automatically update <code>circ_mat(0,1)</code>, <code>circ_mat(2,3)</code> and so on.</p>
<h1><a class="anchor" id="manual-structured-matrix-hankel"></a>
Hankel Matrix</h1>
<p>A Hankel matrix is a matrix of the form </p>
<p class="formulaDsp">
<img class="formulaDsp" alt="\[ \left( \begin{array}{cccc} a &amp; b &amp; c &amp; d \\ b &amp; c &amp; d &amp; e \\ c &amp; d &amp; e &amp; f \\ d &amp; e &amp; f &amp; g \\ \end{array} \right) \]" src="form_98.png"/>
</p>
<p> and available in ViennaCL via </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="hankel__matrix_8hpp.html">viennacl/hankel_matrix.hpp</a>&quot;</span></div>
<div class="line"></div>
<div class="line">std::size_t s = 42;</div>
<div class="line"><a class="code" href="classviennacl_1_1hankel__matrix.html">viennacl::hankel_matrix</a> hank_mat(s, s);</div>
</div><!-- fragment --><p> The <code>hankel_matrix</code> type can be manipulated in the same way as the dense matrix type <code>matrix</code>. Note that writing to a single element of the matrix is structure-preserving, e.g. changing <code>hank_mat(1,2)</code> in the example above will also update <code>hank_mat(0,3)</code>, <code>hank_mat(2,1)</code>, <code>hank_mat(3,0)</code>, etc.</p>
<h1><a class="anchor" id="manual-structured-matrix-toeplitz"></a>
Toeplitz Matrix</h1>
<p>A Toeplitz matrix is a matrix of the form </p>
<p class="formulaDsp">
<img class="formulaDsp" alt="\[ \left( \begin{array}{cccc} a &amp; b &amp; c &amp; d \\ e &amp; a &amp; b &amp; c \\ f &amp; e &amp; a &amp; b \\ g &amp; f &amp; e &amp; a \\ \end{array} \right) \]" src="form_99.png"/>
</p>
<p> and available in ViennaCL via </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="toeplitz__matrix_8hpp.html">viennacl/toeplitz_matrix.hpp</a>&quot;</span></div>
<div class="line"></div>
<div class="line">std::size_t s = 42;</div>
<div class="line"><a class="code" href="classviennacl_1_1toeplitz__matrix.html">viennacl::toeplitz_matrix</a> toep_mat(s, s);</div>
</div><!-- fragment --><p> The <code>toeplitz_matrix</code> type can be manipulated in the same way as the dense matrix type <code>matrix</code>. Note that writing to a single element of the matrix is structure-preserving, e.g. changing <code>toep_mat(1,2)</code> in the example above will also update <code>toep_mat(0,1)</code>, <code>toep_mat(2,3)</code>, etc.</p>
<h1><a class="anchor" id="manual-structured-matrix-vandermonde"></a>
Vandermonde Matrix</h1>
<p>A Vandermonde matrix is a matrix of the form </p>
<p class="formulaDsp">
<img class="formulaDsp" alt="\[ \left( \begin{array}{ccccc} 1 &amp; \alpha_1 &amp; \alpha_1^2 &amp; \ldots &amp; \alpha_1^{n-1} \\ 1 &amp; \alpha_2 &amp; \alpha_2^2 &amp; \ldots &amp; \alpha_2^{n-1} \\ 1 &amp; \vdots &amp; \vdots &amp; \vdots \\ 1 &amp; \alpha_m &amp; \alpha_m^2 &amp; \ldots &amp; \alpha_m^{n-1} \\ \end{array} \right) \]" src="form_100.png"/>
</p>
<p> and available in ViennaCL via </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="vandermonde__matrix_8hpp.html">viennacl/vandermonde_matrix.hpp</a>&quot;</span></div>
<div class="line"></div>
<div class="line">std::size_t s = 42;</div>
<div class="line"><a class="code" href="classviennacl_1_1vandermonde__matrix.html">viennacl::vandermonde_matrix</a> vand_mat(s, s);</div>
</div><!-- fragment --><p> The <code>vandermonde_matrix</code> type can be manipulated in the same way as the dense matrix type <code>matrix</code>, but restrictions apply. For example, the addition or subtraction of two Vandermonde matrices does not yield another Vandermonde matrix. Note that writing to a single element of the matrix is structure-preserving, e.g. changing <code>vand_mat(1,2)</code> in the example above will automatically update <code>vand_mat(1,3)</code>, <code>vand_mat(1,4)</code>, etc. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Wed Jan 20 2016 22:32:44 for ViennaCL - The Vienna Computing Library by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>