16 #ifndef dealii_diagonal_matrix_h
17 #define dealii_diagonal_matrix_h
29 template <
typename number>
35 template <
typename,
typename>
61 template <
typename VectorType = Vector<
double>>
165 template <
typename number2>
171 const bool elide_zero_values =
true,
172 const bool col_indices_are_sorted =
false);
187 vmult(VectorType &dst,
const VectorType &src)
const;
195 Tvmult(VectorType &dst,
const VectorType &src)
const;
203 vmult_add(VectorType &dst,
const VectorType &src)
const;
232 const unsigned int end_range,
233 const value_type *src_pointer_to_current_range,
234 value_type *dst_pointer_to_current_range)
const;
263 template <
typename VectorType>
270 template <
typename VectorType>
279 template <
typename VectorType>
283 return diagonal.memory_consumption();
288 template <
typename VectorType>
297 template <
typename VectorType>
306 template <
typename VectorType>
315 template <
typename VectorType>
324 template <
typename VectorType>
333 template <
typename VectorType>
342 template <
typename VectorType>
351 template <
typename VectorType>
352 typename VectorType::value_type
363 template <
typename VectorType>
364 typename VectorType::value_type &
374 template <
typename VectorType>
375 template <
typename number2>
385 if (col_indices[i] == row)
391 template <
typename VectorType>
395 const value_type value)
407 template <
typename VectorType>
409 assign_and_scale(VectorType &dst,
410 const VectorType &src,
417 template <
typename Number>
425 auto *
const dst_ptr = dst.
begin();
426 const auto *
const src_ptr = src.
begin();
427 const auto *
const diagonal_ptr =
diagonal.begin();
431 dst_ptr[i] = src_ptr[i] * diagonal_ptr[i];
438 template <
typename VectorType>
442 internal::DiagonalMatrix::assign_and_scale(dst, src,
diagonal);
447 template <
typename VectorType>
456 template <
typename VectorType>
459 const VectorType &src)
const
468 template <
typename VectorType>
471 const VectorType &src)
const
478 template <
typename VectorType>
479 typename VectorType::value_type
481 const value_type src)
const
484 return diagonal.local_element(index) * src;
489 template <
typename VectorType>
492 const unsigned int begin_range,
493 const unsigned int end_range,
494 const value_type *src_pointer_to_current_range,
495 value_type *dst_pointer_to_current_range)
const
498 diagonal.locally_owned_elements().n_elements() + 1);
500 diagonal.locally_owned_elements().n_elements() + 1);
502 const value_type *diagonal_entry =
diagonal.begin() + begin_range;
503 const unsigned int length = end_range - begin_range;
506 for (
unsigned int i = 0; i < length; ++i)
507 dst_pointer_to_current_range[i] =
508 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
VectorType & get_vector()
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
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
value_type & operator()(const size_type i, const size_type j)
typename VectorType::size_type size_type
void compress(VectorOperation::values operation)
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
const VectorType & get_vector() const
size_type locally_owned_size() 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.
types::global_dof_index size_type