31 #include <Base/Math/Matrix.hh>
32 #include <Base/Math/Matrix2x2.hh>
33 #include <Base/Math/Matrix3x3.hh>
34 #include <Base/Math/SymmetricMatrix3x3.hh>
35 #include <Base/Math/Matrix3x4.hh>
36 #include <Base/Math/Matrix4x4.hh>
44 #define MATRIX_INTERFACE(RESULT, FUNCTION, CONST, ARG)\
45 { RESULT (MATRIX_CLASS<T>::* p)(ARG) CONST = &MATRIX_CLASS<T>::FUNCTION; \
48 #define MATRIX_INTERFACE2(RESULT, FUNCTION, CONST, ARG1, ARG2)\
49 { RESULT (MATRIX_CLASS<T>::* p)(ARG1, ARG2) CONST = &MATRIX_CLASS<T>::FUNCTION; \
52 #define MATRIX_INTERFACE3(RESULT, FUNCTION, CONST)\
53 { RESULT (MATRIX_CLASS<T>::* p)() CONST = &MATRIX_CLASS<T>::FUNCTION; \
56 #define MATRIX_INTERFACE4(RESULT, FUNCTION)\
57 { RESULT (MATRIX_CLASS<T>::* p)() = &MATRIX_CLASS<T>::FUNCTION; \
61 #define MATRIX_INTERFACE5(RESULT, FUNCTION, ARG)\
62 { RESULT (MATRIX_CLASS<T>::* p)(ARG) = &MATRIX_CLASS<T>::FUNCTION; \
65 template <
template <
typename>
class MATRIX_CLASS,
66 template <
typename>
class VECTOR_CLASS,
class T>
67 class MatrixInterfaceCheck
70 static void Constraints()
75 #if __GNUC_PREREQ(4,6)
76 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
78 MATRIX_INTERFACE5(T* ,
operator[],
const unsigned);
81 #if __GNUC_PREREQ(4,6)
82 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
84 MATRIX_INTERFACE(
const T* ,
operator[],
const,
const unsigned);
87 #if __GNUC_PREREQ(4,6)
88 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
90 MATRIX_INTERFACE4(T* , GetData);
93 #if __GNUC_PREREQ(4,6)
94 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
96 MATRIX_INTERFACE3(
const T* , GetData,
const);
99 #if __GNUC_PREREQ(4,6)
100 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
102 MATRIX_INTERFACE3(
unsigned , GetNumElements,
const);
105 #if __GNUC_PREREQ(4,6)
106 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
108 MATRIX_INTERFACE4(
void, SetZero);
111 #if __GNUC_PREREQ(4,6)
112 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
114 MATRIX_INTERFACE4(
void, SetIdentity);
117 #if __GNUC_PREREQ(4,6)
118 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
120 MATRIX_INTERFACE2(
void, Mult,
const,
const VECTOR_CLASS<T> &, VECTOR_CLASS<T> &);
123 #if __GNUC_PREREQ(4,6)
124 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
126 MATRIX_INTERFACE2(
void, TransposedMult,
const,
const VECTOR_CLASS<T> &, VECTOR_CLASS<T> &);
129 #if __GNUC_PREREQ(4,6)
130 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
132 MATRIX_INTERFACE2(
void, Mult,
const,
const MATRIX_CLASS<T> &, MATRIX_CLASS<T> &);
135 #if __GNUC_PREREQ(4,6)
136 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
138 MATRIX_INTERFACE5(MATRIX_CLASS<T>&,
operator*= ,
const MATRIX_CLASS<T> &);
141 #if __GNUC_PREREQ(4,6)
142 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
144 MATRIX_INTERFACE2(
void, Scale,
const,
const T &, MATRIX_CLASS<T> &);
147 #if __GNUC_PREREQ(4,6)
148 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
150 MATRIX_INTERFACE5(
bool, Load ,
const std::string &);
153 #if __GNUC_PREREQ(4,6)
154 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
156 MATRIX_INTERFACE(
bool, Save,
const ,
const std::string &);
164 MatrixInterfaceCheck()
166 void(*p)() = Constraints; p=0;
172 int main(
int argc,
char *argv[])
180 MatrixInterfaceCheck<Matrix3x3, Vector3, double > m3x3;