SuiteSparseSolver
The GeMA Suite Sparse Numeric Solver Plugin
Loading...
Searching...
No Matches
suiteSparseSolver.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_SUITESPARSE_SOLVER_H_
25#define _GEMA_SUITESPARSE_SOLVER_H_
26
27#include <gmNumSolver.h>
28#include <gmSparseMatrix.h>
29#include <QObject>
30
31#include "suiteSparseMatrix.h"
32
33
34class GmRunProgress;
35
44{
45public:
46
52
54 virtual ~SuiteSparseSolver() {}
55
56 // Comments on the base class
57 virtual const char* pluginName() const { return "SuiteSparseSolver"; }
58
59 virtual bool loadPrivateData(LuaTable& table);
60
61 virtual GmSolverMatrix* newMatrix(int nlin, int ncol, const GmSolverMatrix* sharedLayout,
62 int numThreads = -1) const;
63
64 // Comments on the base class
65 virtual bool setSolverTolerance(double tol) { Q_UNUSED(tol); return false; }
66
67 virtual void printParameters(const GmLogCategory& logger);
68
69 virtual QString quickDescription() const;
70
71 // Comments on the base class
72 virtual int trackItemId() const { return _trackSolveItem; }
73
74protected:
75 bool initTracking(GmSimulationData* simulation, QString solverId, const char* itemName, int numSolvers);
76
77 cholmod_sparse* cholmodMatrix (GmSolverMatrix* A ) const;
78 void releaseCholmodMatrix(cholmod_sparse* cA) const;
79
80 bool _i64;
83
85 int _trackSolveItem = -1;
86 int _trackSolveAnalyzeItem = -1;
87 int _trackSolveFactorizeItem = -1;
88 int _trackSolveSolveItem = -1;
89 int _trackSolveResidualAttr = -1;
90 int _trackSolveInternalMemAttr = -1;
91
92};
93
94#endif
virtual const GmLogCategory & logger() const
QString id() const
QString description() const
A base class with the common behavior for creating a GeMA solver based on one of the following SuiteS...
Definition suiteSparseSolver.h:44
cholmod_sparse * cholmodMatrix(GmSolverMatrix *A) const
Given a matrix A, returns a "cholmod" matrix that wraps A. This can be just a pointer to an existing ...
Definition suiteSparseSolver.cpp:159
bool _printResidual
Should the solver print, after solving, the residual?
Definition suiteSparseSolver.h:82
GmSparseMatrixOptions _matrixOptions
The set of options used for building the sparse matrix.
Definition suiteSparseSolver.h:84
void releaseCholmodMatrix(cholmod_sparse *cA) const
Releases, if necessary, the matrix created by the call to cholmodMatrix(A)
Definition suiteSparseSolver.cpp:231
bool _i64
Are we using 64 bit indices for sparse matrices?
Definition suiteSparseSolver.h:80
int _normType
The saved norm type (0 = infinite (maximum value), 1 = L1 (value sum), 2 = L2 (quadratic))
Definition suiteSparseSolver.h:81
virtual ~SuiteSparseSolver()
Destructor.
Definition suiteSparseSolver.h:54
SuiteSparseSolver(GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
Constructor. Will be called by the plugin loading code.
Definition suiteSparseSolver.h:48
GM_ARMADILLO_TRIPLET_LIST
Declaration of the SuiteSparseMatrix class.