OGS
MatrixVectorTraits.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <memory>
7
9
10namespace MathLib
11{
12template <typename Matrix>
14}
15
16#define SPECIALIZE_MATRIX_VECTOR_TRAITS(MATVEC, IDX) \
17 template <> \
18 struct MatrixVectorTraits<MATVEC> \
19 { \
20 using Index = IDX; \
21 static std::unique_ptr<MATVEC> newInstance(); \
22 static std::unique_ptr<MATVEC> newInstance(MATVEC const& A); \
23 static std::unique_ptr<MATVEC> newInstance( \
24 MatrixSpecifications const& spec); \
25 static std::unique_ptr<MATVEC> newInstance(Index const length); \
26 };
27
28#ifdef USE_PETSC
29
32
33namespace MathLib
34{
37} // namespace MathLib
38
39#else
40
43
44namespace MathLib
45{
48} // namespace MathLib
49
50#endif
51
52#undef SPECIALIZE_MATRIX_VECTOR_TRAITS
#define SPECIALIZE_MATRIX_VECTOR_TRAITS(MATVEC, IDX)
RawMatrixType::Index IndexType
Definition EigenMatrix.h:25
Eigen::SparseMatrix< double >::Index IndexType
Definition EigenVector.h:26
Wrapper class for PETSc matrix routines for matrix.
Definition PETScMatrix.h:21
Wrapper class for PETSc vector.
Definition PETScVector.h:28