SparseMatrixUnknownPattern.h
Go to the documentation of this file.
1 //
2 // This file is part of the FFEA simulation package
3 //
4 // Copyright (c) by the Theory and Development FFEA teams,
5 // as they appear in the README.md file.
6 //
7 // FFEA is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // FFEA is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with FFEA. If not, see <http://www.gnu.org/licenses/>.
19 //
20 // To help us fund FFEA development, we humbly ask that you cite
21 // the research papers on the package.
22 //
23 
24 #ifndef SPARSEMATRIXUNKNOWNPATTERN_H_INCLUDED
25 #define SPARSEMATRIXUNKNOWNPATTERN_H_INCLUDED
26 
27 #include <vector>
28 
29 #include "mat_vec_types.h"
30 #include "SparseMatrixTypes.h"
31 #include "FFEA_return_codes.h"
32 
33 using namespace std;
34 
36 public:
38 
40 
41  int init(int num_rows, int suggested_initial_size_for_row_vectors);
42 
43  void add_off_diagonal_element(int row_index, int column_index, scalar val);
44 
45  void set_diagonal_element(int row_index, scalar val);
46 
47  void calc_inverse_diagonal(scalar *inv_D);
48 
49  void zero();
50 
52  void apply(scalar *in, scalar *result);
53 
54  void print();
55 
56 private:
57  int num_rows;
58  vector<sparse_entry> *row;
60 };
61 
62 #endif
vector< sparse_entry > * row
Definition: SparseMatrixUnknownPattern.h:58
const scalar zero
Definition: mat_vec_types.h:56
STL namespace.
Definition: SparseMatrixUnknownPattern.h:35
int num_rows
Definition: SparseMatrixUnknownPattern.h:57
scalar * diagonal
Definition: SparseMatrixUnknownPattern.h:59
double scalar
Definition: mat_vec_types.h:36