ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
linear_operator.h
Go to the documentation of this file.
1#ifndef HSOLVER_LINEAR_OPERATOR_H
2#define HSOLVER_LINEAR_OPERATOR_H
3
5
6#include <exception>
7
8namespace hsolver
9{
10
12class LinearPreconditionerError final : public std::exception
13{
14 public:
15 const char* what() const noexcept override
16 {
17 return "Preconditioner application failed.";
18 }
19};
20
29template <typename T, typename Device = base_device::DEVICE_CPU>
31{
32 public:
33 virtual ~LinearOperator() = default;
34 virtual void apply(const T* x, T* y, const int ld, const int nvec) const = 0;
36 virtual bool is_identity() const { return false; }
37};
38
39} // namespace hsolver
40#endif
Device-resident block operator for independent right-hand sides.
Definition linear_operator.h:31
virtual void apply(const T *x, T *y, const int ld, const int nvec) const =0
virtual bool is_identity() const
Allow solvers to bypass identity preconditioner copies.
Definition linear_operator.h:36
virtual ~LinearOperator()=default
Stop the current recurrence when a preconditioner cannot be applied.
Definition linear_operator.h:13
const char * what() const noexcept override
Definition linear_operator.h:15
#define T
Definition exp.cpp:237
Definition dense_eigensolver.cpp:23