Go to the documentation of this file.
35#ifndef NEKTAR_LIBUTILITIES_LINEARALGEBRA_EXPLICIT_INSTANTIATION_H
36#define NEKTAR_LIBUTILITIES_LINEARALGEBRA_EXPLICIT_INSTANTIATION_H
38#include <boost/preprocessor/arithmetic/sub.hpp>
39#include <boost/preprocessor/array/elem.hpp>
40#include <boost/preprocessor/array/pop_front.hpp>
41#include <boost/preprocessor/array/push_back.hpp>
42#include <boost/preprocessor/array/size.hpp>
43#include <boost/preprocessor/comparison/greater.hpp>
44#include <boost/preprocessor/comparison/less.hpp>
45#include <boost/preprocessor/logical/bool.hpp>
46#include <boost/preprocessor/punctuation/comma.hpp>
47#include <boost/preprocessor/punctuation/comma_if.hpp>
48#include <boost/preprocessor/punctuation/paren.hpp>
49#include <boost/preprocessor/repetition/for.hpp>
50#include <boost/preprocessor/repetition/repeat.hpp>
54#define BOOST_PP_TUPLE_REM_0()
58#define NEKTAR_ALL_MATRIX_TYPES \
59 (6, (const DNekMat &, const DNekScalMat &, const DNekBlkMat &, \
60 const BlkMatDNekBlkMat &, const DNekScalBlkMat &, \
61 const BlkMatDNekScalBlkMat &))
62#define NEKTAR_BLOCK_MATRIX_TYPES \
63 (4, (const DNekBlkMat &, const BlkMatDNekBlkMat &, const DNekScalBlkMat &, \
64 const BlkMatDNekScalBlkMat &))
65#define NEKTAR_STANDARD_AND_SCALED_MATRICES \
66 (2, (const DNekMat &, const DNekScalMat &))
68#define NEKTAR_ALL_MATRIX_TYPES_SINGLE \
69 (6, (const SNekMat &, const SNekScalMat &, const SNekBlkMat &, \
70 const BlkMatSNekBlkMat &, const SNekScalBlkMat &, \
71 const BlkMatSNekScalBlkMat &))
72#define NEKTAR_BLOCK_MATRIX_TYPES_SINGLE \
73 (4, (const SNekBlkMat &, const BlkMatSNekBlkMat &, const SNekScalBlkMat &, \
74 const BlkMatSNekScalBlkMat &))
75#define NEKTAR_STANDARD_AND_SCALED_MATRICES_SINGLE \
76 (2, (const SNekMat &, const SNekScalMat &))
78#define NEKTAR_PRINT_ARRAY(z, n, data) \
79 BOOST_PP_ARRAY_ELEM(n, data) \
81 BOOST_PP_LESS(n, BOOST_PP_SUB(BOOST_PP_ARRAY_SIZE(data), 1)))
83#define NEKTAR_CREATE_EXPLICIT_INTSTANTIATION(z, n, data) \
84 template LIB_UTILITIES_EXPORT BOOST_PP_ARRAY_ELEM( \
85 0, BOOST_PP_ARRAY_ELEM(2, data)) BOOST_PP_ARRAY_ELEM(0, data) \
86 BOOST_PP_LPAREN() BOOST_PP_REPEAT( \
87 BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_ELEM(3, data)), \
88 NEKTAR_PRINT_ARRAY, BOOST_PP_ARRAY_ELEM(3, data)) \
89 BOOST_PP_COMMA_IF(BOOST_PP_GREATER( \
90 BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_ELEM(3, data)), 0)) \
91 BOOST_PP_ARRAY_ELEM(n, BOOST_PP_ARRAY_ELEM(1, data)) \
92 BOOST_PP_COMMA_IF(BOOST_PP_GREATER( \
93 BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_ELEM(4, data)), 0)) \
95 BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_ELEM(4, data)), \
96 NEKTAR_PRINT_ARRAY, BOOST_PP_ARRAY_ELEM(4, data)) \
99#define NEKTAR_GENERATE_EXPLICIT_FUNCTION_INSTANTIATION_SINGLE_MATRIX( \
100 MethodName, MatrixTypes, ReturnType, BeforeArgs, AfterArgs) \
102 BOOST_PP_ARRAY_SIZE(MatrixTypes), \
103 NEKTAR_CREATE_EXPLICIT_INTSTANTIATION, \
104 (5, (MethodName, MatrixTypes, ReturnType, BeforeArgs, AfterArgs)))
106#define NEKTAR_GENERATE_EXPLICIT_FUNCTION_INSTANTIATION_TWO_MATRICES_INNER( \
109 BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_ELEM(2, data)), \
110 NEKTAR_CREATE_EXPLICIT_INTSTANTIATION, \
111 (5, (BOOST_PP_ARRAY_ELEM(0, data), BOOST_PP_ARRAY_ELEM(2, data), \
112 BOOST_PP_ARRAY_ELEM(3, data), \
113 BOOST_PP_ARRAY_PUSH_BACK( \
114 BOOST_PP_ARRAY_ELEM(4, data), \
115 BOOST_PP_ARRAY_ELEM(n, BOOST_PP_ARRAY_ELEM(1, data))), \
116 BOOST_PP_ARRAY_ELEM(5, data))))
119#define NEKTAR_GENERATE_EXPLICIT_FUNCTION_INSTANTIATION_TWO_MATRICES( \
120 MethodName, FirstMatrixTypes, SecondMatrixTypes, ReturnType, BeforeArgs, \
123 BOOST_PP_ARRAY_SIZE(FirstMatrixTypes), \
124 NEKTAR_GENERATE_EXPLICIT_FUNCTION_INSTANTIATION_TWO_MATRICES_INNER, \
125 (6, (MethodName, FirstMatrixTypes, SecondMatrixTypes, ReturnType, \
126 BeforeArgs, AfterArgs)))