1 #ifndef VIENNACL_LINALG_HOST_BASED_DIRECT_SOLVE_HPP
2 #define VIENNACL_LINALG_HOST_BASED_DIRECT_SOLVE_HPP
42 template<
typename MatrixT1,
typename MatrixT2>
45 typedef typename MatrixT2::value_type value_type;
51 for (
vcl_size_t j = current_row + 1; j < A_size; ++j)
53 value_type A_element = A(current_row, j);
55 B(current_row, k) -= A_element * B(j, k);
60 value_type A_diag = A(current_row, current_row);
62 B(current_row, k) /= A_diag;
67 template<
typename MatrixT1,
typename MatrixT2>
73 template<
typename MatrixT1,
typename MatrixT2>
82 template<
typename MatrixT1,
typename MatrixT2>
85 typedef typename MatrixT2::value_type value_type;
91 value_type A_element = A(i, j);
93 B(i, k) -= A_element * B(j, k);
98 value_type A_diag = A(i, i);
105 template<
typename MatrixT1,
typename MatrixT2>
111 template<
typename MatrixT1,
typename MatrixT2>
129 template<
typename NumericT,
typename SolverTagT>
136 value_type
const * data_A = detail::extract_raw_pointer<value_type>(A);
137 value_type * data_B = detail::extract_raw_pointer<value_type>(B);
198 template<
typename MatrixT,
typename VectorT>
201 typedef typename VectorT::value_type value_type;
207 for (
vcl_size_t j = current_row + 1; j < A_size; ++j)
209 value_type A_element = A(current_row, j);
210 b(current_row) -= A_element * b(j);
214 b(current_row) /= A(current_row, current_row);
218 template<
typename MatrixT,
typename VectorT>
224 template<
typename MatrixT,
typename VectorT>
233 template<
typename MatrixT,
typename VectorT>
236 typedef typename VectorT::value_type value_type;
242 value_type A_element = A(i, j);
243 b(i) -= A_element * b(j);
251 template<
typename MatrixT,
typename VectorT>
257 template<
typename MatrixT,
typename VectorT>
265 template<
typename NumericT,
typename SolverTagT>
272 value_type
const * data_A = detail::extract_raw_pointer<value_type>(mat);
273 value_type * data_v = detail::extract_raw_pointer<value_type>(vec);
Helper class for accessing a strided subvector of a larger vector.
result_of::size_type< matrix_base< NumericT > >::type stride1(matrix_base< NumericT > const &s)
Implementation of the dense matrix class.
vcl_size_t internal_size1(matrix_base< NumericT > const &mat)
Helper routine for obtaining the internal number of entries per row of a ViennaCL matrix...
void lower_inplace_solve_vector(MatrixT &A, VectorT &b, vcl_size_t A_size, bool unit_diagonal)
A tag class representing a lower triangular matrix.
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...
vcl_size_t internal_size2(matrix_base< NumericT > const &mat)
Helper routine for obtaining the internal number of entries per column of a ViennaCL matrix...
result_of::size_type< viennacl::vector_base< T > >::type stride(viennacl::vector_base< T > const &s)
result_of::size_type< T >::type start1(T const &obj)
void upper_inplace_solve_vector(MatrixT &A, VectorT &b, vcl_size_t A_size, bool unit_diagonal)
result_of::size_type< MatrixType >::type size2(MatrixType const &mat)
Generic routine for obtaining the number of columns of a matrix (ViennaCL, uBLAS, etc...
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
void lower_inplace_solve_matrix(MatrixT1 &A, MatrixT2 &B, vcl_size_t A_size, vcl_size_t B_size, bool unit_diagonal)
result_of::size_type< T >::type start2(T const &obj)
Helper array for accessing a strided submatrix embedded in a larger matrix.
A tag class representing an upper triangular matrix.
result_of::size_type< T >::type start(T const &obj)
Common routines for single-threaded or OpenMP-enabled execution on CPU.
result_of::size_type< matrix_base< NumericT > >::type stride2(matrix_base< NumericT > const &s)
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
void upper_inplace_solve_matrix(MatrixT1 &A, MatrixT2 &B, vcl_size_t A_size, vcl_size_t B_size, bool unit_diagonal)
void inplace_solve_vector(MatrixT &A, VectorT &b, vcl_size_t A_size, viennacl::linalg::unit_upper_tag)
A tag class representing a lower triangular matrix with unit diagonal.
void inplace_solve_matrix(MatrixT1 &A, MatrixT2 &B, vcl_size_t A_size, vcl_size_t B_size, viennacl::linalg::unit_upper_tag)
A tag class representing an upper triangular matrix with unit diagonal.