1 #ifndef VIENNACL_LINALG_HOST_BASED_MISC_OPERATIONS_HPP_
2 #define VIENNACL_LINALG_HOST_BASED_MISC_OPERATIONS_HPP_
41 template <
typename ScalarType>
50 ScalarType * vec_buf = viennacl::linalg::host_based::detail::extract_raw_pointer<ScalarType>(vec.
handle());
52 unsigned int const * elim_row_index = viennacl::linalg::host_based::detail::extract_raw_pointer<unsigned int>(row_index_array);
53 unsigned int const * elim_row_buffer = viennacl::linalg::host_based::detail::extract_raw_pointer<unsigned int>(row_buffer);
54 unsigned int const * elim_col_buffer = viennacl::linalg::host_based::detail::extract_raw_pointer<unsigned int>(col_buffer);
55 ScalarType
const * elim_elements = viennacl::linalg::host_based::detail::extract_raw_pointer<ScalarType>(element_buffer);
57 #ifdef VIENNACL_WITH_OPENMP
58 #pragma omp parallel for
60 for (
long row=0; row < static_cast<long>(num_rows); ++
row)
62 unsigned int eq_row = elim_row_index[
row];
63 ScalarType vec_entry = vec_buf[eq_row];
64 unsigned int row_end = elim_row_buffer[
row+1];
67 vec_entry -= vec_buf[elim_col_buffer[j]] * elim_elements[j];
69 vec_buf[eq_row] = vec_entry;
std::size_t vcl_size_t
Definition: forwards.h:58
This file provides the forward declarations for the main types used within ViennaCL.
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
Definition: cpu_ram.hpp:29
void level_scheduling_substitute(vector< ScalarType > &vec, viennacl::backend::mem_handle const &row_index_array, viennacl::backend::mem_handle const &row_buffer, viennacl::backend::mem_handle const &col_buffer, viennacl::backend::mem_handle const &element_buffer, vcl_size_t num_rows)
Definition: misc_operations.hpp:42
vector_expression< const matrix_base< NumericT, F >, const unsigned int, op_row > row(const matrix_base< NumericT, F > &A, unsigned int i)
Definition: matrix.hpp:910
Common routines for single-threaded or OpenMP-enabled execution on CPU.
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
const handle_type & handle() const
Returns the memory handle.
Definition: vector.hpp:856
Main abstraction class for multiple memory domains. Represents a buffer in either main RAM...
Definition: mem_handle.hpp:62
Implementation of the ViennaCL scalar class.