Loading...
Searching...
No Matches
solver_umfpack.h
Go to the documentation of this file.
#ifndef _RHEOLEF_SOLVER_UMFPACK_H
#define _RHEOLEF_SOLVER_UMFPACK_H
// solver implementation: interface
//
#include "rheolef/config.h"
#ifdef _RHEOLEF_HAVE_UMFPACK
#include "rheolef/solver.h"
extern "C" {
#include <umfpack.h>
}
namespace rheolef {
// =======================================================================
// rep
// =======================================================================
template<class T, class M>
class solver_umfpack_rep : public solver_abstract_rep<T,M> {
public:
// typedef:
typedef solver_abstract_rep<T,M> base;
typedef typename base::size_type size_type;
typedef typename base::determinant_type determinant_type;
// allocator:
solver_umfpack_rep();
explicit solver_umfpack_rep (const csr<T,M>& a, const solver_option& opt = solver_option());
solver_abstract_rep<T,M>* clone() const;
bool initialized() const { return true; }
void update_values (const csr<T,M>& a);
~solver_umfpack_rep ();
// accessors:
vec<T,M> trans_solve (const vec<T,M>& rhs) const;
vec<T,M> solve (const vec<T,M>& rhs) const;
determinant_type det() const { return _det; }
protected:
// data:
int _n;
void* _numeric;
int* _ia_p;
int* _ja_p;
T* _a_p; // TODO: only used when T=double yet
determinant_type _det;
double _control [UMFPACK_INFO];
mutable double _info [UMFPACK_INFO];
// internal:
void _set_control();
void _destroy();
void _solve (int transpose_flag, const vec<T,M>& b, vec<T,M>& x) const;
private:
solver_umfpack_rep (const solver_umfpack_rep<T,M>&);
solver_umfpack_rep<T,M>& operator= (const solver_umfpack_rep<T,M>&);
};
template <class T, class M>
inline
solver_abstract_rep<T,M>*
solver_umfpack_rep<T,M>::clone() const
{
typedef solver_umfpack_rep<T,M> rep;
return new_macro (rep(*this));
}
} // namespace rheolef
#endif // _RHEOLEF_HAVE_UMFPACK
#endif // _RHEOLEF_SOLVER_UMFPACK_H
rheolef::csr
see the csr page for the full documentation
Definition csr.h:317
rheolef::solver_abstract_rep
Definition solver.h:191
rheolef::solver_abstract_rep::solver_abstract_rep
solver_abstract_rep(const solver_option &opt)
Definition solver.h:195
rheolef::solver_abstract_rep::size_type
csr< T, M >::size_type size_type
Definition solver.h:193
rheolef::solver_option
see the solver_option page for the full documentation
Definition solver_option.h:155
rheolef::solver_umfpack_rep::_destroy
void _destroy()
Definition solver_umfpack.cc:136
rheolef::solver_umfpack_rep::det
determinant_type det() const
Definition solver_umfpack.h:61
rheolef::solver_umfpack_rep::_set_control
void _set_control()
Definition solver_umfpack.cc:124
rheolef::solver_umfpack_rep::update_values
void update_values(const csr< T, M > &a)
Definition solver_umfpack.cc:146
rheolef::solver_umfpack_rep::size_type
base::size_type size_type
Definition solver_umfpack.h:45
rheolef::solver_umfpack_rep::base
solver_abstract_rep< T, M > base
Definition solver_umfpack.h:44
rheolef::solver_umfpack_rep::_ja_p
int * _ja_p
Definition solver_umfpack.h:68
rheolef::solver_umfpack_rep::determinant_type
base::determinant_type determinant_type
Definition solver_umfpack.h:46
rheolef::solver_umfpack_rep::_solve
void _solve(int transpose_flag, const vec< T, M > &b, vec< T, M > &x) const
Definition solver_umfpack.cc:179
rheolef::solver_umfpack_rep::trans_solve
vec< T, M > trans_solve(const vec< T, M > &rhs) const
Definition solver_umfpack.cc:195
rheolef::solver_umfpack_rep::_a_p
T * _a_p
Definition solver_umfpack.h:69
rheolef::solver_umfpack_rep::_ia_p
int * _ia_p
Definition solver_umfpack.h:67
rheolef::solver_umfpack_rep::_control
double _control[UMFPACK_INFO]
Definition solver_umfpack.h:71
rheolef::solver_umfpack_rep::~solver_umfpack_rep
~solver_umfpack_rep()
Definition solver_umfpack.cc:130
rheolef::solver_umfpack_rep::_n
int _n
Definition solver_umfpack.h:65
rheolef::solver_umfpack_rep::clone
solver_abstract_rep< T, M > * clone() const
Definition solver_umfpack.h:85
rheolef::solver_umfpack_rep::_numeric
void * _numeric
Definition solver_umfpack.h:66
rheolef::solver_umfpack_rep::solver_umfpack_rep
solver_umfpack_rep()
Definition solver_umfpack.cc:72
rheolef::solver_umfpack_rep::_info
double _info[UMFPACK_INFO]
Definition solver_umfpack.h:72
rheolef::solver_umfpack_rep::solve
vec< T, M > solve(const vec< T, M > &rhs) const
Definition solver_umfpack.cc:186
rheolef::solver_umfpack_rep::initialized
bool initialized() const
Definition solver_umfpack.h:53
rheolef::solver_umfpack_rep::_det
determinant_type _det
Definition solver_umfpack.h:70
rheolef::vec
see the vec page for the full documentation
Definition vec.h:79
T
Expr1::float_type T
Definition field_expr.h:230
rheolef
This file is part of Rheolef.
Definition compiler_eigen.h:39
rheolef::solver_abstract_rep::determinant_type
Definition solver.h:215