16 #ifndef dealii__diagonal_matrix_h 17 #define dealii__diagonal_matrix_h 20 #include <deal.II/lac/vector.h> 22 DEAL_II_NAMESPACE_OPEN
45 template <
typename VectorType=Vector<
double> >
49 typedef typename VectorType::value_type value_type;
50 typedef typename VectorType::size_type size_type;
61 void reinit (
const VectorType &vec);
108 const size_type j)
const;
133 template <
typename number2>
134 void add (
const size_type row,
135 const size_type n_cols,
136 const size_type *col_indices,
137 const number2 *values,
138 const bool elide_zero_values =
true,
139 const bool col_indices_are_sorted =
false);
147 void add (
const size_type i,
149 const value_type value);
154 void vmult (VectorType &dst,
155 const VectorType &src)
const;
162 void Tvmult (VectorType &dst,
163 const VectorType &src)
const;
171 const VectorType &src)
const;
179 const VectorType &src)
const;
197 template <
typename VectorType>
205 template <
typename VectorType>
214 template <
typename VectorType>
218 return diagonal.memory_consumption();
223 template <
typename VectorType>
232 template <
typename VectorType>
236 diagonal.compress(operation);
241 template <
typename VectorType>
250 template <
typename VectorType>
259 template <
typename VectorType>
260 typename VectorType::size_type
263 return diagonal.size();
268 template <
typename VectorType>
269 typename VectorType::size_type
272 return diagonal.size();
277 template <
typename VectorType>
278 typename VectorType::value_type
280 const size_type j)
const 289 template <
typename VectorType>
290 typename VectorType::value_type &
301 template <
typename VectorType>
302 template <
typename number2>
305 const size_type n_cols,
306 const size_type *col_indices,
307 const number2 *values,
311 for (size_type i=0; i<n_cols; ++i)
312 if (col_indices[i] == row)
313 diagonal(row) += values[i];
318 template <
typename VectorType>
322 const value_type value)
325 diagonal(i) += value;
330 template <
typename VectorType>
333 const VectorType &src)
const 341 template <
typename VectorType>
344 const VectorType &src)
const 351 template <
typename VectorType>
354 const VectorType &src)
const 363 template <
typename VectorType>
366 const VectorType &src)
const 374 DEAL_II_NAMESPACE_CLOSE
std::size_t memory_consumption() const
VectorType & get_vector()
void Tvmult(VectorType &dst, const VectorType &src) const
void compress(VectorOperation::values operation)
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
value_type operator()(const size_type i, const size_type j) const
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)
void vmult(VectorType &dst, const VectorType &src) const
#define Assert(cond, exc)
void reinit(const VectorType &vec)
void vmult_add(VectorType &dst, const VectorType &src) const
void Tvmult_add(VectorType &dst, const VectorType &src) const