SuperLuMtSolver
The GeMA Super LU Mt Numeric Solver Plugin
Loading...
Searching...
No Matches
superLuMtSolver.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_SUPERLUMT_SOLVER_H_
25#define _GEMA_SUPERLUMT_SOLVER_H_
26
27#include <gmNumSolver.h>
28#include <gmSparseMatrix.h>
29#include <QObject>
30
31#include <slu_mt_ddefs.h> // For SuperMatrix and needed additional definitions used by supermatrix.h
32
33class GmRunProgress;
34
35extern "C" {
36 int_t sp_ienv(int_t ispec);
37}
38
45class SuperLuMtSolver : public QObject, public GmNumSolver
46{
47public:
48
50 virtual ~SuperLuMtSolver();
51
52 // Comments on the base class
53 virtual const char* pluginName() const { return "SuperLuMtSolver"; }
54
55 // Comments on the base class
56 virtual const char* pluginType() const { return "ns"; }
57
58 virtual bool loadPrivateData(LuaTable& table);
59
60 virtual GmSolverMatrix* newMatrix(int nlin, int ncol, const GmSolverMatrix* sharedLayout,
61 int numThreads = -1) const;
62
63 // Comments on the base class
64 virtual bool setSolverTolerance(double tol) { Q_UNUSED(tol); return false; }
65
66 virtual bool solveImpl(GmSolverMatrix* A, const GmVector& b, GmVector& x, bool xIsGuess = false) const;
67
68 virtual void printParameters(const GmLogCategory& logger);
69
70 virtual QString quickDescription() const;
71
72 // Comments on the base class
73 virtual int trackItemId() const { return _trackSolveItem; }
74
75private:
76 SuperMatrix* superLuMatrix (GmSolverMatrix* A) const;
77 void releaseSuperLuMatrix(SuperMatrix* sA) const;
78
80 superlumt_options_t _sluOptions;
83
84 static int _numSolvers;
85 int _trackSolveItem = -1;
86};
87
88#endif
virtual const GmLogCategory & logger() const
QString description() const
A class for creating a GeMA solver based on th multi-threaded SuperLU library.
Definition superLuMtSolver.h:46
bool _singleThreadedBlas
Should we ask BLAS to be single threaded?
Definition superLuMtSolver.h:82
superlumt_options_t _sluOptions
The configured set of SuperLU options.
Definition superLuMtSolver.h:80
GmSparseMatrixOptions _matrixOptions
The set of options used for building the sparse matrix.
Definition superLuMtSolver.h:79
SuperLuMtSolver(GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
Constructor. Will be called by the plugin loading code.
Definition superLuMtSolver.cpp:71
SuperMatrix * superLuMatrix(GmSolverMatrix *A) const
Given a matrix A, returns a SuperLU matrix that wraps A. This can be just a pointer to an existing ob...
Definition superLuMtSolver.cpp:371
static int _numSolvers
The number of instanced solvers.
Definition superLuMtSolver.h:84
int _sp_ienvOptions[9]
The configured values to be returned by sp_ienv()
Definition superLuMtSolver.h:81
void releaseSuperLuMatrix(SuperMatrix *sA) const
Releases, if necessary, the matrix created by the call to superLuMatrix(A)
Definition superLuMtSolver.cpp:424
virtual ~SuperLuMtSolver()
Destructor.
Definition superLuMtSolver.cpp:152
arma::vec GmVector