INLA_DIST
Loading...
Searching...
No Matches
INLA_main
Solver.h
1
#ifndef SOLVER_H
2
#define SOLVER_H
3
4
#include <stdio.h>
5
#include <stdlib.h>
6
#include <math.h>
7
8
#include <fstream>
9
#include <iostream>
10
11
#include <Eigen/Core>
12
#include <Eigen/Dense>
13
#include <Eigen/SparseCore>
14
15
typedef
Eigen::VectorXd Vect;
16
typedef
Eigen::SparseMatrix<double> SpMat;
17
18
using namespace
std;
19
using namespace
Eigen;
20
27
class
Solver
{
28
public
:
29
// pure virtual function providing interface framework.
30
virtual
void
symbolic_factorization(SpMat&
Q
,
int
&
init
) = 0;
31
virtual
void
factorize(SpMat&
Q
,
double
&
log_det
,
double
& t_priorLatChol) = 0;
32
virtual
void
factorize_w_constr(SpMat&
Q
,
const
MatrixXd& D,
double
&
log_det
, MatrixXd& V) = 0;
33
virtual
void
factorize_solve(SpMat&
Q
, Vect&
rhs
, Vect&
sol
,
double
&
log_det
,
double
& t_condLatChol,
double
& t_condLatSolve) = 0;
34
virtual
void
factorize_solve_w_constr(SpMat&
Q
, Vect&
rhs
,
const
MatrixXd& Dxy,
double
&
log_det
, Vect&
sol
, MatrixXd& V) = 0;
35
virtual
void
selected_inversion(SpMat&
Q
, Vect& inv_diag) = 0;
36
virtual
void
selected_inversion_w_constr(SpMat&
Q
,
const
MatrixXd& D, Vect& inv_diag, MatrixXd& V) = 0;
37
38
39
// "simple inversion" function for small matrices. exists already in pardiso.
40
virtual
~Solver
(){
41
// ok what
42
}
43
44
protected
:
45
int
init
;
47
double
log_det
;
49
SpMat
Q
;
50
Vect
rhs
;
51
Vect
sol
;
53
};
54
55
56
57
#endif
Solver
abstract base solver class to enable to be able two switch between solvers (current options: PARDISO ...
Definition
Solver.h:27
Solver::log_det
double log_det
Definition
Solver.h:47
Solver::init
int init
Definition
Solver.h:45
Solver::Q
SpMat Q
Definition
Solver.h:49
Solver::rhs
Vect rhs
Definition
Solver.h:50
Solver::sol
Vect sol
Definition
Solver.h:51
Generated by
1.10.0