deal.II version GIT relicensing-2289-g1e5549a87a 2024-12-21 21:30:00+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\}}\)
Loading...
Searching...
No Matches
sparsity_pattern_base.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2022 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_sparsity_pattern_base_h
16#define dealii_sparsity_pattern_base_h
17
18
19#include <deal.II/base/config.h>
20
24
25#include <utility>
26
28
39{
40public:
45
50
55
59 SparsityPatternBase(const SparsityPatternBase &sparsity_pattern) = default;
60
64 SparsityPatternBase(SparsityPatternBase &&sparsity_pattern) noexcept =
65 default;
66
71 operator=(const SparsityPatternBase &sparsity_pattern) = default;
72
77 operator=(SparsityPatternBase &&sparsity_pattern) noexcept = default;
78
84 n_rows() const;
85
91 n_cols() const;
92
96 virtual void
98 const ArrayView<const size_type> &columns,
99 const bool indices_are_sorted = false) = 0;
100
108 virtual void
109 add_entries(const ArrayView<const std::pair<size_type, size_type>> &entries);
110
111protected:
115 virtual void
117
122
127};
128
134/* ---------------------------- Inline functions ---------------------------- */
135
136#ifndef DOXYGEN
137
139 : rows(0)
140 , cols(0)
141{}
142
143
144
145inline SparsityPatternBase::SparsityPatternBase(const size_type rows,
146 const size_type cols)
147 : rows(rows)
148 , cols(cols)
149{}
150
151
152
155{
156 return rows;
157}
158
159
160
163{
164 return cols;
165}
166
167
168
169inline void
170SparsityPatternBase::resize(const size_type rows, const size_type cols)
171{
172 this->rows = rows;
173 this->cols = cols;
174}
175#endif
176
178
179#endif
SparsityPatternBase(SparsityPatternBase &&sparsity_pattern) noexcept=default
virtual void resize(const size_type rows, const size_type cols)
size_type n_rows() const
virtual void add_entries(const ArrayView< const std::pair< size_type, size_type > > &entries)
SparsityPatternBase & operator=(SparsityPatternBase &&sparsity_pattern) noexcept=default
SparsityPatternBase(const SparsityPatternBase &sparsity_pattern)=default
virtual void add_row_entries(const size_type &row, const ArrayView< const size_type > &columns, const bool indices_are_sorted=false)=0
SparsityPatternBase & operator=(const SparsityPatternBase &sparsity_pattern)=default
SparsityPatternBase(const size_type rows, const size_type cols)
size_type n_cols() const
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499
unsigned int global_dof_index
Definition types.h:81