10#include <kernel/lafem/dense_vector.hpp>
11#include <kernel/lafem/power_vector.hpp>
12#include <kernel/lafem/tuple_vector.hpp>
13#include <kernel/lafem/sparse_matrix_csr.hpp>
14#include <kernel/lafem/power_diag_matrix.hpp>
15#include <kernel/lafem/power_col_matrix.hpp>
16#include <kernel/lafem/power_row_matrix.hpp>
17#include <kernel/lafem/power_full_matrix.hpp>
18#include <kernel/lafem/saddle_point_matrix.hpp>
19#include <kernel/lafem/pointstar_factory.hpp>
27 template<
typename DataType_,
typename IndexType_>
28 struct MetaMatrixTestHelper
31 typedef DenseVector<DataType_, IndexType_> ScalarVector;
33 typedef SparseMatrixCSR<DataType_, IndexType_> ScalarMatrixA;
35 typedef SparseMatrixCSR<DataType_, IndexType_> ScalarMatrixB;
37 typedef SparseMatrixCSR<DataType_, IndexType_> ScalarMatrixD;
92 template<
typename DataType_,
typename IndexType_>
97 typedef DataType_ DataType;
98 typedef IndexType_ IndexType;
99 typedef MetaMatrixTestHelper<DataType, IndexType> Helper;
131 :
FEAT::TestSystem::
UnitTest(id_in, datatype_name, index_name, preferred_backend)
152 mat_sys.template at<0,0>().template at<0,0>().
convert(mat_fe);
153 mat_sys.template at<0,0>().template at<1,1>().
convert(mat_fe);
154 mat_sys.template at<0,1>().template at<0,0>().
convert(mat_fd);
155 mat_sys.template at<0,1>().template at<1,0>().
convert(mat_fd);
156 mat_sys.template at<1,0>().template at<0,0>().
convert(mat_fd);
157 mat_sys.template at<1,0>().template at<0,1>().
convert(mat_fd);
160 vec_sol.template at<0>().template at<0>().
convert(vec_bubble);
161 vec_sol.template at<0>().template at<1>().
convert(vec_eigen1);
162 vec_sol.template at<1>().
convert(vec_eigen2);
170 mat_fe.
apply(vec_rhs1, vec_bubble);
173 mat_fd.
apply(vec_rhs3, vec_bubble);
177 vec_rhs.template at<0>().template at<0>().
convert(vec_rhs1);
178 vec_rhs.template at<0>().template at<1>().
convert(vec_rhs2);
179 vec_rhs.template at<1>().
convert(vec_rhs3);
199 mat_sys.template at<0,0>().template at<0,0>().
convert(mat_fe);
200 mat_sys.template at<0,0>().template at<1,1>().
convert(mat_fe);
201 mat_sys.template at<0,0>().template at<0,1>().
convert(mat_fd);
202 mat_sys.template at<0,0>().template at<1,0>().
convert(mat_fd);
203 mat_sys.template at<0,1>().template at<0,0>().
convert(mat_fd);
204 mat_sys.template at<0,1>().template at<1,0>().
convert(mat_fd);
205 mat_sys.template at<1,0>().template at<0,0>().
convert(mat_fd);
206 mat_sys.template at<1,0>().template at<0,1>().
convert(mat_fd);
209 vec_sol.template at<0>().template at<0>().
convert(vec_bubble);
210 vec_sol.template at<0>().template at<1>().
convert(vec_eigen1);
211 vec_sol.template at<1>().
convert(vec_eigen2);
219 mat_fe.
apply(vec_rhs1, vec_bubble);
220 mat_fd.
apply(vec_rhs2, vec_bubble);
223 mat_fd.
apply(vec_rhs3, vec_bubble);
227 vec_rhs.template at<0>().template at<0>().
convert(vec_rhs1);
228 vec_rhs.template at<0>().template at<1>().
convert(vec_rhs2);
229 vec_rhs.template at<1>().
convert(vec_rhs3);
Index size() const
Returns the containers size.
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 .
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.