12#include <Kokkos_Core.hpp>
14namespace ddc::detail {
17
18
19
20
21
22template <
class ExecSpace>
23class SplinesLinearProblem
27 using MultiRHS = Kokkos::View<
double**, Kokkos::LayoutRight, ExecSpace>;
33 explicit SplinesLinearProblem(
const std::size_t size) : m_size(size) {}
36 SplinesLinearProblem(SplinesLinearProblem
const& x) =
delete;
38 SplinesLinearProblem(SplinesLinearProblem&& x) =
delete;
41 virtual ~SplinesLinearProblem() =
default;
43 SplinesLinearProblem& operator=(SplinesLinearProblem
const& x) =
delete;
45 SplinesLinearProblem& operator=(SplinesLinearProblem&& x) =
delete;
48
49
50
51
52
53
54
55 virtual double get_element(std::size_t i, std::size_t j)
const = 0;
58
59
60
61
62
63
64 virtual void set_element(std::size_t i, std::size_t j,
double aij) = 0;
67
68
69 virtual void setup_solver() = 0;
72
73
74
75
76
77 virtual void solve(MultiRHS b,
bool transpose)
const = 0;
80
81
82
83
84 std::size_t size()
const
90
91
92
93
94
95
96 std::size_t required_number_of_rhs_rows()
const
98 std::size_t
const nrows = impl_required_number_of_rhs_rows();
99 assert(nrows >= size());
104 virtual std::size_t impl_required_number_of_rhs_rows()
const
111
112
113
114
115
116
117
118template <
class ExecSpace>
119std::ostream& operator<<(std::ostream& os, SplinesLinearProblem<ExecSpace>
const& linear_problem)
121 std::size_t
const n = linear_problem.size();
122 for (std::size_t i = 0; i < n; ++i) {
123 for (std::size_t j = 0; j < n; ++j) {
124 os << std::fixed << std::setprecision(3) << std::setw(10)
125 << linear_problem.get_element(i, j);
The top-level namespace of DDC.