Geophysical Inversion and Modelling Library v1.5.4
Loading...
Searching...
No Matches
cholmodWrapper.h
1/******************************************************************************
2 * Copyright (C) 2005-2024 by the GIMLi development team *
3 * Carsten Rücker carsten@resistivity.net *
4 * *
5 * Licensed under the Apache License, Version 2.0 (the "License"); *
6 * you may not use this file except in compliance with the License. *
7 * You may obtain a copy of the License at *
8 * *
9 * http://www.apache.org/licenses/LICENSE-2.0 *
10 * *
11 * Unless required by applicable law or agreed to in writing, software *
12 * distributed under the License is distributed on an "AS IS" BASIS, *
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
14 * See the License for the specific language governing permissions and *
15 * limitations under the License. *
16 * *
17 ******************************************************************************/
18
19#ifndef _GIMLI_CHOLMODWRAPPER__H
20#define _GIMLI_CHOLMODWRAPPER__H
21
22#include "gimli.h"
23#include "solverWrapper.h"
24
25namespace GIMLI{
26
27class DLLEXPORT CHOLMODWrapper : public SolverWrapper {
28public:
29 CHOLMODWrapper(RSparseMatrix & S, bool verbose=false, int stype=-2, bool forceUmfpack=false);
30 CHOLMODWrapper(CSparseMatrix & S, bool verbose=false, int stype=-2, bool forceUmfpack=false);
31
32 virtual ~CHOLMODWrapper();
33
34 static bool valid();
35
36 virtual void setMatrix(RSparseMatrix & S);
37
38 virtual void setMatrix(CSparseMatrix & S);
39
40 virtual void solve(const RVector & rhs, RVector & solution);
41
42 virtual void solve(const CVector & rhs, CVector & solution);
43
44protected:
45 void init();
46
47 void free();
48
49 int initializeMatrix_(RSparseMatrix & S);
50
51 int initializeMatrix_(CSparseMatrix & S);
52
53 template < class ValueType >
54 void init_(SparseMatrix < ValueType > & S, int stype);
55
56 template < class ValueType >
57 int initMatrixChol_(SparseMatrix < ValueType > & S, int xType);
58
59 template < class ValueType >
60 void solveCHOL_(const Vector < ValueType > & rhs, Vector < ValueType > & solution);
61
62 template < class ValueType >
63 void solveUmf_(const Vector < ValueType > & rhs, Vector < ValueType > & solution);
64
65 int factorise_();
66
67 int stype_;
68
69 void *c_;
70 void *A_;
71 void *L_;
72
73 bool useUmfpack_;
74 bool forceUmfpack_;
75 void *Numeric_;
76 void *NumericD_;
77 int * Ap_;
78 int * Ai_;
79 int * ApR_;
80 int * AiR_;
81
82 RVector *AxV_;
83 RVector *AzV_;
84};
85
86} //namespace GIMLI;
87
88#endif // _GIMLI_CHOLMODWRAPPER__H
GIMLi main namespace for the Geophyiscal Inversion and Modelling Library.
Definition baseentity.h:24