PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
Eigen_CholeskySolver.hpp
Go to the documentation of this file.
1// _LICENSE_HEADER_
2//
3// Copyright (C) 2019 - 2025.
4// Terms register on the GPL-3.0 license.
5//
6// This file can be redistributed and/or modified under the license terms.
7//
8// See top level LICENSE file for more details.
9//
10// This file can be used citing references in CITATION.cff file.
11
12#ifndef __EIGENCHOLESKYSOLVER_H
13#define __EIGENCHOLESKYSOLVER_H
14
15#include "Eigen/Eigen"
16#include "ILinearSolver.hpp"
17
18namespace Gedim
19{
21template <typename Eigen_ArrayType = Eigen::VectorXd,
22 typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>,
23 typename Eigen_SolverType = Eigen::SimplicialLDLT<Eigen_SparseArrayType, Eigen::Lower, Eigen::AMDOrdering<int>>>
25{
26 private:
27 Eigen_SolverType linearSolver;
28 const IArray *_rightHandSide;
29 IArray *_solution;
30
31 public:
33 {
34 _rightHandSide = nullptr;
35 _solution = nullptr;
36 }
38 {
39 _rightHandSide = nullptr;
40 _solution = nullptr;
41 }
42
43 void Initialize(const ISparseArray &matrix, const IArray &rightHandSide, IArray &solution, const Configuration &config = Configuration());
44
45 void Initialize(const IArray &rightHandSide, IArray &solution, const Configuration &config = Configuration());
46
48
49 void Initialize(const ISparseArray &matrix, const Configuration &config = Configuration());
51};
52} // namespace Gedim
53
54#endif // __EIGENCHOLESKYSOLVER_H
Eigen column vector.
Definition Eigen_Array.hpp:23
Eigen Cholesky Linear solver.
Definition Eigen_CholeskySolver.hpp:25
~Eigen_CholeskySolver()
Definition Eigen_CholeskySolver.hpp:37
Eigen_CholeskySolver()
Definition Eigen_CholeskySolver.hpp:32
ILinearSolver::SolutionInfo Solve() const
Compute the solution.
Definition Eigen_CholeskySolver.cpp:50
void Initialize(const ISparseArray &matrix, const IArray &rightHandSide, IArray &solution, const Configuration &config=Configuration())
Initialize the linear solver Ax = b.
Definition Eigen_CholeskySolver.cpp:29
Interface used for column double Array.
Definition IArray.hpp:23
Interface used for algebra linear solvers.
Definition ILinearSolver.hpp:22
Interface used for sparse Array of double.
Definition ISparseArray.hpp:25
Definition Eigen_Array.cpp:22
Definition ILinearSolver.hpp:31