OGS
EigenLinearSolver.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <memory>
7#include <vector>
8
9#include "EigenOption.h"
11
12namespace MathLib
13{
14class EigenMatrix;
15class EigenVector;
16
18
20{
21public:
28 explicit EigenLinearSolver(std::string const& solver_name,
29 EigenOption const& option);
30
32
36 void setOption(const EigenOption& option) { option_ = option; }
37
42
49 bool compute(EigenMatrix& A,
50 MathLib::LinearSolverBehaviour const linear_solver_behaviour);
58 bool solve(EigenVector& b, EigenVector& x);
59
61 bool solve(EigenMatrix& A,
62 EigenVector& b,
63 EigenVector& x,
64 MathLib::LinearSolverBehaviour const linear_solver_behaviour =
66
69
72 bool willCompute(
73 MathLib::LinearSolverBehaviour const linear_solver_behaviour) const;
74
75protected:
77 std::unique_ptr<EigenLinearSolverBase> solver_;
79 void setRestart();
80 void setL();
81 void setS();
83 void setAngle();
85};
86
87} // namespace MathLib
bool compute(EigenMatrix &A, MathLib::LinearSolverBehaviour const linear_solver_behaviour)
bool solve(EigenVector &b, EigenVector &x)
EigenLinearSolver(std::string const &solver_name, EigenOption const &option)
bool willCompute(MathLib::LinearSolverBehaviour const linear_solver_behaviour) const
bool canSolveRectangular() const
Get, if the solver can handle rectangular equation systems.
void setOption(const EigenOption &option)
std::unique_ptr< EigenLinearSolverBase > solver_
Global vector based on Eigen vector.
Definition EigenVector.h:19
Option for Eigen sparse solver.
Definition EigenOption.h:12