Matrix.hpp
Go to the documentation of this file.
1/*
2 Copyright 2020 Equinor ASA
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef OPM_MATRIX_HEADER_INCLUDED
21#define OPM_MATRIX_HEADER_INCLUDED
22
23#include <vector>
24
25namespace Opm
26{
27namespace Accelerator
28{
29
32class Matrix {
33
34public:
35
39 Matrix(int N_, int nnzs_)
40 : N(N_),
41 M(N_),
42 nnzs(nnzs_)
43 {
44 nnzValues.resize(nnzs);
45 colIndices.resize(nnzs);
46 rowPointers.resize(N+1);
47 }
48
53 Matrix(int N_, int M_, int nnzs_)
54 : Matrix(N_, nnzs_)
55 {
56 M = M_;
57 }
58
59 std::vector<double> nnzValues;
60 std::vector<int> colIndices;
61 std::vector<int> rowPointers;
62 int N, M;
63 int nnzs;
64};
65
66} // namespace Accelerator
67} // namespace Opm
68
69#endif // OPM_MATRIX_HEADER_INCLUDED
Definition: Matrix.hpp:32
std::vector< int > rowPointers
Definition: Matrix.hpp:61
int nnzs
Definition: Matrix.hpp:63
std::vector< int > colIndices
Definition: Matrix.hpp:60
Matrix(int N_, int M_, int nnzs_)
Definition: Matrix.hpp:53
int M
Definition: Matrix.hpp:62
std::vector< double > nnzValues
Definition: Matrix.hpp:59
int N
Definition: Matrix.hpp:62
Matrix(int N_, int nnzs_)
Definition: Matrix.hpp:39
Definition: BlackoilPhases.hpp:27