ViennaCL - The Vienna Computing Library: viennacl/linalg/sparse_matrix_operations.hpp Source File

ViennaCL - The Vienna Computing Library 1.7.1 Free open-source GPU-accelerated linear algebra and solver library. |

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sparse_matrix_operations.hpp
Go to the documentation of this file.
1 #ifndef VIENNACL_LINALG_SPARSE_MATRIX_OPERATIONS_HPP_
2 #define VIENNACL_LINALG_SPARSE_MATRIX_OPERATIONS_HPP_
3
4 /* =========================================================================
5 Copyright (c) 2010-2016, Institute for Microelectronics,
6 Institute for Analysis and Scientific Computing,
7 TU Wien.
8 Portions of this software are copyright by UChicago Argonne, LLC.
9
10 -----------------
11 ViennaCL - The Vienna Computing Library
12 -----------------
13
14 Project Head: Karl Rupp rupp@iue.tuwien.ac.at
15
16 (A list of authors and contributors can be found in the manual)
17
18 License: MIT (X11), see file LICENSE in the base directory
19 ============================================================================= */
20
25 #include "viennacl/forwards.h"
26 #include "viennacl/scalar.hpp"
27 #include "viennacl/vector.hpp"
28 #include "viennacl/matrix.hpp"
29 #include "viennacl/tools/tools.hpp"
30 #include "viennacl/linalg/host_based/sparse_matrix_operations.hpp"
31
32 #ifdef VIENNACL_WITH_OPENCL
33 #include "viennacl/linalg/opencl/sparse_matrix_operations.hpp"
34 #endif
35
36 #ifdef VIENNACL_WITH_CUDA
37 #include "viennacl/linalg/cuda/sparse_matrix_operations.hpp"
38 #endif
39
40 namespace viennacl
41 {
42 namespace linalg
43 {
44
45 namespace detail
46 {
47
48 template<typename SparseMatrixType, typename SCALARTYPE, unsigned int VEC_ALIGNMENT>
49 typename viennacl::enable_if< viennacl::is_any_sparse_matrix<SparseMatrixType>::value >::type
50 row_info(SparseMatrixType const & mat,
51 vector<SCALARTYPE, VEC_ALIGNMENT> & vec,
52 row_info_types info_selector)
53 {
54 switch (viennacl::traits::handle(mat).get_active_handle_id())
55 {
56 case viennacl::MAIN_MEMORY:
57 viennacl::linalg::host_based::detail::row_info(mat, vec, info_selector);
58 break;
59 #ifdef VIENNACL_WITH_OPENCL
60 case viennacl::OPENCL_MEMORY:
61 viennacl::linalg::opencl::detail::row_info(mat, vec, info_selector);
62 break;
63 #endif
64 #ifdef VIENNACL_WITH_CUDA
65 case viennacl::CUDA_MEMORY:
66 viennacl::linalg::cuda::detail::row_info(mat, vec, info_selector);
67 break;
68 #endif
69 case viennacl::MEMORY_NOT_INITIALIZED:
70 throw memory_exception("not initialised!");
71 default:
72 throw memory_exception("not implemented");
73 }
74 }
75
76 }
77
78
79
80 // A * x
81
90 template<typename SparseMatrixType, class ScalarType>
91 typename viennacl::enable_if< viennacl::is_any_sparse_matrix<SparseMatrixType>::value>::type
92 prod_impl(const SparseMatrixType & mat,
93 const viennacl::vector_base<ScalarType> & vec,
94 ScalarType alpha,
95 viennacl::vector_base<ScalarType> & result,
96 ScalarType beta)
97 {
98 assert( (mat.size1() == result.size()) && bool("Size check failed for compressed matrix-vector product: size1(mat) != size(result)"));
99 assert( (mat.size2() == vec.size()) && bool("Size check failed for compressed matrix-vector product: size2(mat) != size(x)"));
100
101 switch (viennacl::traits::handle(mat).get_active_handle_id())
102 {
103 case viennacl::MAIN_MEMORY:
104 viennacl::linalg::host_based::prod_impl(mat, vec, alpha, result, beta);
105 break;
106 #ifdef VIENNACL_WITH_OPENCL
107 case viennacl::OPENCL_MEMORY:
108 viennacl::linalg::opencl::prod_impl(mat, vec, alpha, result, beta);
109 break;
110 #endif
111 #ifdef VIENNACL_WITH_CUDA
112 case viennacl::CUDA_MEMORY:
113 viennacl::linalg::cuda::prod_impl(mat, vec, alpha, result, beta);
114 break;
115 #endif
116 case viennacl::MEMORY_NOT_INITIALIZED:
117 throw memory_exception("not initialised!");
118 default:
119 throw memory_exception("not implemented");
120 }
121 }
122
123
124 // A * B
133 template<typename SparseMatrixType, class ScalarType>
134 typename viennacl::enable_if< viennacl::is_any_sparse_matrix<SparseMatrixType>::value>::type
135 prod_impl(const SparseMatrixType & sp_mat,
136 const viennacl::matrix_base<ScalarType> & d_mat,
137 viennacl::matrix_base<ScalarType> & result)
138 {
139 assert( (sp_mat.size1() == result.size1()) && bool("Size check failed for compressed matrix - dense matrix product: size1(sp_mat) != size1(result)"));
140 assert( (sp_mat.size2() == d_mat.size1()) && bool("Size check failed for compressed matrix - dense matrix product: size2(sp_mat) != size1(d_mat)"));
141
142 switch (viennacl::traits::handle(sp_mat).get_active_handle_id())
143 {
144 case viennacl::MAIN_MEMORY:
145 viennacl::linalg::host_based::prod_impl(sp_mat, d_mat, result);
146 break;
147 #ifdef VIENNACL_WITH_OPENCL
148 case viennacl::OPENCL_MEMORY:
149 viennacl::linalg::opencl::prod_impl(sp_mat, d_mat, result);
150 break;
151 #endif
152 #ifdef VIENNACL_WITH_CUDA
153 case viennacl::CUDA_MEMORY:
154 viennacl::linalg::cuda::prod_impl(sp_mat, d_mat, result);
155 break;
156 #endif
157 case viennacl::MEMORY_NOT_INITIALIZED:
158 throw memory_exception("not initialised!");
159 default:
160 throw memory_exception("not implemented");
161 }
162 }
163
164 // A * transpose(B)
173 template<typename SparseMatrixType, class ScalarType>
174 typename viennacl::enable_if< viennacl::is_any_sparse_matrix<SparseMatrixType>::value>::type
175 prod_impl(const SparseMatrixType & sp_mat,
176 const viennacl::matrix_expression<const viennacl::matrix_base<ScalarType>,
177 const viennacl::matrix_base<ScalarType>,
178 viennacl::op_trans>& d_mat,
179 viennacl::matrix_base<ScalarType> & result)
180 {
181 assert( (sp_mat.size1() == result.size1()) && bool("Size check failed for compressed matrix - dense matrix product: size1(sp_mat) != size1(result)"));
182 assert( (sp_mat.size2() == d_mat.size1()) && bool("Size check failed for compressed matrix - dense matrix product: size2(sp_mat) != size1(d_mat)"));
183
184 switch (viennacl::traits::handle(sp_mat).get_active_handle_id())
185 {
186 case viennacl::MAIN_MEMORY:
187 viennacl::linalg::host_based::prod_impl(sp_mat, d_mat, result);
188 break;
189 #ifdef VIENNACL_WITH_OPENCL
190 case viennacl::OPENCL_MEMORY:
191 viennacl::linalg::opencl::prod_impl(sp_mat, d_mat, result);
192 break;
193 #endif
194 #ifdef VIENNACL_WITH_CUDA
195 case viennacl::CUDA_MEMORY:
196 viennacl::linalg::cuda::prod_impl(sp_mat, d_mat, result);
197 break;
198 #endif
199 case viennacl::MEMORY_NOT_INITIALIZED:
200 throw memory_exception("not initialised!");
201 default:
202 throw memory_exception("not implemented");
203 }
204 }
205
206 // A * B with both A and B sparse
207
217 template<typename NumericT>
218 void
219 prod_impl(const viennacl::compressed_matrix<NumericT> & A,
220 const viennacl::compressed_matrix<NumericT> & B,
221 viennacl::compressed_matrix<NumericT> & C)
222 {
223 assert( (A.size2() == B.size1()) && bool("Size check failed for sparse matrix-matrix product: size2(A) != size1(B)"));
224 assert( (C.size1() == 0 || C.size1() == A.size1()) && bool("Size check failed for sparse matrix-matrix product: size1(A) != size1(C)"));
225 assert( (C.size2() == 0 || C.size2() == B.size2()) && bool("Size check failed for sparse matrix-matrix product: size2(B) != size2(B)"));
226
227 switch (viennacl::traits::handle(A).get_active_handle_id())
228 {
229 case viennacl::MAIN_MEMORY:
230 viennacl::linalg::host_based::prod_impl(A, B, C);
231 break;
232 #ifdef VIENNACL_WITH_OPENCL
233 case viennacl::OPENCL_MEMORY:
234 viennacl::linalg::opencl::prod_impl(A, B, C);
235 break;
236 #endif
237 #ifdef VIENNACL_WITH_CUDA
238 case viennacl::CUDA_MEMORY:
239 viennacl::linalg::cuda::prod_impl(A, B, C);
240 break;
241 #endif
242 case viennacl::MEMORY_NOT_INITIALIZED:
243 throw memory_exception("not initialised!");
244 default:
245 throw memory_exception("not implemented");
246 }
247 }
248
249
256 template<typename SparseMatrixType, class ScalarType, typename SOLVERTAG>
257 typename viennacl::enable_if< viennacl::is_any_sparse_matrix<SparseMatrixType>::value>::type
258 inplace_solve(const SparseMatrixType & mat,
259 viennacl::vector_base<ScalarType> & vec,
260 SOLVERTAG tag)
261 {
262 assert( (mat.size1() == mat.size2()) && bool("Size check failed for triangular solve on compressed matrix: size1(mat) != size2(mat)"));
263 assert( (mat.size2() == vec.size()) && bool("Size check failed for compressed matrix-vector product: size2(mat) != size(x)"));
264
265 switch (viennacl::traits::handle(mat).get_active_handle_id())
266 {
267 case viennacl::MAIN_MEMORY:
268 viennacl::linalg::host_based::inplace_solve(mat, vec, tag);
269 break;
270 #ifdef VIENNACL_WITH_OPENCL
271 case viennacl::OPENCL_MEMORY:
272 viennacl::linalg::opencl::inplace_solve(mat, vec, tag);
273 break;
274 #endif
275 #ifdef VIENNACL_WITH_CUDA
276 case viennacl::CUDA_MEMORY:
277 viennacl::linalg::cuda::inplace_solve(mat, vec, tag);
278 break;
279 #endif
280 case viennacl::MEMORY_NOT_INITIALIZED:
281 throw memory_exception("not initialised!");
282 default:
283 throw memory_exception("not implemented");
284 }
285 }
286
287
294 template<typename SparseMatrixType, class ScalarType, typename SOLVERTAG>
295 typename viennacl::enable_if< viennacl::is_any_sparse_matrix<SparseMatrixType>::value>::type
296 inplace_solve(const matrix_expression<const SparseMatrixType, const SparseMatrixType, op_trans> & mat,
297 viennacl::vector_base<ScalarType> & vec,
298 SOLVERTAG tag)
299 {
300 assert( (mat.size1() == mat.size2()) && bool("Size check failed for triangular solve on transposed compressed matrix: size1(mat) != size2(mat)"));
301 assert( (mat.size1() == vec.size()) && bool("Size check failed for transposed compressed matrix triangular solve: size1(mat) != size(x)"));
302
303 switch (viennacl::traits::handle(mat.lhs()).get_active_handle_id())
304 {
305 case viennacl::MAIN_MEMORY:
306 viennacl::linalg::host_based::inplace_solve(mat, vec, tag);
307 break;
308 #ifdef VIENNACL_WITH_OPENCL
309 case viennacl::OPENCL_MEMORY:
310 viennacl::linalg::opencl::inplace_solve(mat, vec, tag);
311 break;
312 #endif
313 #ifdef VIENNACL_WITH_CUDA
314 case viennacl::CUDA_MEMORY:
315 viennacl::linalg::cuda::inplace_solve(mat, vec, tag);
316 break;
317 #endif
318 case viennacl::MEMORY_NOT_INITIALIZED:
319 throw memory_exception("not initialised!");
320 default:
321 throw memory_exception("not implemented");
322 }
323 }
324
325
326
327 namespace detail
328 {
329
330 template<typename SparseMatrixType, class ScalarType, typename SOLVERTAG>
331 typename viennacl::enable_if< viennacl::is_any_sparse_matrix<SparseMatrixType>::value>::type
332 block_inplace_solve(const matrix_expression<const SparseMatrixType, const SparseMatrixType, op_trans> & mat,
333 viennacl::backend::mem_handle const & block_index_array, vcl_size_t num_blocks,
334 viennacl::vector_base<ScalarType> const & mat_diagonal,
335 viennacl::vector_base<ScalarType> & vec,
336 SOLVERTAG tag)
337 {
338 assert( (mat.size1() == mat.size2()) && bool("Size check failed for triangular solve on transposed compressed matrix: size1(mat) != size2(mat)"));
339 assert( (mat.size1() == vec.size()) && bool("Size check failed for transposed compressed matrix triangular solve: size1(mat) != size(x)"));
340
341 switch (viennacl::traits::handle(mat.lhs()).get_active_handle_id())
342 {
343 case viennacl::MAIN_MEMORY:
344 viennacl::linalg::host_based::detail::block_inplace_solve(mat, block_index_array, num_blocks, mat_diagonal, vec, tag);
345 break;
346 #ifdef VIENNACL_WITH_OPENCL
347 case viennacl::OPENCL_MEMORY:
348 viennacl::linalg::opencl::detail::block_inplace_solve(mat, block_index_array, num_blocks, mat_diagonal, vec, tag);
349 break;
350 #endif
351 #ifdef VIENNACL_WITH_CUDA
352 case viennacl::CUDA_MEMORY:
353 viennacl::linalg::cuda::detail::block_inplace_solve(mat, block_index_array, num_blocks, mat_diagonal, vec, tag);
354 break;
355 #endif
356 case viennacl::MEMORY_NOT_INITIALIZED:
357 throw memory_exception("not initialised!");
358 default:
359 throw memory_exception("not implemented");
360 }
361 }
362
363
364 }
365
366
367
368 } //namespace linalg
369
370
372 template<typename M1>
373 typename viennacl::enable_if<viennacl::is_any_sparse_matrix<M1>::value,
374 matrix_expression< const M1, const M1, op_trans>
375 >::type
376 trans(const M1 & mat)
377 {
378 return matrix_expression< const M1, const M1, op_trans>(mat, mat);
379 }
380
381 //free functions:
387 template<typename SCALARTYPE, typename SparseMatrixType>
388 typename viennacl::enable_if< viennacl::is_any_sparse_matrix<SparseMatrixType>::value,
389 viennacl::vector<SCALARTYPE> >::type
390 operator+(viennacl::vector_base<SCALARTYPE> & result,
391 const viennacl::vector_expression< const SparseMatrixType, const viennacl::vector_base<SCALARTYPE>, viennacl::op_prod> & proxy)
392 {
393 assert(proxy.lhs().size1() == result.size() && bool("Dimensions for addition of sparse matrix-vector product to vector don't match!"));
394 vector<SCALARTYPE> temp(proxy.lhs().size1());
395 viennacl::linalg::prod_impl(proxy.lhs(), proxy.rhs(), temp);
396 result += temp;
397 return result;
398 }
399
405 template<typename SCALARTYPE, typename SparseMatrixType>
406 typename viennacl::enable_if< viennacl::is_any_sparse_matrix<SparseMatrixType>::value,
407 viennacl::vector<SCALARTYPE> >::type
408 operator-(viennacl::vector_base<SCALARTYPE> & result,
409 const viennacl::vector_expression< const SparseMatrixType, const viennacl::vector_base<SCALARTYPE>, viennacl::op_prod> & proxy)
410 {
411 assert(proxy.lhs().size1() == result.size() && bool("Dimensions for addition of sparse matrix-vector product to vector don't match!"));
412 vector<SCALARTYPE> temp(proxy.lhs().size1());
413 viennacl::linalg::prod_impl(proxy.lhs(), proxy.rhs(), temp);
414 result += temp;
415 return result;
416 }
417
418 } //namespace viennacl
419
420
421 #endif
viennacl::compressed_matrix::size2
const vcl_size_t & size2() const
Returns the number of columns.
Definition: compressed_matrix.hpp:929
viennacl::enable_if
Simple enable-if variant that uses the SFINAE pattern.
Definition: enable_if.hpp:30
viennacl::linalg::cuda::inplace_solve
void inplace_solve(matrix_base< NumericT > const &A, matrix_base< NumericT > &B, SolverTagT tag)
Direct inplace solver for triangular systems with multiple right hand sides, i.e. A \ B (MATLAB notat...
Definition: direct_solve.hpp:253
viennacl::linalg::inplace_solve
void inplace_solve(const matrix_base< NumericT > &A, matrix_base< NumericT > &B, SolverTagT)
Direct inplace solver for triangular systems with multiple right hand sides, i.e. A \ B (MATLAB notat...
Definition: direct_solve.hpp:217
viennacl::trans
viennacl::enable_if< viennacl::is_any_sparse_matrix< M1 >::value, matrix_expression< const M1, const M1, op_trans > >::type trans(const M1 &mat)
Returns an expression template class representing a transposed matrix.
Definition: sparse_matrix_operations.hpp:376
viennacl::linalg::detail::row_info_types
row_info_types
Definition: forwards.h:837
viennacl::linalg::opencl::prod_impl
void prod_impl(const matrix_base< NumericT > &mat, bool trans_A, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
Definition: matrix_operations.hpp:620
viennacl::memory_exception
Exception class in case of memory errors.
Definition: forwards.h:572
viennacl::compressed_matrix::size1
const vcl_size_t & size1() const
Returns the number of rows.
Definition: compressed_matrix.hpp:927
matrix.hpp
Implementation of the dense matrix class.
tools.hpp
Various little tools used here and there in ViennaCL.
sparse_matrix_operations.hpp
Implementations of operations using sparse matrices on the CPU using a single thread or OpenMP...
viennacl::linalg::host_based::inplace_solve
void inplace_solve(matrix_base< NumericT > const &A, matrix_base< NumericT > &B, SolverTagT)
Direct inplace solver for triangular systems with multiple right hand sides, i.e. A \ B (MATLAB notat...
Definition: direct_solve.hpp:130
viennacl::OPENCL_MEMORY
Definition: forwards.h:349
viennacl::matrix_base
Definition: matrix_def.hpp:103
viennacl::matrix_expression
Expression template class for representing a tree of expressions which ultimately result in a matrix...
Definition: forwards.h:341
forwards.h
This file provides the forward declarations for the main types used within ViennaCL.
viennacl::linalg::cuda::detail::row_info
void row_info(compressed_matrix< NumericT, AligmentV > const &mat, vector_base< NumericT > &vec, viennacl::linalg::detail::row_info_types info_selector)
Definition: sparse_matrix_operations.hpp:107
viennacl::linalg::cuda::prod_impl
void prod_impl(const matrix_base< NumericT > &mat, bool mat_transpose, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
Definition: matrix_operations.hpp:1464
viennacl::vector_expression
An expression template class that represents a binary operation that yields a vector.
Definition: forwards.h:239
viennacl::matrix_expression::size1
vcl_size_t size1() const
Returns the size of the result vector.
Definition: matrix.hpp:72
viennacl::operator-
viennacl::vector< NumericT > operator-(const vector_base< NumericT > &v1, const vector_expression< const matrix_base< NumericT >, const vector_base< NumericT >, op_prod > &proxy)
Implementation of the operation 'result = v1 - A * v2', where A is a matrix.
Definition: matrix_operations.hpp:1200
viennacl::MEMORY_NOT_INITIALIZED
Definition: forwards.h:347
viennacl::CUDA_MEMORY
Definition: forwards.h:350
viennacl::linalg::host_based::prod_impl
void prod_impl(const matrix_base< NumericT > &mat, bool trans, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
Definition: matrix_operations.hpp:993
sparse_matrix_operations.hpp
Implementations of operations using sparse matrices using CUDA.
viennacl::matrix_expression::size2
vcl_size_t size2() const
Definition: matrix.hpp:73
viennacl::vector_base
Common base class for dense vectors, vector ranges, and vector slices.
Definition: vector_def.hpp:104
viennacl::vcl_size_t
std::size_t vcl_size_t
Definition: forwards.h:75
viennacl::linalg::host_based::detail::block_inplace_solve
void block_inplace_solve(const matrix_expression< const compressed_matrix< NumericT, AlignmentV >, const compressed_matrix< NumericT, AlignmentV >, op_trans > &L, viennacl::backend::mem_handle const &, vcl_size_t, vector_base< NumericT > const &, vector_base< NumericT > &vec, viennacl::linalg::unit_lower_tag)
Definition: sparse_matrix_operations.hpp:824
viennacl::vector
Definition: forwards.h:266
viennacl::linalg::cuda::detail::block_inplace_solve
void block_inplace_solve(const matrix_expression< const compressed_matrix< NumericT, AlignmentV >, const compressed_matrix< NumericT, AlignmentV >, op_trans > &L, viennacl::backend::mem_handle const &block_indices, vcl_size_t num_blocks, vector_base< NumericT > const &, vector_base< NumericT > &vec, viennacl::linalg::unit_lower_tag)
Definition: sparse_matrix_operations.hpp:970
viennacl::matrix_base::size1
size_type size1() const
Returns the number of rows.
Definition: matrix_def.hpp:224
sparse_matrix_operations.hpp
Implementations of operations using sparse matrices and OpenCL.
viennacl::MAIN_MEMORY
Definition: forwards.h:348
viennacl::linalg::opencl::inplace_solve
void inplace_solve(matrix_base< NumericT > const &A, matrix_base< NumericT > &B, SolverTagT)
Direct inplace solver for dense triangular systems. Matlab notation: A \ B.
Definition: direct_solve.hpp:77
viennacl::operator+
viennacl::vector< NumericT > operator+(const vector_base< NumericT > &v1, const vector_expression< const matrix_base< NumericT >, const vector_base< NumericT >, op_prod > &proxy)
Implementation of the operation 'result = v1 + A * v2', where A is a matrix.
Definition: matrix_operations.hpp:1182
viennacl::op_prod
A tag class representing matrix-vector products and element-wise multiplications. ...
Definition: forwards.h:94
vector.hpp
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
viennacl::vector_base::size
size_type size() const
Returns the length of the vector (cf. std::vector)
Definition: vector_def.hpp:118
ScalarType
float ScalarType
Definition: fft_1d.cpp:42
viennacl::backend::mem_handle
Main abstraction class for multiple memory domains. Represents a buffer in either main RAM...
Definition: mem_handle.hpp:89
viennacl::op_trans
A tag class representing transposed matrices.
Definition: forwards.h:220
viennacl::linalg::host_based::detail::row_info
void row_info(compressed_matrix< NumericT, AlignmentV > const &mat, vector_base< NumericT > &vec, viennacl::linalg::detail::row_info_types info_selector)
Definition: sparse_matrix_operations.hpp:53
viennacl::compressed_matrix< NumericT >
viennacl::linalg::prod_impl
void prod_impl(const matrix_base< NumericT > &mat, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
Definition: matrix_operations.hpp:438
viennacl::traits::handle
viennacl::backend::mem_handle & handle(T &obj)
Returns the generic memory handle of an object. Non-const version.
Definition: handle.hpp:41
viennacl::linalg::opencl::detail::block_inplace_solve
void block_inplace_solve(const matrix_expression< const compressed_matrix< NumericT, AlignmentV >, const compressed_matrix< NumericT, AlignmentV >, op_trans > &L, viennacl::backend::mem_handle const &block_indices, vcl_size_t num_blocks, vector_base< NumericT > const &, vector_base< NumericT > &x, viennacl::linalg::unit_lower_tag)
Definition: sparse_matrix_operations.hpp:483
viennacl::matrix_expression::lhs
LHS & lhs() const
Get left hand side operand.
Definition: matrix.hpp:66
viennacl::linalg::detail::row_info
viennacl::enable_if< viennacl::is_any_sparse_matrix< SparseMatrixType >::value >::type row_info(SparseMatrixType const &mat, vector< SCALARTYPE, VEC_ALIGNMENT > &vec, row_info_types info_selector)
Definition: sparse_matrix_operations.hpp:50
scalar.hpp
Implementation of the ViennaCL scalar class.
viennacl::linalg::opencl::detail::row_info
void row_info(compressed_matrix< NumericT, AlignmentV > const &A, vector_base< NumericT > &x, viennacl::linalg::detail::row_info_types info_selector)
Definition: sparse_matrix_operations.hpp:56
viennacl::backend::mem_handle::get_active_handle_id
memory_types get_active_handle_id() const
Returns an ID for the currently active memory buffer. Other memory buffers might contain old or no da...
Definition: mem_handle.hpp:118
viennacl::linalg::detail::block_inplace_solve
viennacl::enable_if< viennacl::is_any_sparse_matrix< SparseMatrixType >::value >::type block_inplace_solve(const matrix_expression< const SparseMatrixType, const SparseMatrixType, op_trans > &mat, viennacl::backend::mem_handle const &block_index_array, vcl_size_t num_blocks, viennacl::vector_base< ScalarType > const &mat_diagonal, viennacl::vector_base< ScalarType > &vec, SOLVERTAG tag)
Definition: sparse_matrix_operations.hpp:332