HypreSolver
The GeMA Hypre Numeric Solver Plugin
Loading...
Searching...
No Matches
hypreMatrix.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#ifndef _GEMA_HYPRE_MATRIX_H_
25#define _GEMA_HYPRE_MATRIX_H_
26
27#include <gmSparseMatrix.h>
28#include <HYPRE.h>
29#include <HYPRE_parcsr_ls.h>
30
31typedef HYPRE_IJMatrix HYPRE_MATRIX;
32
33
34class HypreMatrix : public GmSparseMatrix<int, GM_CSR_SPARSE_FORMAT>
35{
36public:
37
38 HypreMatrix(int nlin, const HypreMatrix* sharedLayout, GmSparseMatrixOptions options);
39 virtual ~HypreMatrix();
40
42 HYPRE_MATRIX hypre() const { return _hypreMat; }
43
44 virtual void clear(bool keepSparseLayout);
45 virtual void clearLineAndColumnSet(const QVector<int>& indexList, bool setDiagonal, bool keepSparseLayout);
46 virtual void ensureDiagonal();
47 bool setMatrixValues();
48
49protected:
50 virtual void matrixLayoutReady();
51 virtual GmSparseMatrix<int, GM_CSR_SPARSE_FORMAT>* detachAndClear();
52
53private:
54
55 HYPRE_MATRIX _hypreMat;
56};
57
58#endif
Definition hypreMatrix.h:35
virtual void matrixLayoutReady()
Allocates space for matrix values and build the HYPRE wrapper over matrix vectors.
Definition hypreMatrix.cpp:65
HYPRE_MATRIX hypre() const
Returns the HYPRE matrix wrapped by this class.
Definition hypreMatrix.h:42
virtual ~HypreMatrix()
Destructor.
Definition hypreMatrix.cpp:55
HypreMatrix(int nlin, const HypreMatrix *sharedLayout, GmSparseMatrixOptions options)
Constructor for the square matrix used by the HYPRE solver. If sharedLayout is different from NULL,...
Definition hypreMatrix.cpp:40