OGS
MatrixVectorTraits.h
Go to the documentation of this file.
1
11#pragma once
12
13#include <memory>
14
16
17namespace MathLib
18{
19template <typename Matrix>
21}
22
23#define SPECIALIZE_MATRIX_VECTOR_TRAITS(MATVEC, IDX) \
24 template <> \
25 struct MatrixVectorTraits<MATVEC> \
26 { \
27 using Index = IDX; \
28 static std::unique_ptr<MATVEC> newInstance(); \
29 static std::unique_ptr<MATVEC> newInstance(MATVEC const& A); \
30 static std::unique_ptr<MATVEC> newInstance( \
31 MatrixSpecifications const& spec); \
32 static std::unique_ptr<MATVEC> newInstance(Index const length); \
33 };
34
35#ifdef USE_PETSC
36
39
40namespace MathLib
41{
44} // namespace MathLib
45
46#else
47
50
51namespace MathLib
52{
55} // namespace MathLib
56
57#endif
58
59#undef SPECIALIZE_MATRIX_VECTOR_TRAITS
#define SPECIALIZE_MATRIX_VECTOR_TRAITS(MATVEC, IDX)
Declaration of class PETScMatrix, which provides an interface to PETSc matrix routines.
Declaration of class PETScVector, which provides an interface to PETSc vector routines.
RawMatrixType::Index IndexType
Definition EigenMatrix.h:32
Eigen::SparseMatrix< double >::Index IndexType
Definition EigenVector.h:32
Wrapper class for PETSc matrix routines for matrix.
Definition PETScMatrix.h:32
Wrapper class for PETSc vector.
Definition PETScVector.h:40