9#include <kernel/lafem/dense_vector.hpp>
10#include <kernel/lafem/power_vector.hpp>
11#include <kernel/lafem/tuple_vector.hpp>
12#include <kernel/lafem/sparse_matrix_csr.hpp>
13#include <kernel/lafem/power_diag_matrix.hpp>
14#include <kernel/lafem/power_col_matrix.hpp>
15#include <kernel/lafem/power_row_matrix.hpp>
16#include <kernel/lafem/power_full_matrix.hpp>
17#include <kernel/lafem/saddle_point_matrix.hpp>
18#include <kernel/lafem/pointstar_factory.hpp>
26 template<
typename DataType_,
typename IndexType_>
27 struct MetaMatrixTestHelper
30 typedef DenseVector<DataType_, IndexType_> ScalarVector;
32 typedef SparseMatrixCSR<DataType_, IndexType_> ScalarMatrixA;
34 typedef SparseMatrixCSR<DataType_, IndexType_> ScalarMatrixB;
36 typedef SparseMatrixCSR<DataType_, IndexType_> ScalarMatrixD;
91 template<
typename DataType_,
typename IndexType_>
96 typedef DataType_ DataType;
97 typedef IndexType_ IndexType;
98 typedef MetaMatrixTestHelper<DataType, IndexType> Helper;
130 :
FEAT::TestSystem::
UnitTest(id_in, datatype_name, index_name, preferred_backend)
151 mat_sys.template at<0,0>().template at<0,0>().
convert(mat_fe);
152 mat_sys.template at<0,0>().template at<1,1>().
convert(mat_fe);
153 mat_sys.template at<0,1>().template at<0,0>().
convert(mat_fd);
154 mat_sys.template at<0,1>().template at<1,0>().
convert(mat_fd);
155 mat_sys.template at<1,0>().template at<0,0>().
convert(mat_fd);
156 mat_sys.template at<1,0>().template at<0,1>().
convert(mat_fd);
159 vec_sol.template at<0>().template at<0>().
convert(vec_bubble);
160 vec_sol.template at<0>().template at<1>().
convert(vec_eigen1);
161 vec_sol.template at<1>().
convert(vec_eigen2);
169 mat_fe.
apply(vec_rhs1, vec_bubble);
172 mat_fd.
apply(vec_rhs3, vec_bubble);
176 vec_rhs.template at<0>().template at<0>().
convert(vec_rhs1);
177 vec_rhs.template at<0>().template at<1>().
convert(vec_rhs2);
178 vec_rhs.template at<1>().
convert(vec_rhs3);
198 mat_sys.template at<0,0>().template at<0,0>().
convert(mat_fe);
199 mat_sys.template at<0,0>().template at<1,1>().
convert(mat_fe);
200 mat_sys.template at<0,0>().template at<0,1>().
convert(mat_fd);
201 mat_sys.template at<0,0>().template at<1,0>().
convert(mat_fd);
202 mat_sys.template at<0,1>().template at<0,0>().
convert(mat_fd);
203 mat_sys.template at<0,1>().template at<1,0>().
convert(mat_fd);
204 mat_sys.template at<1,0>().template at<0,0>().
convert(mat_fd);
205 mat_sys.template at<1,0>().template at<0,1>().
convert(mat_fd);
208 vec_sol.template at<0>().template at<0>().
convert(vec_bubble);
209 vec_sol.template at<0>().template at<1>().
convert(vec_eigen1);
210 vec_sol.template at<1>().
convert(vec_eigen2);
218 mat_fe.
apply(vec_rhs1, vec_bubble);
219 mat_fd.
apply(vec_rhs2, vec_bubble);
222 mat_fd.
apply(vec_rhs3, vec_bubble);
226 vec_rhs.template at<0>().template at<0>().
convert(vec_rhs1);
227 vec_rhs.template at<0>().template at<1>().
convert(vec_rhs2);
228 vec_rhs.template at<1>().
convert(vec_rhs3);
Dense data vector class template.
void scale(const DenseVector &x, const DT_ alpha)
Calculate .
void axpy(const DenseVector &x, const DT_ alpha=DT_(1))
Calculate .
Index size() const
Returns the size of this vector, i.e. its number of entries.
DenseVector< DataType_, IndexType_ > vector_q2_bubble() const
Computes a Q2-bubble vector.
virtual DenseVector< DataType_, IndexType_ > eigenvector_min() const
Computes the eigenvector of the smallest eigenvalue.
Finite-Differences pointstar matrix factory.
virtual DataType_ lambda_min() const override
Computes the smallest eigenvalue of the FD-style matrix.
virtual SparseMatrixCSR< DataType_, IndexType_ > matrix_csr() const override
Generates a FD-style pointstar CSR matrix.
Finite-Element pointstar matrix factory.
virtual DataType_ lambda_min() const override
Computes the smallest eigenvalue of the FE-style matrix.
virtual SparseMatrixCSR< DataType_, IndexType_ > matrix_csr() const override
Generates a FE-style pointstar CSR matrix.
Power-Col-Matrix meta class template.
Power-Diag-Matrix meta class template.
Power-Full-Matrix meta class template.
Power-Row-Matrix meta class template.
Power-Vector meta class template.
Saddle-Point matrix meta class template.
void convert(const SaddlePointMatrix< MatrixA2_, MatrixB2_, MatrixD2_ > &other)
Conversion method.
void apply(DenseVector< DT_, IT_ > &r, const DenseVector< DT_, IT_ > &x) const
Calculate .
Variadic TupleVector class template.
void convert(const TupleVector< First2_, Rest2_... > &other)
Conversion method.
String class implementation.
UnitTest(const String &id_in, const String &datatype_name="none", const String &index_name="none", PreferredBackend preferred_backend=PreferredBackend::generic)
CTOR.
PreferredBackend
The backend that shall be used in all compute heavy calculations.
std::uint64_t Index
Index data type.