File: sparse_8cpp-example.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 (271 lines) | stat: -rw-r--r-- 22,411 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<!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: sparse.cpp</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('sparse_8cpp-example.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">sparse.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<p>This tutorial demonstrates the use of sparse matrices. The primary operation for sparse matrices in ViennaCL is the sparse matrix-vector product.</p>
<p>We start with including the respective headers: </p>
<div class="fragment"><div class="line"><span class="comment">// system headers</span></div>
<div class="line"><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// ublas headers</span></div>
<div class="line"><span class="preprocessor">#include &lt;boost/numeric/ublas/matrix_sparse.hpp&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;boost/numeric/ublas/matrix.hpp&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;boost/numeric/ublas/operation.hpp&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;boost/numeric/ublas/operation_sparse.hpp&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;boost/numeric/ublas/io.hpp&gt;</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// Must be set if you want to use ViennaCL algorithms on ublas objects</span></div>
<div class="line"><span class="preprocessor">#define VIENNACL_WITH_UBLAS 1</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// ViennaCL includes</span></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="scalar_8hpp.html">viennacl/scalar.hpp</a>&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="vector_8hpp.html">viennacl/vector.hpp</a>&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="compressed__matrix_8hpp.html">viennacl/compressed_matrix.hpp</a>&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="prod_8hpp.html">viennacl/linalg/prod.hpp</a>&quot;</span></div>
<div class="line"></div>
<div class="line"></div>
<div class="line"><span class="comment">// Additional helper functions for this tutorial:</span></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="vector-io_8hpp.html">vector-io.hpp</a>&quot;</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// Shortcut for writing &#39;ublas::&#39; instead of &#39;boost::numeric::ublas::&#39;</span></div>
<div class="line"><span class="keyword">using namespace </span>boost::numeric;</div>
</div><!-- fragment --><p> We setup a sparse matrix in uBLAS and populate it with values. Then, the respective ViennaCL sparse matrix is created and initialized with data from the uBLAS matrix. After a direct manipulation of the ViennaCL matrix, matrix-vector products are computed with both matrices. </p>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> <a name="a0"></a><a class="code" href="tests_2src_2sparse_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>()</div>
<div class="line">{</div>
<div class="line">  <span class="keyword">typedef</span> <span class="keywordtype">float</span>       <a name="a1"></a><a class="code" href="fft__1d_8cpp.html#ad5c19ca4f47d3f8ec21232a5af2624e5">ScalarType</a>;</div>
<div class="line"></div>
<div class="line">  std::size_t <a name="a2"></a><a class="code" href="namespaceviennacl_1_1traits.html#aa2344ea20469f55fbc15a8e9526494d0">size</a> = 5;</div>
</div><!-- fragment --><p> Set up some ublas objects </p>
<div class="fragment"><div class="line">ublas::vector&lt;ScalarType&gt; rhs = ublas::scalar_vector&lt;ScalarType&gt;(<a class="code" href="namespaceviennacl_1_1traits.html#aa2344ea20469f55fbc15a8e9526494d0">size</a>, <a class="code" href="fft__1d_8cpp.html#ad5c19ca4f47d3f8ec21232a5af2624e5">ScalarType</a>(size));</div>
<div class="line">ublas::compressed_matrix&lt;ScalarType&gt; ublas_matrix(size, size);</div>
<div class="line"></div>
<div class="line">ublas_matrix(0,0) =  2.0f; ublas_matrix(0,1) = -1.0f;</div>
<div class="line">ublas_matrix(1,0) = -1.0f; ublas_matrix(1,1) =  2.0f; ublas_matrix(1,2) = -1.0f;</div>
<div class="line">ublas_matrix(2,1) = -1.0f; ublas_matrix(2,2) =  2.0f; ublas_matrix(2,3) = -1.0f;</div>
<div class="line">ublas_matrix(3,2) = -1.0f; ublas_matrix(3,3) =  2.0f; ublas_matrix(3,4) = -1.0f;</div>
<div class="line">ublas_matrix(4,3) = -1.0f; ublas_matrix(4,4) =  2.0f;</div>
<div class="line"></div>
<div class="line">std::cout &lt;&lt; <span class="stringliteral">&quot;ublas matrix: &quot;</span> &lt;&lt; ublas_matrix &lt;&lt; std::endl;</div>
</div><!-- fragment --><p> Set up some ViennaCL objects and initialize with data from uBLAS objects </p>
<div class="fragment"><div class="line"><a name="_a3"></a><a class="code" href="classviennacl_1_1vector.html">viennacl::vector&lt;ScalarType&gt;</a> vcl_rhs(size);</div>
<div class="line"><a name="_a4"></a><a class="code" href="classviennacl_1_1compressed__matrix.html">viennacl::compressed_matrix&lt;ScalarType&gt;</a> vcl_compressed_matrix(size, size);</div>
<div class="line"></div>
<div class="line"><a name="a5"></a><a class="code" href="namespaceviennacl.html#a10b7f8cf6b8864a7aa196d670481a453">viennacl::copy</a>(rhs, vcl_rhs);</div>
<div class="line"><a class="code" href="namespaceviennacl.html#a10b7f8cf6b8864a7aa196d670481a453">viennacl::copy</a>(ublas_matrix, vcl_compressed_matrix);</div>
<div class="line"></div>
<div class="line"><span class="comment">// just get the data directly from the GPU and print it:</span></div>
<div class="line">ublas::compressed_matrix&lt;ScalarType&gt; temp(size, size);</div>
<div class="line"><a class="code" href="namespaceviennacl.html#a10b7f8cf6b8864a7aa196d670481a453">viennacl::copy</a>(vcl_compressed_matrix, temp);</div>
<div class="line">std::cout &lt;&lt; <span class="stringliteral">&quot;ViennaCL: &quot;</span> &lt;&lt; temp &lt;&lt; std::endl;</div>
<div class="line"></div>
<div class="line"><span class="comment">// now modify GPU data directly:</span></div>
<div class="line">std::cout &lt;&lt; <span class="stringliteral">&quot;Modifying vcl_compressed_matrix a bit: &quot;</span> &lt;&lt; std::endl;</div>
<div class="line">vcl_compressed_matrix(0, 0) =  3.0f;</div>
<div class="line">vcl_compressed_matrix(2, 3) = -3.0f;</div>
<div class="line">vcl_compressed_matrix(4, 2) = -3.0f;  <span class="comment">//this is a new nonzero entry</span></div>
<div class="line">vcl_compressed_matrix(4, 3) = -3.0f;</div>
<div class="line"></div>
<div class="line"><span class="comment">// and print it again:</span></div>
<div class="line"><a class="code" href="namespaceviennacl.html#a10b7f8cf6b8864a7aa196d670481a453">viennacl::copy</a>(vcl_compressed_matrix, temp);</div>
<div class="line">std::cout &lt;&lt; <span class="stringliteral">&quot;ViennaCL matrix copied to uBLAS matrix: &quot;</span> &lt;&lt; temp &lt;&lt; std::endl;</div>
</div><!-- fragment --><p> Compute matrix-vector products and output the results (should match): </p>
<div class="fragment"><div class="line">std::cout &lt;&lt; <span class="stringliteral">&quot;ublas: &quot;</span> &lt;&lt; <a name="a6"></a><a class="code" href="sparse__prod_8cpp.html#a2c8637b3d6a972d1d8fd85fb3089c6da">ublas::prod</a>(temp, rhs) &lt;&lt; std::endl;</div>
<div class="line">std::cout &lt;&lt; <span class="stringliteral">&quot;ViennaCL: &quot;</span> &lt;&lt; <a name="a7"></a><a class="code" href="namespaceviennacl_1_1linalg.html#aa18d10f8a90e38bd9ff43c650fc670ef">viennacl::linalg::prod</a>(vcl_compressed_matrix, vcl_rhs) &lt;&lt; std::endl;</div>
</div><!-- fragment --><p> That's it. Print a success message and exit. </p>
<div class="fragment"><div class="line">  std::cout &lt;&lt; <span class="stringliteral">&quot;!!!! TUTORIAL COMPLETED SUCCESSFULLY !!!!&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"></div>
<div class="line">  <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
<div class="line">}</div>
</div><!-- fragment --> <h2>Full Example Code</h2>
<div class="fragment"><div class="line"><span class="comment">/* =========================================================================</span></div>
<div class="line"><span class="comment">   Copyright (c) 2010-2016, Institute for Microelectronics,</span></div>
<div class="line"><span class="comment">                            Institute for Analysis and Scientific Computing,</span></div>
<div class="line"><span class="comment">                            TU Wien.</span></div>
<div class="line"><span class="comment">   Portions of this software are copyright by UChicago Argonne, LLC.</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">                            -----------------</span></div>
<div class="line"><span class="comment">                  ViennaCL - The Vienna Computing Library</span></div>
<div class="line"><span class="comment">                            -----------------</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">   Project Head:    Karl Rupp                   rupp@iue.tuwien.ac.at</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">   (A list of authors and contributors can be found in the PDF manual)</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">   License:         MIT (X11), see file LICENSE in the base directory</span></div>
<div class="line"><span class="comment">============================================================================= */</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// system headers</span></div>
<div class="line"><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// ublas headers</span></div>
<div class="line"><span class="preprocessor">#include &lt;boost/numeric/ublas/matrix_sparse.hpp&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;boost/numeric/ublas/matrix.hpp&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;boost/numeric/ublas/operation.hpp&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;boost/numeric/ublas/operation_sparse.hpp&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;boost/numeric/ublas/io.hpp&gt;</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// Must be set if you want to use ViennaCL algorithms on ublas objects</span></div>
<div class="line"><span class="preprocessor">#define VIENNACL_WITH_UBLAS 1</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// ViennaCL includes</span></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="scalar_8hpp.html">viennacl/scalar.hpp</a>&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="vector_8hpp.html">viennacl/vector.hpp</a>&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="compressed__matrix_8hpp.html">viennacl/compressed_matrix.hpp</a>&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="prod_8hpp.html">viennacl/linalg/prod.hpp</a>&quot;</span></div>
<div class="line"></div>
<div class="line"></div>
<div class="line"><span class="comment">// Additional helper functions for this tutorial:</span></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="vector-io_8hpp.html">vector-io.hpp</a>&quot;</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// Shortcut for writing &#39;ublas::&#39; instead of &#39;boost::numeric::ublas::&#39;</span></div>
<div class="line"><span class="keyword">using namespace </span>boost::numeric;</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> <a class="code" href="tests_2src_2sparse_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>()</div>
<div class="line">{</div>
<div class="line">  <span class="keyword">typedef</span> <span class="keywordtype">float</span>       <a class="code" href="fft__1d_8cpp.html#ad5c19ca4f47d3f8ec21232a5af2624e5">ScalarType</a>;</div>
<div class="line"></div>
<div class="line">  std::size_t <a class="code" href="namespaceviennacl_1_1traits.html#aa2344ea20469f55fbc15a8e9526494d0">size</a> = 5;</div>
<div class="line"></div>
<div class="line">  ublas::vector&lt;ScalarType&gt; rhs = ublas::scalar_vector&lt;ScalarType&gt;(<a class="code" href="namespaceviennacl_1_1traits.html#aa2344ea20469f55fbc15a8e9526494d0">size</a>, <a class="code" href="fft__1d_8cpp.html#ad5c19ca4f47d3f8ec21232a5af2624e5">ScalarType</a>(size));</div>
<div class="line">  ublas::compressed_matrix&lt;ScalarType&gt; ublas_matrix(size, size);</div>
<div class="line"></div>
<div class="line">  ublas_matrix(0,0) =  2.0f; ublas_matrix(0,1) = -1.0f;</div>
<div class="line">  ublas_matrix(1,0) = -1.0f; ublas_matrix(1,1) =  2.0f; ublas_matrix(1,2) = -1.0f;</div>
<div class="line">  ublas_matrix(2,1) = -1.0f; ublas_matrix(2,2) =  2.0f; ublas_matrix(2,3) = -1.0f;</div>
<div class="line">  ublas_matrix(3,2) = -1.0f; ublas_matrix(3,3) =  2.0f; ublas_matrix(3,4) = -1.0f;</div>
<div class="line">  ublas_matrix(4,3) = -1.0f; ublas_matrix(4,4) =  2.0f;</div>
<div class="line"></div>
<div class="line">  std::cout &lt;&lt; <span class="stringliteral">&quot;ublas matrix: &quot;</span> &lt;&lt; ublas_matrix &lt;&lt; std::endl;</div>
<div class="line"></div>
<div class="line">  <a class="code" href="classviennacl_1_1vector.html">viennacl::vector&lt;ScalarType&gt;</a> vcl_rhs(size);</div>
<div class="line">  <a class="code" href="classviennacl_1_1compressed__matrix.html">viennacl::compressed_matrix&lt;ScalarType&gt;</a> vcl_compressed_matrix(size, size);</div>
<div class="line"></div>
<div class="line">  <a class="code" href="namespaceviennacl.html#a10b7f8cf6b8864a7aa196d670481a453">viennacl::copy</a>(rhs, vcl_rhs);</div>
<div class="line">  <a class="code" href="namespaceviennacl.html#a10b7f8cf6b8864a7aa196d670481a453">viennacl::copy</a>(ublas_matrix, vcl_compressed_matrix);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// just get the data directly from the GPU and print it:</span></div>
<div class="line">  ublas::compressed_matrix&lt;ScalarType&gt; temp(size, size);</div>
<div class="line">  <a class="code" href="namespaceviennacl.html#a10b7f8cf6b8864a7aa196d670481a453">viennacl::copy</a>(vcl_compressed_matrix, temp);</div>
<div class="line">  std::cout &lt;&lt; <span class="stringliteral">&quot;ViennaCL: &quot;</span> &lt;&lt; temp &lt;&lt; std::endl;</div>
<div class="line"></div>
<div class="line">  <span class="comment">// now modify GPU data directly:</span></div>
<div class="line">  std::cout &lt;&lt; <span class="stringliteral">&quot;Modifying vcl_compressed_matrix a bit: &quot;</span> &lt;&lt; std::endl;</div>
<div class="line">  vcl_compressed_matrix(0, 0) =  3.0f;</div>
<div class="line">  vcl_compressed_matrix(2, 3) = -3.0f;</div>
<div class="line">  vcl_compressed_matrix(4, 2) = -3.0f;  <span class="comment">//this is a new nonzero entry</span></div>
<div class="line">  vcl_compressed_matrix(4, 3) = -3.0f;</div>
<div class="line"></div>
<div class="line">  <span class="comment">// and print it again:</span></div>
<div class="line">  <a class="code" href="namespaceviennacl.html#a10b7f8cf6b8864a7aa196d670481a453">viennacl::copy</a>(vcl_compressed_matrix, temp);</div>
<div class="line">  std::cout &lt;&lt; <span class="stringliteral">&quot;ViennaCL matrix copied to uBLAS matrix: &quot;</span> &lt;&lt; temp &lt;&lt; std::endl;</div>
<div class="line"></div>
<div class="line">  std::cout &lt;&lt; <span class="stringliteral">&quot;ublas: &quot;</span> &lt;&lt; <a class="code" href="sparse__prod_8cpp.html#a2c8637b3d6a972d1d8fd85fb3089c6da">ublas::prod</a>(temp, rhs) &lt;&lt; std::endl;</div>
<div class="line">  std::cout &lt;&lt; <span class="stringliteral">&quot;ViennaCL: &quot;</span> &lt;&lt; <a class="code" href="namespaceviennacl_1_1linalg.html#aa18d10f8a90e38bd9ff43c650fc670ef">viennacl::linalg::prod</a>(vcl_compressed_matrix, vcl_rhs) &lt;&lt; std::endl;</div>
<div class="line"></div>
<div class="line">  std::cout &lt;&lt; <span class="stringliteral">&quot;!!!! TUTORIAL COMPLETED SUCCESSFULLY !!!!&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"></div>
<div class="line">  <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
<div class="line">}</div>
<div class="line"></div>
</div><!-- fragment --> </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:38 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>