1
#ifndef _RHEOLEF_SOLVER_MUMPS_H
2
#define _RHEOLEF_SOLVER_MUMPS_H
4
/// This file is part of Rheolef.
6
/// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
8
/// Rheolef is free software; you can redistribute it and/or modify
9
/// it under the terms of the GNU General Public License as published by
10
/// the Free Software Foundation; either version 2 of the License, or
11
/// (at your option) any later version.
13
/// Rheolef is distributed in the hope that it will be useful,
14
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
/// GNU General Public License for more details.
18
/// You should have received a copy of the GNU General Public License
19
/// along with Rheolef; if not, write to the Free Software
20
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
/// =========================================================================
23
// solver implementation: interface
26
#include "rheolef/config.h"
28
#ifdef _RHEOLEF_HAVE_MUMPS
30
#include "rheolef/solver.h"
35
// =======================================================================
37
// =======================================================================
38
template<class T, class M>
39
class solver_mumps_rep : public solver_abstract_rep<T,M> {
43
typedef typename csr<T,M>::size_type size_type;
48
: solver_abstract_rep<T,M>(solver_option_type()),
49
_has_mumps_instance(false),
55
explicit solver_mumps_rep (const csr<T,M>& a, const solver_option_type& opt = solver_option_type());
56
void update_values (const csr<T,M>& a);
61
vec<T,M> trans_solve (const vec<T,M>& rhs) const;
62
vec<T,M> solve (const vec<T,M>& rhs) const;
66
bool _has_mumps_instance;
67
mutable DMUMPS_STRUC_C _mumps_par;
68
std::vector<int> _row; // (i,j) matrix sparse tructure for mumps
69
std::vector<int> _col;
70
T _a00; // circumvent a bug when matrix size <= 1...
73
} // namespace rheolef
75
#endif // _RHEOLEF_SOLVER_MUMPS_H