1 #ifndef VIENNACL_LINALG_JACOBI_PRECOND_HPP_
2 #define VIENNACL_LINALG_JACOBI_PRECOND_HPP_
48 template<
typename MatrixT,
49 bool is_viennacl = detail::row_scaling_for_viennacl<MatrixT>::value >
52 typedef typename MatrixT::value_type NumericType;
60 void init(MatrixT
const & mat)
64 for (
typename MatrixT::const_iterator1 row_it = mat.begin1();
68 bool diag_found =
false;
69 for (
typename MatrixT::const_iterator2 col_it = row_it.begin();
70 col_it != row_it.end();
73 if (col_it.index1() == col_it.index2())
75 diag_A_[col_it.index1()] = *col_it;
86 template<
typename VectorT>
95 std::vector<NumericType> diag_A_;
103 template<
typename MatrixT>
121 template<
unsigned int AlignmentV>
viennacl::vector_expression< const vector_base< T >, const vector_base< T >, op_element_binary< op_div > > element_div(vector_base< T > const &v1, vector_base< T > const &v2)
Jacobi preconditioner class, can be supplied to solve()-routines. Generic version for non-ViennaCL ma...
vcl_size_t size1(MatrixType const &mat)
Generic routine for obtaining the number of rows of a matrix (ViennaCL, uBLAS, etc.)
This file provides the forward declarations for the main types used within ViennaCL.
A tag for a jacobi preconditioner.
void apply(viennacl::vector< NumericType, AlignmentV > &vec) const
void init(MatrixT const &mat)
Represents a generic 'context' similar to an OpenCL context, but is backend-agnostic and thus also su...
Meta function which checks whether a tag is tag_viennacl.
void init(MatrixT const &mat)
vcl_size_t size(VectorType const &vec)
Generic routine for obtaining the size of a vector (ViennaCL, uBLAS, etc.)
jacobi_precond(MatrixT const &mat, jacobi_tag const &)
Implementation of the compressed_matrix class.
Implementations of operations using sparse matrices.
void apply(VectorT &vec) const
Apply to res = b - Ax, i.e. jacobi applied vec (right hand side),.
T::ERROR_CANNOT_DEDUCE_CPU_SCALAR_TYPE_FOR_T type
A row normalization preconditioner is implemented here.
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
jacobi_precond(MatrixT const &mat, jacobi_tag const &)
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)