OGS
MatrixVectorTraits.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <memory>
14 #include "MatrixSpecifications.h"
15 
16 namespace MathLib
17 {
18 template<typename Matrix>
20 }
21 
22 #define SPECIALIZE_MATRIX_VECTOR_TRAITS(MATVEC, IDX) \
23  template <> \
24  struct MatrixVectorTraits<MATVEC> \
25  { \
26  using Index = IDX; \
27  static std::unique_ptr<MATVEC> newInstance(); \
28  static std::unique_ptr<MATVEC> newInstance(MATVEC const& A); \
29  static std::unique_ptr<MATVEC> newInstance( \
30  MatrixSpecifications const& spec); \
31  static std::unique_ptr<MATVEC> newInstance(Index const length); \
32  };
33 
34 #ifdef USE_PETSC
35 
38 
39 namespace MathLib
40 {
43 }
44 
45 
46 #else
47 
50 
51 namespace MathLib
52 {
55 }
56 
57 #endif
58 
59 #undef SPECIALIZE_MATRIX_VECTOR_TRAITS
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:33
Wrapper class for PETSc matrix routines for matrix.
Definition: PETScMatrix.h:32
Wrapper class for PETSc vector.
Definition: PETScVector.h:33
SPECIALIZE_MATRIX_VECTOR_TRAITS(PETScMatrix, PETScMatrix::IndexType)