ArmadilloSolver
The GeMA Armadillo Numeric Solver Plugin
Loading...
Searching...
No Matches
gmpArmadilloMatrix.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_PLUGIN_ARMADILLO_MATRIX_H_
25#define _GEMA_PLUGIN_ARMADILLO_MATRIX_H_
26
27
28#include <gmSparseMatrix.h>
29#include <armadillo>
30
36class GmpArmadilloMatrix : public GmSparseMatrix<arma::uword, GM_CSC_SPARSE_FORMAT>
37{
38public:
39
40 GmpArmadilloMatrix(int nlin, const GmpArmadilloMatrix* sharedLayout, GmSparseMatrixOptions options);
41 virtual ~GmpArmadilloMatrix();
42
44 const arma::sp_mat& armaMat() const { return _armaMat; }
45
46 virtual void clear(bool keepSparseLayout);
47 virtual void clearLineAndColumnSet(const QVector<int>& indexList, bool setDiagonal, bool keepSparseLayout);
48 virtual void ensureDiagonal();
49
50protected:
51 virtual void matrixLayoutReady();
53
54private:
55 arma::sp_mat _armaMat;
56};
57
58#endif
59
A class for wrapping up an Armadillo sparse matrix sharing the memory with a GeMA sparse matrix....
Definition gmpArmadilloMatrix.h:37
virtual ~GmpArmadilloMatrix()
Destructor.
Definition gmpArmadilloMatrix.cpp:67
arma::sp_mat _armaMat
An Armadillo matrix created sharing vectors with the base class memory.
Definition gmpArmadilloMatrix.h:55
virtual void matrixLayoutReady()
Allocates space for matrix values and build the Armadillo wrapper over matrix vectors.
Definition gmpArmadilloMatrix.cpp:78
const arma::sp_mat & armaMat() const
Returns the Armadillo matrix wrapped by this class.
Definition gmpArmadilloMatrix.h:44
GmpArmadilloMatrix(int nlin, const GmpArmadilloMatrix *sharedLayout, GmSparseMatrixOptions options)
Constructor for the square matrix used by the Armadillo solver. If sharedLayout is different from NUL...
Definition gmpArmadilloMatrix.cpp:44