deal.II version GIT relicensing-2642-g417c8935ea 2025-02-14 17: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#include <deal.II/base/types.h>
25
26#include <utility>
27
29
40{
41public:
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
85 n_rows() const;
86
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
112protected:
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
146inline SparsityPatternBase::SparsityPatternBase(const size_type rows,
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
170inline void
171SparsityPatternBase::resize(const size_type n_rows, const size_type n_cols)
172{
173 this->rows = n_rows;
174 this->cols = n_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)
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:518
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:519
unsigned int global_dof_index
Definition types.h:90