16#ifndef dealii_diagonal_matrix_h
17#define dealii_diagonal_matrix_h
47template <
typename VectorType = Vector<
double>>
151 template <
typename number2>
156 const number2 * values,
157 const bool elide_zero_values =
true,
158 const bool col_indices_are_sorted =
false);
173 vmult(VectorType &dst,
const VectorType &src)
const;
181 Tvmult(VectorType &dst,
const VectorType &src)
const;
189 vmult_add(VectorType &dst,
const VectorType &src)
const;
218 const unsigned int end_range,
219 const value_type * src_pointer_to_current_range,
220 value_type * dst_pointer_to_current_range)
const;
249template <
typename VectorType>
256template <
typename VectorType>
265template <
typename VectorType>
269 return diagonal.memory_consumption();
274template <
typename VectorType>
283template <
typename VectorType>
287 dst.reinit(diagonal);
292template <
typename VectorType>
301template <
typename VectorType>
310template <
typename VectorType>
319template <
typename VectorType>
320typename VectorType::size_type
328template <
typename VectorType>
329typename VectorType::size_type
337template <
typename VectorType>
338typename VectorType::value_type
340 const size_type j)
const
349template <
typename VectorType>
350typename VectorType::value_type &
360template <
typename VectorType>
361template <
typename number2>
364 const size_type n_cols,
365 const size_type *col_indices,
366 const number2 * values,
370 for (size_type i = 0; i < n_cols; ++i)
371 if (col_indices[i] == row)
377template <
typename VectorType>
381 const value_type value)
389template <
typename VectorType>
399template <
typename VectorType>
408template <
typename VectorType>
411 const VectorType &src)
const
420template <
typename VectorType>
423 const VectorType &src)
const
430template <
typename VectorType>
431typename VectorType::value_type
433 const value_type src)
const
436 return diagonal.local_element(index) * src;
441template <
typename VectorType>
444 const unsigned int begin_range,
445 const unsigned int end_range,
446 const value_type * src_pointer_to_current_range,
447 value_type * dst_pointer_to_current_range)
const
450 diagonal.locally_owned_elements().n_elements() + 1);
452 diagonal.locally_owned_elements().n_elements() + 1);
454 const value_type * diagonal_entry =
diagonal.begin() + begin_range;
455 const unsigned int length = end_range - begin_range;
458 for (
unsigned int i = 0; i < length; ++i)
459 dst_pointer_to_current_range[i] =
460 diagonal_entry[i] * src_pointer_to_current_range[i];
void initialize_dof_vector(VectorType &dst) const
void Tvmult_add(VectorType &dst, const VectorType &src) const
value_type apply(const unsigned int index, const value_type src) const
void apply_to_subrange(const unsigned int begin_range, const unsigned int end_range, const value_type *src_pointer_to_current_range, value_type *dst_pointer_to_current_range) const
value_type & operator()(const size_type i, const size_type j)
VectorType & get_vector()
std::size_t memory_consumption() const
void add(const size_type i, const size_type j, const value_type value)
DiagonalMatrix(const VectorType &vec)
value_type operator()(const size_type i, const size_type j) const
typename VectorType::size_type size_type
void compress(VectorOperation::values operation)
const VectorType & get_vector() const
void vmult(VectorType &dst, const VectorType &src) const
void reinit(const VectorType &vec)
void add(const size_type row, const size_type n_cols, const size_type *col_indices, const number2 *values, const bool elide_zero_values=true, const bool col_indices_are_sorted=false)
typename VectorType::value_type value_type
void vmult_add(VectorType &dst, const VectorType &src) const
void Tvmult(VectorType &dst, const VectorType &src) const
#define DEAL_II_OPENMP_SIMD_PRAGMA
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcIndexRange(std::size_t arg1, std::size_t arg2, std::size_t arg3)
@ diagonal
Matrix is diagonal.