Reference documentation for deal.II version GIT 438d545312 2023-02-08 21:05:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
sparsity_pattern_base.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2022 - 2022 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_sparsity_pattern_base_h
17 #define dealii_sparsity_pattern_base_h
18 
19 
20 #include <deal.II/base/config.h>
21 
25 
26 #include <utility>
27 
29 
40 {
41 public:
46 
51 
56 
60  SparsityPatternBase(const SparsityPatternBase &sparsity_pattern) = default;
61 
65  SparsityPatternBase(SparsityPatternBase &&sparsity_pattern) noexcept =
66  default;
67 
72  operator=(const SparsityPatternBase &sparsity_pattern) = default;
73 
78  operator=(SparsityPatternBase &&sparsity_pattern) noexcept = default;
79 
84  size_type
85  n_rows() const;
86 
91  size_type
92  n_cols() const;
93 
97  virtual void
99  const ArrayView<const size_type> &columns,
100  const bool indices_are_sorted = false) = 0;
101 
109  virtual void
110  add_entries(const ArrayView<const std::pair<size_type, size_type>> &entries);
111 
112 protected:
116  virtual void
118 
123 
128 };
129 
135 /* ---------------------------- Inline functions ---------------------------- */
136 
137 #ifndef DOXYGEN
138 
140  : rows(0)
141  , cols(0)
142 {}
143 
144 
145 
147  const size_type cols)
148  : rows(rows)
149  , cols(cols)
150 {}
151 
152 
153 
156 {
157  return rows;
158 }
159 
160 
161 
164 {
165  return cols;
166 }
167 
168 
169 
170 inline void
171 SparsityPatternBase::resize(const size_type rows, const size_type cols)
172 {
173  this->rows = rows;
174  this->cols = cols;
175 }
176 #endif
177 
179 
180 #endif
SparsityPatternBase(SparsityPatternBase &&sparsity_pattern) noexcept=default
virtual void resize(const size_type rows, const size_type cols)
types::global_dof_index size_type
SparsityPatternBase & operator=(SparsityPatternBase &&sparsity_pattern) noexcept=default
size_type n_rows() const
SparsityPatternBase(const SparsityPatternBase &sparsity_pattern)=default
SparsityPatternBase & operator=(const SparsityPatternBase &sparsity_pattern)=default
virtual void add_entries(const ArrayView< const std::pair< size_type, size_type >> &entries)
virtual void add_row_entries(const size_type &row, const ArrayView< const size_type > &columns, const bool indices_are_sorted=false)=0
SparsityPatternBase(const size_type rows, const size_type cols)
size_type n_cols() const
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:461
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:462
types::global_dof_index size_type
Definition: cuda_kernels.h:45
unsigned int global_dof_index
Definition: types.h:81