From 37bd64b496211c366e1f6c20de78b16b3c60e5be Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 18 Jun 2007 07:01:42 +0000 Subject: [PATCH] Remove remaining per-element math functions. Remove defines for IEEE, SYSV and complex math. Now the user has to define himself EIGEN_USE_COMPLEX if he wants complex support. Remove TVMET_OPTIMIZE. More cleanup. --- cmake/modules/CheckComplex.cmake | 22 - cmake/modules/CheckComplexMath1.cmake | 23 - cmake/modules/CheckComplexMath2.cmake | 22 - cmake/modules/CheckIeeeMath.cmake | 30 -- cmake/modules/CheckSysvMath.cmake | 34 -- tvmet-1.7.1/ChangeLog | 4 +- tvmet-1.7.1/doc/Doxyfile.in | 2 +- tvmet-1.7.1/doc/Util.h | 2 +- tvmet-1.7.1/include/tvmet/BinaryFunctionals.h | 4 +- tvmet-1.7.1/include/tvmet/CMakeLists.txt | 10 - tvmet-1.7.1/include/tvmet/Matrix.h | 81 ++- .../include/tvmet/MatrixBinaryFunctions.h | 492 ------------------ tvmet-1.7.1/include/tvmet/MatrixEval.h | 4 +- tvmet-1.7.1/include/tvmet/MatrixFunctions.h | 74 +-- tvmet-1.7.1/include/tvmet/MatrixOperators.h | 42 +- .../include/tvmet/MatrixUnaryFunctions.h | 10 +- tvmet-1.7.1/include/tvmet/NumericTraits.h | 6 +- tvmet-1.7.1/include/tvmet/TypePromotion.h | 4 +- tvmet-1.7.1/include/tvmet/UnaryFunctionals.h | 4 +- tvmet-1.7.1/include/tvmet/Vector.h | 81 ++- .../include/tvmet/VectorBinaryFunctions.h | 490 ----------------- tvmet-1.7.1/include/tvmet/VectorEval.h | 4 +- tvmet-1.7.1/include/tvmet/VectorFunctions.h | 54 +- tvmet-1.7.1/include/tvmet/VectorOperators.h | 30 +- .../include/tvmet/VectorUnaryFunctions.h | 10 +- tvmet-1.7.1/include/tvmet/config.h.cmake | 15 - tvmet-1.7.1/include/tvmet/tvmet.h | 62 +-- tvmet-1.7.1/include/tvmet/util/Incrementor.h | 4 +- tvmet-1.7.1/include/tvmet/util/Random.h | 4 +- tvmet-1.7.1/include/tvmet/xpr/Matrix.h | 1 - .../include/tvmet/xpr/MatrixBinaryFunctions.h | 277 ---------- .../include/tvmet/xpr/MatrixFunctions.h | 38 +- .../include/tvmet/xpr/MatrixOperators.h | 24 +- tvmet-1.7.1/include/tvmet/xpr/Vector.h | 1 - .../include/tvmet/xpr/VectorBinaryFunctions.h | 279 ---------- .../include/tvmet/xpr/VectorFunctions.h | 40 +- .../include/tvmet/xpr/VectorOperators.h | 20 +- tvmet-1.7.1/testsuite/TestConstruction.cc | 2 +- tvmet-1.7.1/testsuite/TestDimension.cc | 2 +- .../testsuite/TestNumericTraitsComplex.cc | 2 +- tvmet-1.7.1/testsuite/main.h | 3 +- tvmet-1.7.1/testsuite/selftest.cpp | 2 +- 42 files changed, 279 insertions(+), 2036 deletions(-) delete mode 100644 cmake/modules/CheckComplex.cmake delete mode 100644 cmake/modules/CheckComplexMath1.cmake delete mode 100644 cmake/modules/CheckComplexMath2.cmake delete mode 100644 cmake/modules/CheckIeeeMath.cmake delete mode 100644 cmake/modules/CheckSysvMath.cmake delete mode 100644 tvmet-1.7.1/include/tvmet/MatrixBinaryFunctions.h delete mode 100644 tvmet-1.7.1/include/tvmet/VectorBinaryFunctions.h delete mode 100644 tvmet-1.7.1/include/tvmet/xpr/MatrixBinaryFunctions.h delete mode 100644 tvmet-1.7.1/include/tvmet/xpr/VectorBinaryFunctions.h diff --git a/cmake/modules/CheckComplex.cmake b/cmake/modules/CheckComplex.cmake deleted file mode 100644 index 6b667f486..000000000 --- a/cmake/modules/CheckComplex.cmake +++ /dev/null @@ -1,22 +0,0 @@ -INCLUDE(CheckCXXSourceCompiles) - -MACRO (CHECK_COMPLEX _RESULT) - -SET(_CHECK_COMPLEX_SOURCE_CODE " - -#include - -using namespace std; - -int main(int argc, char *argv[]) -{ - complex x(1.0, 1.0); - complex y(1.0f, 1.0f); - return 0; -} - -") - -CHECK_CXX_SOURCE_COMPILES("${_CHECK_COMPLEX_SOURCE_CODE}" ${_RESULT}) - -ENDMACRO (CHECK_COMPLEX) diff --git a/cmake/modules/CheckComplexMath1.cmake b/cmake/modules/CheckComplexMath1.cmake deleted file mode 100644 index 52024288d..000000000 --- a/cmake/modules/CheckComplexMath1.cmake +++ /dev/null @@ -1,23 +0,0 @@ -INCLUDE(CheckCXXSourceCompiles) - -MACRO (CHECK_COMPLEX_MATH1 _RESULT) - -SET(_CHECK_COMPLEX_MATH1_SOURCE_CODE " - -#include - -using namespace std; - -int main(int argc, char *argv[]) -{ - complex x(1.0, 1.0), y(1.0, 1.0); - cos(x); cosh(x); exp(x); log(x); pow(x,1); pow(x,double(2.0)); - pow(x, y); pow(double(2.0), x); sin(x); sinh(x); sqrt(x); tan(x); tanh(x); - return 0; -} - -") - -CHECK_CXX_SOURCE_COMPILES("${_CHECK_COMPLEX_MATH1_SOURCE_CODE}" ${_RESULT}) - -ENDMACRO (CHECK_COMPLEX_MATH1) diff --git a/cmake/modules/CheckComplexMath2.cmake b/cmake/modules/CheckComplexMath2.cmake deleted file mode 100644 index 68ed74417..000000000 --- a/cmake/modules/CheckComplexMath2.cmake +++ /dev/null @@ -1,22 +0,0 @@ -INCLUDE(CheckCXXSourceCompiles) - -MACRO (CHECK_COMPLEX_MATH2 _RESULT) - -SET(_CHECK_COMPLEX_MATH2_SOURCE_CODE " - -#include - -using namespace std; - -int main(int argc, char *argv[]) -{ - complex x(1.0, 1.0), y(1.0, 1.0); - acos(x); asin(x); atan(x); atan2(x,y); atan2(x, double(3.0)); - atan2(double(3.0), x); log10(x); return 0; -} - -") - -CHECK_CXX_SOURCE_COMPILES("${_CHECK_COMPLEX_MATH2_SOURCE_CODE}" ${_RESULT}) - -ENDMACRO (CHECK_COMPLEX_MATH2) diff --git a/cmake/modules/CheckIeeeMath.cmake b/cmake/modules/CheckIeeeMath.cmake deleted file mode 100644 index 13bc6ac61..000000000 --- a/cmake/modules/CheckIeeeMath.cmake +++ /dev/null @@ -1,30 +0,0 @@ -INCLUDE(CheckCXXSourceCompiles) - -MACRO (CHECK_IEEE_MATH _RESULT) - -SET(_CHECK_IEEE_MATH_SOURCE_CODE " - -#include - -int main(int argc, char *argv[]) -{ - double x = 1.0; double y = 1.0; - acosh(x); asinh(x); atanh(x); - expm1(x); - erf(x); erfc(x); - // finite(x); - isnan(x); - j0(x); j1(x); - lgamma(x); - logb(x); log1p(x); - rint(x); - // trunc(x); - y0(x); y1(x); - return 0; -} - -") - -CHECK_CXX_SOURCE_COMPILES("${_CHECK_IEEE_MATH_SOURCE_CODE}" ${_RESULT}) - -ENDMACRO (CHECK_IEEE_MATH) diff --git a/cmake/modules/CheckSysvMath.cmake b/cmake/modules/CheckSysvMath.cmake deleted file mode 100644 index d4542bc59..000000000 --- a/cmake/modules/CheckSysvMath.cmake +++ /dev/null @@ -1,34 +0,0 @@ -INCLUDE(CheckCXXSourceCompiles) - -MACRO (CHECK_SYSV_MATH _RESULT) - -SET(_CHECK_SYSV_MATH_SOURCE_CODE " - -#include - -int main(int argc, char *argv[]) -{ - double x = 1.0; double y = 1.0; - _class(x); - ilogb(x); - itrunc(x); - nearest(x); - rsqrt(x); - uitrunc(x); - - copysign(x,y); - drem(x,y); - fmod(x,y); - hypot(x,y); - nextafter(x,y); - remainder(x,y); - scalb(x,y); - unordered(x,y); - return 0; -} - -") - -CHECK_CXX_SOURCE_COMPILES("${_CHECK_SYSV_MATH_SOURCE_CODE}" ${_RESULT}) - -ENDMACRO (CHECK_SYSV_MATH) diff --git a/tvmet-1.7.1/ChangeLog b/tvmet-1.7.1/ChangeLog index 5b2b679fe..7e7066a21 100644 --- a/tvmet-1.7.1/ChangeLog +++ b/tvmet-1.7.1/ChangeLog @@ -412,7 +412,7 @@ 2004-06-08 18:19 opetzold * include/tvmet/: tvmet.h, config/config-gcc.h: added macro - TVMET_CXX_ALWAYS_INLINE, to use gcc compiler better using + _tvmet_always_inline, to use gcc compiler better using __attribute__((always_inline)). 2004-06-08 18:17 opetzold @@ -1972,7 +1972,7 @@ 2003-09-27 16:46 opetzold * include/tvmet/MatrixBinaryFunctions.h: complex<> support improved - using TVMET_HAVE_COMPLEX_MATH{1,2} + using EIGEN_USE_COMPLEX_MATH{1,2} 2003-09-25 21:37 opetzold diff --git a/tvmet-1.7.1/doc/Doxyfile.in b/tvmet-1.7.1/doc/Doxyfile.in index a83ae69bb..b98c263b4 100644 --- a/tvmet-1.7.1/doc/Doxyfile.in +++ b/tvmet-1.7.1/doc/Doxyfile.in @@ -916,7 +916,7 @@ INCLUDE_FILE_PATTERNS = PREDEFINED = DOXYGEN_SKIP_THIS \ TVMET_HAVE_LONG_DOUBLE \ - TVMET_HAVE_COMPLEX \ + EIGEN_USE_COMPLEX \ TVMET_HAVE_IEEE_MATH # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then diff --git a/tvmet-1.7.1/doc/Util.h b/tvmet-1.7.1/doc/Util.h index 1a0ccc080..db38b4ee6 100644 --- a/tvmet-1.7.1/doc/Util.h +++ b/tvmet-1.7.1/doc/Util.h @@ -164,7 +164,7 @@ public: #ifdef TVMET_HAVE_LONG_DOUBLE datatypes.push_back( DataType("long double", "long double") ); #endif // HAVE_LONG_DOUBLE -#ifdef TVMET_HAVE_COMPLEX +#ifdef EIGEN_USE_COMPLEX datatypes.push_back( DataType("const std::complex&", "std::complex") ); #endif // HAVE_COMPLEX } diff --git a/tvmet-1.7.1/include/tvmet/BinaryFunctionals.h b/tvmet-1.7.1/include/tvmet/BinaryFunctionals.h index 89fdbdf41..b0f6d18e7 100644 --- a/tvmet-1.7.1/include/tvmet/BinaryFunctionals.h +++ b/tvmet-1.7.1/include/tvmet/BinaryFunctionals.h @@ -235,7 +235,7 @@ TVMET_IMPLEMENT_MACRO(yn) #undef TVMET_IMPLEMENT_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /** * \class Fcnl_polar BinaryFunctionals.h "tvmet/BinaryFunctionals.h" * \brief %Functional for polar. @@ -266,7 +266,7 @@ struct Fcnl_polar : public BinaryFunctional { << std::endl; } }; -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /** diff --git a/tvmet-1.7.1/include/tvmet/CMakeLists.txt b/tvmet-1.7.1/include/tvmet/CMakeLists.txt index 04597cdb2..fb75aac19 100644 --- a/tvmet-1.7.1/include/tvmet/CMakeLists.txt +++ b/tvmet-1.7.1/include/tvmet/CMakeLists.txt @@ -1,9 +1,4 @@ INCLUDE (CheckIncludeFiles) -INCLUDE (CheckComplex) -INCLUDE (CheckComplexMath1) -INCLUDE (CheckComplexMath2) -INCLUDE (CheckIeeeMath) -INCLUDE (CheckSysvMath) INCLUDE (CheckRestrictKeyword) INCLUDE (CheckAlwaysInline) @@ -11,11 +6,6 @@ FILE(GLOB tvmet_header_SRCS "*.h") CHECK_INCLUDE_FILES (sys/time.h TVMET_HAVE_SYS_TIME_H) CHECK_INCLUDE_FILES (unistd.h TVMET_HAVE_UNISTD_H) -CHECK_COMPLEX (TVMET_HAVE_COMPLEX) -CHECK_COMPLEX_MATH1 (TVMET_HAVE_COMPLEX_MATH1) -CHECK_COMPLEX_MATH2 (TVMET_HAVE_COMPLEX_MATH2) -CHECK_IEEE_MATH (TVMET_HAVE_IEEE_MATH) -CHECK_SYSV_MATH (TVMET_HAVE_SYSV_MATH) CHECK_RESTRICT_KEYWORD (TVMET_RESTRICT_KEYWORD) CHECK_ALWAYS_INLINE (TVMET_ALWAYS_INLINE) diff --git a/tvmet-1.7.1/include/tvmet/Matrix.h b/tvmet-1.7.1/include/tvmet/Matrix.h index 73e3d1a8c..87249d207 100644 --- a/tvmet-1.7.1/include/tvmet/Matrix.h +++ b/tvmet-1.7.1/include/tvmet/Matrix.h @@ -354,56 +354,56 @@ private: public: // math operators with scalars // NOTE: this meaning is clear - element wise ops even if not in ns element_wise - Matrix& operator+=(value_type) TVMET_CXX_ALWAYS_INLINE; - Matrix& operator-=(value_type) TVMET_CXX_ALWAYS_INLINE; - Matrix& operator*=(value_type) TVMET_CXX_ALWAYS_INLINE; - Matrix& operator/=(value_type) TVMET_CXX_ALWAYS_INLINE; + Matrix& operator+=(value_type) _tvmet_always_inline; + Matrix& operator-=(value_type) _tvmet_always_inline; + Matrix& operator*=(value_type) _tvmet_always_inline; + Matrix& operator/=(value_type) _tvmet_always_inline; - Matrix& operator%=(int) TVMET_CXX_ALWAYS_INLINE; - Matrix& operator^=(int) TVMET_CXX_ALWAYS_INLINE; - Matrix& operator&=(int) TVMET_CXX_ALWAYS_INLINE; - Matrix& operator|=(int) TVMET_CXX_ALWAYS_INLINE; - Matrix& operator<<=(int) TVMET_CXX_ALWAYS_INLINE; - Matrix& operator>>=(int) TVMET_CXX_ALWAYS_INLINE; + Matrix& operator%=(int) _tvmet_always_inline; + Matrix& operator^=(int) _tvmet_always_inline; + Matrix& operator&=(int) _tvmet_always_inline; + Matrix& operator|=(int) _tvmet_always_inline; + Matrix& operator<<=(int) _tvmet_always_inline; + Matrix& operator>>=(int) _tvmet_always_inline; public: // math operators with matrizes // NOTE: access using the operators in ns element_wise, since that's what is does - template Matrix& M_add_eq(const Matrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_sub_eq(const Matrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_mul_eq(const Matrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_div_eq(const Matrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_mod_eq(const Matrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_xor_eq(const Matrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_and_eq(const Matrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_or_eq (const Matrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_shl_eq(const Matrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_shr_eq(const Matrix&) TVMET_CXX_ALWAYS_INLINE; + template Matrix& M_add_eq(const Matrix&) _tvmet_always_inline; + template Matrix& M_sub_eq(const Matrix&) _tvmet_always_inline; + template Matrix& M_mul_eq(const Matrix&) _tvmet_always_inline; + template Matrix& M_div_eq(const Matrix&) _tvmet_always_inline; + template Matrix& M_mod_eq(const Matrix&) _tvmet_always_inline; + template Matrix& M_xor_eq(const Matrix&) _tvmet_always_inline; + template Matrix& M_and_eq(const Matrix&) _tvmet_always_inline; + template Matrix& M_or_eq (const Matrix&) _tvmet_always_inline; + template Matrix& M_shl_eq(const Matrix&) _tvmet_always_inline; + template Matrix& M_shr_eq(const Matrix&) _tvmet_always_inline; public: // math operators with expressions // NOTE: access using the operators in ns element_wise, since that's what is does - template Matrix& M_add_eq(const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_sub_eq(const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_mul_eq(const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_div_eq(const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_mod_eq(const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_xor_eq(const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_and_eq(const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_or_eq (const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_shl_eq(const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& M_shr_eq(const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; + template Matrix& M_add_eq(const XprMatrix&) _tvmet_always_inline; + template Matrix& M_sub_eq(const XprMatrix&) _tvmet_always_inline; + template Matrix& M_mul_eq(const XprMatrix&) _tvmet_always_inline; + template Matrix& M_div_eq(const XprMatrix&) _tvmet_always_inline; + template Matrix& M_mod_eq(const XprMatrix&) _tvmet_always_inline; + template Matrix& M_xor_eq(const XprMatrix&) _tvmet_always_inline; + template Matrix& M_and_eq(const XprMatrix&) _tvmet_always_inline; + template Matrix& M_or_eq (const XprMatrix&) _tvmet_always_inline; + template Matrix& M_shl_eq(const XprMatrix&) _tvmet_always_inline; + template Matrix& M_shr_eq(const XprMatrix&) _tvmet_always_inline; public: // aliased math operators with expressions - template Matrix& alias_assign(const Matrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& alias_add_eq(const Matrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& alias_sub_eq(const Matrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& alias_mul_eq(const Matrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& alias_div_eq(const Matrix&) TVMET_CXX_ALWAYS_INLINE; + template Matrix& alias_assign(const Matrix&) _tvmet_always_inline; + template Matrix& alias_add_eq(const Matrix&) _tvmet_always_inline; + template Matrix& alias_sub_eq(const Matrix&) _tvmet_always_inline; + template Matrix& alias_mul_eq(const Matrix&) _tvmet_always_inline; + template Matrix& alias_div_eq(const Matrix&) _tvmet_always_inline; - template Matrix& alias_assign(const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& alias_add_eq(const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& alias_sub_eq(const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& alias_mul_eq(const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; - template Matrix& alias_div_eq(const XprMatrix&) TVMET_CXX_ALWAYS_INLINE; + template Matrix& alias_assign(const XprMatrix&) _tvmet_always_inline; + template Matrix& alias_add_eq(const XprMatrix&) _tvmet_always_inline; + template Matrix& alias_sub_eq(const XprMatrix&) _tvmet_always_inline; + template Matrix& alias_mul_eq(const XprMatrix&) _tvmet_always_inline; + template Matrix& alias_div_eq(const XprMatrix&) _tvmet_always_inline; public: // io /** Structure for info printing as Matrix. */ @@ -443,7 +443,6 @@ typedef Matrix Matrix4d; #include #include -#include #include #include #include diff --git a/tvmet-1.7.1/include/tvmet/MatrixBinaryFunctions.h b/tvmet-1.7.1/include/tvmet/MatrixBinaryFunctions.h deleted file mode 100644 index c45954768..000000000 --- a/tvmet-1.7.1/include/tvmet/MatrixBinaryFunctions.h +++ /dev/null @@ -1,492 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * lesser General Public License for more details. - * - * You should have received a copy of the GNU lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: MatrixBinaryFunctions.h,v 1.12 2005/04/26 15:05:06 opetzold Exp $ - */ - -#ifndef TVMET_MATRIX_BINARY_FUNCTIONS_H -#define TVMET_MATRIX_BINARY_FUNCTIONS_H - -namespace tvmet { - -/********************************************************* - * PART I: DECLARATION - *********************************************************/ - -/* - * binary_function(Matrix, Matrix) - * binary_function(Matrix, XprMatrix) - * binary_function(XprMatrix, Matrix) - */ -#define TVMET_DECLARE_MACRO(NAME) \ -template \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME, \ - MatrixConstReference, \ - MatrixConstReference \ - >, \ - Rows, Cols \ -> \ -NAME(const Matrix& lhs, \ - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ - \ -template \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME, \ - MatrixConstReference, \ - XprMatrix \ - >, \ - Rows, Cols \ -> \ -NAME(const XprMatrix& lhs, \ - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ - \ -template \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME, \ - MatrixConstReference, \ - XprMatrix \ - >, \ - Rows, Cols \ -> \ -NAME(const Matrix& lhs, \ - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; - -TVMET_DECLARE_MACRO(atan2) -TVMET_DECLARE_MACRO(drem) -TVMET_DECLARE_MACRO(fmod) -TVMET_DECLARE_MACRO(hypot) -TVMET_DECLARE_MACRO(jn) -TVMET_DECLARE_MACRO(yn) -TVMET_DECLARE_MACRO(pow) -#if defined(TVMET_HAVE_COMPLEX) -TVMET_DECLARE_MACRO(polar) -#endif - -#undef TVMET_DECLARE_MACRO - - -/* - * binary_function(Matrix, POD) - */ -#define TVMET_DECLARE_MACRO(NAME, TP) \ -template \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME, \ - MatrixConstReference, \ - XprLiteral< TP > \ - >, \ - Rows, Cols \ -> \ -NAME(const Matrix& lhs, TP rhs) TVMET_CXX_ALWAYS_INLINE; - -TVMET_DECLARE_MACRO(atan2, int) -TVMET_DECLARE_MACRO(drem, int) -TVMET_DECLARE_MACRO(fmod, int) -TVMET_DECLARE_MACRO(hypot, int) -TVMET_DECLARE_MACRO(jn, int) -TVMET_DECLARE_MACRO(yn, int) -TVMET_DECLARE_MACRO(pow, int) - -TVMET_DECLARE_MACRO(atan2, float) -TVMET_DECLARE_MACRO(drem, float) -TVMET_DECLARE_MACRO(fmod, float) -TVMET_DECLARE_MACRO(hypot, float) -TVMET_DECLARE_MACRO(jn, float) -TVMET_DECLARE_MACRO(yn, float) -TVMET_DECLARE_MACRO(pow, float) - -TVMET_DECLARE_MACRO(atan2, double) -TVMET_DECLARE_MACRO(drem, double) -TVMET_DECLARE_MACRO(fmod, double) -TVMET_DECLARE_MACRO(hypot, double) -TVMET_DECLARE_MACRO(jn, double) -TVMET_DECLARE_MACRO(yn, double) -TVMET_DECLARE_MACRO(pow, double) - -#undef TVMET_DECLARE_MACRO - - -/* - * complex math - */ - -#if defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH1) -template -XprMatrix< - XprBinOp< - Fcnl_pow >, - MatrixConstReference, - XprLiteral< std::complex > - >, - Rows, Cols -> -pow(const Matrix& lhs, - const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; - - -template -XprMatrix< - XprBinOp< - Fcnl_pow< std::complex, std::complex >, - MatrixConstReference, Rows, Cols>, - XprLiteral< std::complex > - >, - Rows, Cols -> -pow(const Matrix, Rows, Cols>& lhs, - const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; - - -/** - * \fn pow(const Matrix, Rows, Cols>& lhs, const T& rhs) - * \ingroup _binary_function - */ -template -XprMatrix< - XprBinOp< - Fcnl_pow, T>, - MatrixConstReference, Rows, Cols>, - XprLiteral - >, - Rows, Cols -> -pow(const Matrix, Rows, Cols>& lhs, - const T& rhs) TVMET_CXX_ALWAYS_INLINE; - - -/** - * \fn pow(const Matrix, Rows, Cols>& lhs, int rhs) - * \ingroup _binary_function - */ -template -XprMatrix< - XprBinOp< - Fcnl_pow, int>, - MatrixConstReference, Rows, Cols>, - XprLiteral - >, - Rows, Cols -> -pow(const Matrix, Rows, Cols>& lhs, - int rhs) TVMET_CXX_ALWAYS_INLINE; - - -template -XprMatrix< - XprBinOp< - Fcnl_polar, - MatrixConstReference, - XprLiteral - >, - Rows, Cols -> -polar(const Matrix& lhs, - const T& rhs) TVMET_CXX_ALWAYS_INLINE; - -#endif // defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH1) - - -#if defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH2) -// to be written (atan2) -#endif // defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH2) - - -/********************************************************* - * PART II: IMPLEMENTATION - *********************************************************/ - -/* - * binary_function(Matrix, Matrix) - * binary_function(Matrix, XprMatrix) - * binary_function(XprMatrix, Matrix) - */ -#define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME, \ - MatrixConstReference, \ - MatrixConstReference \ - >, \ - Rows, Cols \ -> \ -NAME(const Matrix& lhs, const Matrix& rhs) { \ - typedef XprBinOp < \ - Fcnl_##NAME, \ - MatrixConstReference, \ - MatrixConstReference \ - > expr_type; \ - return XprMatrix( \ - expr_type(lhs.const_ref(), rhs.const_ref())); \ -} \ - \ -template \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME, \ - MatrixConstReference, \ - XprMatrix \ - >, \ - Rows, Cols \ -> \ -NAME(const XprMatrix& lhs, const Matrix& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME, \ - XprMatrix, \ - MatrixConstReference \ - > expr_type; \ - return XprMatrix( \ - expr_type(lhs, rhs.const_ref())); \ -} \ - \ -template \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME, \ - MatrixConstReference, \ - XprMatrix \ - >, \ - Rows, Cols \ -> \ -NAME(const Matrix& lhs, const XprMatrix& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME, \ - MatrixConstReference, \ - XprMatrix \ - > expr_type; \ - return XprMatrix( \ - expr_type(lhs.const_ref(), rhs)); \ -} - -TVMET_IMPLEMENT_MACRO(atan2) -TVMET_IMPLEMENT_MACRO(drem) -TVMET_IMPLEMENT_MACRO(fmod) -TVMET_IMPLEMENT_MACRO(hypot) -TVMET_IMPLEMENT_MACRO(jn) -TVMET_IMPLEMENT_MACRO(yn) -TVMET_IMPLEMENT_MACRO(pow) -#if defined(TVMET_HAVE_COMPLEX) -TVMET_IMPLEMENT_MACRO(polar) -#endif -#undef TVMET_IMPLEMENT_MACRO - - -/* - * binary_function(Matrix, POD) - */ -#define TVMET_IMPLEMENT_MACRO(NAME, TP) \ -template \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME, \ - MatrixConstReference, \ - XprLiteral< TP > \ - >, \ - Rows, Cols \ -> \ -NAME(const Matrix& lhs, TP rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME, \ - MatrixConstReference, \ - XprLiteral< TP > \ - > expr_type; \ - return XprMatrix( \ - expr_type(lhs.const_ref(), XprLiteral< TP >(rhs))); \ -} - -TVMET_IMPLEMENT_MACRO(atan2, int) -TVMET_IMPLEMENT_MACRO(drem, int) -TVMET_IMPLEMENT_MACRO(fmod, int) -TVMET_IMPLEMENT_MACRO(hypot, int) -TVMET_IMPLEMENT_MACRO(jn, int) -TVMET_IMPLEMENT_MACRO(yn, int) -TVMET_IMPLEMENT_MACRO(pow, int) - -TVMET_IMPLEMENT_MACRO(atan2, float) -TVMET_IMPLEMENT_MACRO(drem, float) -TVMET_IMPLEMENT_MACRO(fmod, float) -TVMET_IMPLEMENT_MACRO(hypot, float) -TVMET_IMPLEMENT_MACRO(jn, float) -TVMET_IMPLEMENT_MACRO(yn, float) -TVMET_IMPLEMENT_MACRO(pow, float) - -TVMET_IMPLEMENT_MACRO(atan2, double) -TVMET_IMPLEMENT_MACRO(drem, double) -TVMET_IMPLEMENT_MACRO(fmod, double) -TVMET_IMPLEMENT_MACRO(hypot, double) -TVMET_IMPLEMENT_MACRO(jn, double) -TVMET_IMPLEMENT_MACRO(yn, double) -TVMET_IMPLEMENT_MACRO(pow, double) - -#undef TVMET_IMPLEMENT_MACRO - - -/* - * complex math - */ - -#if defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH1) -/** - * \fn pow(const Matrix& lhs, const std::complex& rhs) - * \ingroup _binary_function - */ -template -inline -XprMatrix< - XprBinOp< - Fcnl_pow >, - MatrixConstReference, - XprLiteral< std::complex > - >, - Rows, Cols -> -pow(const Matrix& lhs, const std::complex& rhs) { - typedef XprBinOp< - Fcnl_pow >, - MatrixConstReference, - XprLiteral< std::complex > - > expr_type; - return XprMatrix( - expr_type(lhs.const_ref(), XprLiteral< std::complex >(rhs))); -} - - -/** - * \fn pow(const Matrix, Rows, Cols>& lhs, const std::complex& rhs) - * \ingroup _binary_function - */ -template -inline -XprMatrix< - XprBinOp< - Fcnl_pow< std::complex, std::complex >, - MatrixConstReference, Rows, Cols>, - XprLiteral< std::complex > - >, - Rows, Cols -> -pow(const Matrix, Rows, Cols>& lhs, const std::complex& rhs) { - typedef XprBinOp< - Fcnl_pow< std::complex, std::complex >, - MatrixConstReference, Rows, Cols>, - XprLiteral< std::complex > - > expr_type; - return XprMatrix( - expr_type(lhs.const_ref(), XprLiteral< std::complex >(rhs))); -} - - -/** - * \fn pow(const Matrix, Rows, Cols>& lhs, const T& rhs) - * \ingroup _binary_function - */ -template -inline -XprMatrix< - XprBinOp< - Fcnl_pow, T>, - MatrixConstReference, Rows, Cols>, - XprLiteral - >, - Rows, Cols -> -pow(const Matrix, Rows, Cols>& lhs, const T& rhs) { - typedef XprBinOp< - Fcnl_pow, T>, - MatrixConstReference, Rows, Cols>, - XprLiteral - > expr_type; - return XprMatrix( - expr_type(lhs.const_ref(), XprLiteral(rhs))); -} - - -/** - * \fn pow(const Matrix, Rows, Cols>& lhs, int rhs) - * \ingroup _binary_function - */ -template -inline -XprMatrix< - XprBinOp< - Fcnl_pow, int>, - MatrixConstReference, Rows, Cols>, - XprLiteral - >, - Rows, Cols -> -pow(const Matrix, Rows, Cols>& lhs, int rhs) { - typedef XprBinOp< - Fcnl_pow, int>, - MatrixConstReference, Rows, Cols>, - XprLiteral - > expr_type; - return XprMatrix( - expr_type(lhs.const_ref(), XprLiteral(rhs))); -} - - -/** - * \fn polar(const Matrix& lhs, const T& rhs) - * \ingroup _binary_function - */ -template -inline -XprMatrix< - XprBinOp< - Fcnl_polar, - MatrixConstReference, - XprLiteral - >, - Rows, Cols -> -polar(const Matrix& lhs, const T& rhs) { - typedef XprBinOp< - Fcnl_polar, - MatrixConstReference, - XprLiteral - > expr_type; - return XprMatrix( - expr_type(lhs.const_ref(), XprLiteral(rhs))); -} - -#endif // defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH1) - -#if defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH2) -// to be written (atan2) -#endif // defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH2) - - -} // namespace tvmet - -#endif // TVMET_MATRIX_BINARY_FUNCTIONS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/MatrixEval.h b/tvmet-1.7.1/include/tvmet/MatrixEval.h index d274bf131..9acba1246 100644 --- a/tvmet-1.7.1/include/tvmet/MatrixEval.h +++ b/tvmet-1.7.1/include/tvmet/MatrixEval.h @@ -282,7 +282,7 @@ TVMET_IMPLEMENT_MACRO(double) * XprMatrix e1, std::complex z2, XprMatrix e3 * XprMatrix e1, XprMatrix e2, std::complex z3 */ -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /** * \fn eval(const XprMatrix& e, const std::complex& x2, const std::complex& x3) @@ -366,7 +366,7 @@ eval(const XprMatrix& e1, const XprMatrix& e2, c return XprMatrix( expr_type(e1, e2, XprLiteral< std::complex >(x3))); } -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) } // namespace tvmet diff --git a/tvmet-1.7.1/include/tvmet/MatrixFunctions.h b/tvmet-1.7.1/include/tvmet/MatrixFunctions.h index 4c945c89d..add1184b1 100644 --- a/tvmet-1.7.1/include/tvmet/MatrixFunctions.h +++ b/tvmet-1.7.1/include/tvmet/MatrixFunctions.h @@ -59,7 +59,7 @@ XprMatrix< \ Rows, Cols \ > \ NAME (const Matrix& lhs, \ - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const Matrix& rhs) _tvmet_always_inline; \ \ template \ XprMatrix< \ @@ -71,7 +71,7 @@ XprMatrix< \ Rows, Cols \ > \ NAME (const XprMatrix& lhs, \ - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const Matrix& rhs) _tvmet_always_inline; \ \ template \ XprMatrix< \ @@ -83,7 +83,7 @@ XprMatrix< \ Rows, Cols \ > \ NAME (const Matrix& lhs, \ - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add) // per se element wise TVMET_DECLARE_MACRO(sub) // per se element wise @@ -111,7 +111,7 @@ XprMatrix< \ Rows, Cols \ > \ NAME (const Matrix& lhs, \ - POD rhs) TVMET_CXX_ALWAYS_INLINE; \ + POD rhs) _tvmet_always_inline; \ \ template \ XprMatrix< \ @@ -123,7 +123,7 @@ XprMatrix< \ Rows, Cols \ > \ NAME (POD lhs, \ - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const Matrix& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, int) TVMET_DECLARE_MACRO(sub, int) @@ -143,7 +143,7 @@ TVMET_DECLARE_MACRO(div, double) #undef TVMET_DECLARE_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * function(Matrix, complex) * function(complex, Matrix) @@ -161,7 +161,7 @@ XprMatrix< \ Rows, Cols \ > \ NAME (const Matrix< std::complex, Rows, Cols>& lhs, \ - const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const std::complex& rhs) _tvmet_always_inline; \ \ template \ XprMatrix< \ @@ -173,7 +173,7 @@ XprMatrix< \ Rows, Cols \ > \ NAME (const std::complex& lhs, \ - const Matrix< std::complex, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE; + const Matrix< std::complex, Rows, Cols>& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add) TVMET_DECLARE_MACRO(sub) @@ -182,7 +182,7 @@ TVMET_DECLARE_MACRO(div) #undef TVMET_DECLARE_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -200,7 +200,7 @@ XprMatrix< Rows1, Cols2 // return Dim > prod(const Matrix& lhs, - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const Matrix& rhs) _tvmet_always_inline; template prod(const XprMatrix& lhs, - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const Matrix& rhs) _tvmet_always_inline; template prod(const Matrix& lhs, - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; template trans_prod(const Matrix& lhs, - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const Matrix& rhs) _tvmet_always_inline; template MtM_prod(const Matrix& lhs, - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const Matrix& rhs) _tvmet_always_inline; template MMt_prod(const Matrix& lhs, - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const Matrix& rhs) _tvmet_always_inline; /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -282,7 +282,7 @@ XprVector< Rows > prod(const Matrix& lhs, - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; + const Vector& rhs) _tvmet_always_inline; template @@ -294,7 +294,7 @@ XprVector< Rows > prod(const Matrix& lhs, - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; template @@ -306,7 +306,7 @@ XprVector< Rows > prod(const XprMatrix& lhs, - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; + const Vector& rhs) _tvmet_always_inline; template @@ -318,7 +318,7 @@ XprVector< Cols > Mtx_prod(const Matrix& lhs, - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; + const Vector& rhs) _tvmet_always_inline; /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -333,12 +333,12 @@ XprMatrix< >, Cols, Rows > -trans(const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; +trans(const Matrix& rhs) _tvmet_always_inline; template typename NumericTraits::sum_type -trace(const Matrix& m) TVMET_CXX_ALWAYS_INLINE; +trace(const Matrix& m) _tvmet_always_inline; template @@ -350,7 +350,7 @@ XprVector< Cols > row(const Matrix& m, - int no) TVMET_CXX_ALWAYS_INLINE; + int no) _tvmet_always_inline; template @@ -362,7 +362,7 @@ XprVector< Rows > col(const Matrix& m, - int no) TVMET_CXX_ALWAYS_INLINE; + int no) _tvmet_always_inline; template @@ -373,7 +373,7 @@ XprVector< >, Sz > -diag(const Matrix& m) TVMET_CXX_ALWAYS_INLINE; +diag(const Matrix& m) _tvmet_always_inline; /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -383,40 +383,40 @@ diag(const Matrix& m) TVMET_CXX_ALWAYS_INLINE; template Extremum -maximum(const XprMatrix& e); // NOT TVMET_CXX_ALWAYS_INLINE; +maximum(const XprMatrix& e); // NOT _tvmet_always_inline; template Extremum -maximum(const Matrix& m) TVMET_CXX_ALWAYS_INLINE; +maximum(const Matrix& m) _tvmet_always_inline; template Extremum -minimum(const XprMatrix& e); // NOT TVMET_CXX_ALWAYS_INLINE; +minimum(const XprMatrix& e); // NOT _tvmet_always_inline; template Extremum -minimum(const Matrix& m) TVMET_CXX_ALWAYS_INLINE; +minimum(const Matrix& m) _tvmet_always_inline; template typename E::value_type -max(const XprMatrix& e); // NOT TVMET_CXX_ALWAYS_INLINE; +max(const XprMatrix& e); // NOT _tvmet_always_inline; template -T max(const Matrix& m) TVMET_CXX_ALWAYS_INLINE; +T max(const Matrix& m) _tvmet_always_inline; template typename E::value_type -min(const XprMatrix& e); // NOT TVMET_CXX_ALWAYS_INLINE; +min(const XprMatrix& e); // NOT _tvmet_always_inline; template -T min(const Matrix& m) TVMET_CXX_ALWAYS_INLINE; +T min(const Matrix& m) _tvmet_always_inline; /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -429,7 +429,7 @@ XprMatrix< XprIdentity, Rows, Cols > -identity() TVMET_CXX_ALWAYS_INLINE; +identity() _tvmet_always_inline; template @@ -439,7 +439,7 @@ XprMatrix< M::Rows, M::Cols>, M::Rows, M::Cols > -identity() TVMET_CXX_ALWAYS_INLINE; +identity() _tvmet_always_inline; template @@ -447,7 +447,7 @@ XprMatrix< MatrixConstReference, Rows, Cols > -cmatrix_ref(const T* mem) TVMET_CXX_ALWAYS_INLINE; +cmatrix_ref(const T* mem) _tvmet_always_inline; /********************************************************* @@ -600,7 +600,7 @@ TVMET_IMPLEMENT_MACRO(div, double) #undef TVMET_IMPLEMENT_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * function(Matrix, complex) * function(complex, Matrix) @@ -657,7 +657,7 @@ TVMET_IMPLEMENT_MACRO(div) #undef TVMET_IMPLEMENT_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/tvmet-1.7.1/include/tvmet/MatrixOperators.h b/tvmet-1.7.1/include/tvmet/MatrixOperators.h index 6fd988be8..27ba6ebbb 100644 --- a/tvmet-1.7.1/include/tvmet/MatrixOperators.h +++ b/tvmet-1.7.1/include/tvmet/MatrixOperators.h @@ -34,7 +34,7 @@ namespace tvmet { template std::ostream& operator<<(std::ostream& os, - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const Matrix& rhs) _tvmet_always_inline; /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -52,12 +52,12 @@ std::ostream& operator<<(std::ostream& os, template \ Matrix& \ operator OP (Matrix& lhs, \ - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const Matrix& rhs) _tvmet_always_inline; \ \ template \ Matrix& \ operator OP (Matrix& lhs, \ - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add_eq, +=) // per se element wise TVMET_DECLARE_MACRO(sub_eq, -=) // per se element wise @@ -92,7 +92,7 @@ XprMatrix< \ Rows, Cols \ > \ operator OP (const Matrix& lhs, \ - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const Matrix& rhs) _tvmet_always_inline; \ \ template \ XprMatrix< \ @@ -104,7 +104,7 @@ XprMatrix< \ Rows, Cols \ > \ operator OP (const XprMatrix& lhs, \ - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const Matrix& rhs) _tvmet_always_inline; \ \ template \ XprMatrix< \ @@ -116,7 +116,7 @@ XprMatrix< \ Rows, Cols \ > \ operator OP (const Matrix& lhs, \ - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, +) // per se element wise TVMET_DECLARE_MACRO(sub, -) // per se element wise @@ -143,7 +143,7 @@ XprMatrix< \ Rows, Cols \ > \ operator OP (const Matrix& lhs, \ - POD rhs) TVMET_CXX_ALWAYS_INLINE; \ + POD rhs) _tvmet_always_inline; \ \ template \ XprMatrix< \ @@ -155,7 +155,7 @@ XprMatrix< \ Rows, Cols \ > \ operator OP (POD lhs, \ - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const Matrix& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, +, int) TVMET_DECLARE_MACRO(sub, -, int) @@ -175,7 +175,7 @@ TVMET_DECLARE_MACRO(div, /, double) #undef TVMET_DECLARE_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * operator(Matrix, complex) * operator(complex, Matrix) @@ -193,7 +193,7 @@ XprMatrix< \ Rows, Cols \ > \ operator OP (const Matrix< std::complex, Rows, Cols>& lhs, \ - const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const std::complex& rhs) _tvmet_always_inline; \ \ template \ XprMatrix< \ @@ -205,7 +205,7 @@ XprMatrix< \ Rows, Cols \ > \ operator OP (const std::complex& lhs, \ - const Matrix< std::complex, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE; + const Matrix< std::complex, Rows, Cols>& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, +) TVMET_DECLARE_MACRO(sub, -) @@ -214,7 +214,7 @@ TVMET_DECLARE_MACRO(div, /) #undef TVMET_DECLARE_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -232,7 +232,7 @@ XprMatrix< Rows1, Cols2 > operator*(const Matrix& lhs, - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const Matrix& rhs) _tvmet_always_inline; template operator*(const XprMatrix& lhs, - const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const Matrix& rhs) _tvmet_always_inline; template operator*(const Matrix& lhs, - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -275,7 +275,7 @@ XprVector< Rows > operator*(const Matrix& lhs, - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; + const Vector& rhs) _tvmet_always_inline; template @@ -287,7 +287,7 @@ XprVector< Rows > operator*(const Matrix& lhs, - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; template @@ -299,7 +299,7 @@ XprVector< Rows > operator*(const XprMatrix& lhs, - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; + const Vector& rhs) _tvmet_always_inline; /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -320,7 +320,7 @@ XprMatrix< \ >, \ Rows, Cols \ > \ -operator OP (const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; +operator OP (const Matrix& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(neg, -) #undef TVMET_DECLARE_MACRO @@ -495,7 +495,7 @@ TVMET_IMPLEMENT_MACRO(div, /, double) #undef TVMET_IMPLEMENT_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * operator(Matrix, complex) * operator(complex, Matrix) @@ -540,7 +540,7 @@ TVMET_IMPLEMENT_MACRO(div, /) #undef TVMET_IMPLEMENT_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/tvmet-1.7.1/include/tvmet/MatrixUnaryFunctions.h b/tvmet-1.7.1/include/tvmet/MatrixUnaryFunctions.h index 39c3e92bc..30e7f9c35 100644 --- a/tvmet-1.7.1/include/tvmet/MatrixUnaryFunctions.h +++ b/tvmet-1.7.1/include/tvmet/MatrixUnaryFunctions.h @@ -29,7 +29,7 @@ namespace tvmet { /* * unary_function(Matrix, Rows, Cols>) */ -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) #define TVMET_DECLARE_MACRO(NAME) \ template \ inline \ @@ -40,7 +40,7 @@ XprMatrix< \ >, \ Rows, Cols \ > \ -NAME(const Matrix, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE; +NAME(const Matrix, Rows, Cols>& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(real) TVMET_DECLARE_MACRO(imag) @@ -48,12 +48,12 @@ TVMET_DECLARE_MACRO(conj) #undef TVMET_DECLARE_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /* * unary_function(Matrix, Rows, Cols>) */ -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) #define TVMET_IMPLEMENT_MACRO(NAME) \ template \ inline \ @@ -78,7 +78,7 @@ TVMET_IMPLEMENT_MACRO(conj) #undef TVMET_IMPLEMENT_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) } // namespace tvmet diff --git a/tvmet-1.7.1/include/tvmet/NumericTraits.h b/tvmet-1.7.1/include/tvmet/NumericTraits.h index cb3b9469e..4c3d6a277 100644 --- a/tvmet-1.7.1/include/tvmet/NumericTraits.h +++ b/tvmet-1.7.1/include/tvmet/NumericTraits.h @@ -24,7 +24,7 @@ #ifndef TVMET_NUMERIC_TRAITS_H #define TVMET_NUMERIC_TRAITS_H -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) # include #endif #include @@ -352,7 +352,7 @@ struct NumericTraits { /* * numeric traits for complex types */ -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /** * \class NumericTraits< std::complex > NumericTraits.h "tvmet/NumericTraits.h" @@ -577,7 +577,7 @@ struct NumericTraits< std::complex > { }; -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) } // namespace tvmet diff --git a/tvmet-1.7.1/include/tvmet/TypePromotion.h b/tvmet-1.7.1/include/tvmet/TypePromotion.h index 06c6b4ee7..3bed8bf76 100644 --- a/tvmet-1.7.1/include/tvmet/TypePromotion.h +++ b/tvmet-1.7.1/include/tvmet/TypePromotion.h @@ -67,11 +67,11 @@ TVMET_PRECISION(double, 800) /* * complex types */ -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) TVMET_PRECISION(std::complex, 1000) TVMET_PRECISION(std::complex, 1600) TVMET_PRECISION(std::complex, 1700) -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /** \class PrecisionTraits TypePromotion.h "tvmet/TypePromotion.h" */ diff --git a/tvmet-1.7.1/include/tvmet/UnaryFunctionals.h b/tvmet-1.7.1/include/tvmet/UnaryFunctionals.h index 4772cc34a..3ba35f2e3 100644 --- a/tvmet-1.7.1/include/tvmet/UnaryFunctionals.h +++ b/tvmet-1.7.1/include/tvmet/UnaryFunctionals.h @@ -54,7 +54,7 @@ TVMET_IMPLEMENT_MACRO(neg, -) */ -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /** * \class Fcnl_conj< std::complex > UnaryFunctionals.h "tvmet/UnaryFunctionals.h" @@ -108,7 +108,7 @@ TVMET_IMPLEMENT_MACRO(imag) #undef TVMET_IMPLEMENT_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) } // namespace tvmet diff --git a/tvmet-1.7.1/include/tvmet/Vector.h b/tvmet-1.7.1/include/tvmet/Vector.h index 285dfaba2..bfe4da69d 100644 --- a/tvmet-1.7.1/include/tvmet/Vector.h +++ b/tvmet-1.7.1/include/tvmet/Vector.h @@ -413,56 +413,56 @@ private: public: // math operators with scalars // NOTE: this meaning is clear - element wise ops even if not in ns element_wise - Vector& operator+=(value_type) TVMET_CXX_ALWAYS_INLINE; - Vector& operator-=(value_type) TVMET_CXX_ALWAYS_INLINE; - Vector& operator*=(value_type) TVMET_CXX_ALWAYS_INLINE; - Vector& operator/=(value_type) TVMET_CXX_ALWAYS_INLINE; + Vector& operator+=(value_type) _tvmet_always_inline; + Vector& operator-=(value_type) _tvmet_always_inline; + Vector& operator*=(value_type) _tvmet_always_inline; + Vector& operator/=(value_type) _tvmet_always_inline; - Vector& operator%=(int) TVMET_CXX_ALWAYS_INLINE; - Vector& operator^=(int) TVMET_CXX_ALWAYS_INLINE; - Vector& operator&=(int) TVMET_CXX_ALWAYS_INLINE; - Vector& operator|=(int) TVMET_CXX_ALWAYS_INLINE; - Vector& operator<<=(int) TVMET_CXX_ALWAYS_INLINE; - Vector& operator>>=(int) TVMET_CXX_ALWAYS_INLINE; + Vector& operator%=(int) _tvmet_always_inline; + Vector& operator^=(int) _tvmet_always_inline; + Vector& operator&=(int) _tvmet_always_inline; + Vector& operator|=(int) _tvmet_always_inline; + Vector& operator<<=(int) _tvmet_always_inline; + Vector& operator>>=(int) _tvmet_always_inline; public: // math assign operators with vectors // NOTE: access using the operators in ns element_wise, since that's what is does - template Vector& M_add_eq(const Vector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_sub_eq(const Vector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_mul_eq(const Vector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_div_eq(const Vector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_mod_eq(const Vector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_xor_eq(const Vector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_and_eq(const Vector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_or_eq (const Vector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_shl_eq(const Vector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_shr_eq(const Vector&) TVMET_CXX_ALWAYS_INLINE; + template Vector& M_add_eq(const Vector&) _tvmet_always_inline; + template Vector& M_sub_eq(const Vector&) _tvmet_always_inline; + template Vector& M_mul_eq(const Vector&) _tvmet_always_inline; + template Vector& M_div_eq(const Vector&) _tvmet_always_inline; + template Vector& M_mod_eq(const Vector&) _tvmet_always_inline; + template Vector& M_xor_eq(const Vector&) _tvmet_always_inline; + template Vector& M_and_eq(const Vector&) _tvmet_always_inline; + template Vector& M_or_eq (const Vector&) _tvmet_always_inline; + template Vector& M_shl_eq(const Vector&) _tvmet_always_inline; + template Vector& M_shr_eq(const Vector&) _tvmet_always_inline; public: // math operators with expressions // NOTE: access using the operators in ns element_wise, since that's what is does - template Vector& M_add_eq(const XprVector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_sub_eq(const XprVector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_mul_eq(const XprVector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_div_eq(const XprVector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_mod_eq(const XprVector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_xor_eq(const XprVector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_and_eq(const XprVector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_or_eq (const XprVector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_shl_eq(const XprVector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& M_shr_eq(const XprVector&) TVMET_CXX_ALWAYS_INLINE; + template Vector& M_add_eq(const XprVector&) _tvmet_always_inline; + template Vector& M_sub_eq(const XprVector&) _tvmet_always_inline; + template Vector& M_mul_eq(const XprVector&) _tvmet_always_inline; + template Vector& M_div_eq(const XprVector&) _tvmet_always_inline; + template Vector& M_mod_eq(const XprVector&) _tvmet_always_inline; + template Vector& M_xor_eq(const XprVector&) _tvmet_always_inline; + template Vector& M_and_eq(const XprVector&) _tvmet_always_inline; + template Vector& M_or_eq (const XprVector&) _tvmet_always_inline; + template Vector& M_shl_eq(const XprVector&) _tvmet_always_inline; + template Vector& M_shr_eq(const XprVector&) _tvmet_always_inline; public: // aliased math operators with expressions, used with proxy - template Vector& alias_assign(const Vector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& alias_add_eq(const Vector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& alias_sub_eq(const Vector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& alias_mul_eq(const Vector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& alias_div_eq(const Vector&) TVMET_CXX_ALWAYS_INLINE; + template Vector& alias_assign(const Vector&) _tvmet_always_inline; + template Vector& alias_add_eq(const Vector&) _tvmet_always_inline; + template Vector& alias_sub_eq(const Vector&) _tvmet_always_inline; + template Vector& alias_mul_eq(const Vector&) _tvmet_always_inline; + template Vector& alias_div_eq(const Vector&) _tvmet_always_inline; - template Vector& alias_assign(const XprVector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& alias_add_eq(const XprVector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& alias_sub_eq(const XprVector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& alias_mul_eq(const XprVector&) TVMET_CXX_ALWAYS_INLINE; - template Vector& alias_div_eq(const XprVector&) TVMET_CXX_ALWAYS_INLINE; + template Vector& alias_assign(const XprVector&) _tvmet_always_inline; + template Vector& alias_add_eq(const XprVector&) _tvmet_always_inline; + template Vector& alias_sub_eq(const XprVector&) _tvmet_always_inline; + template Vector& alias_mul_eq(const XprVector&) _tvmet_always_inline; + template Vector& alias_div_eq(const XprVector&) _tvmet_always_inline; public: // io /** Structure for info printing as Vector. */ @@ -503,7 +503,6 @@ typedef Vector Vector4d; #include #include -#include #include #include #include diff --git a/tvmet-1.7.1/include/tvmet/VectorBinaryFunctions.h b/tvmet-1.7.1/include/tvmet/VectorBinaryFunctions.h deleted file mode 100644 index 8423e6cd5..000000000 --- a/tvmet-1.7.1/include/tvmet/VectorBinaryFunctions.h +++ /dev/null @@ -1,490 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: VectorBinaryFunctions.h,v 1.13 2005/04/26 15:05:06 opetzold Exp $ - */ - -#ifndef TVMET_VECTOR_BINARY_FUNCTIONS_H -#define TVMET_VECTOR_BINARY_FUNCTIONS_H - -#include -#include - -namespace tvmet { - - -/********************************************************* - * PART I: DECLARATION - *********************************************************/ - -/* - * binary_function(Vector, Vector) - * binary_function(Vector, XprVector) - * binary_function(XprVector, Vector) - */ -#define TVMET_DECLARE_MACRO(NAME) \ -template \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME, \ - VectorConstReference, \ - VectorConstReference \ - >, \ - Sz \ -> \ -NAME(const Vector& lhs, \ - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ - \ -template \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME, \ - VectorConstReference, \ - XprVector \ - >, \ - Sz \ -> \ -NAME(const XprVector& lhs, \ - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ - \ -template \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME, \ - VectorConstReference, \ - XprVector \ - >, \ - Sz \ -> \ -NAME(const Vector& lhs, \ - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; - -TVMET_DECLARE_MACRO(atan2) -TVMET_DECLARE_MACRO(drem) -TVMET_DECLARE_MACRO(fmod) -TVMET_DECLARE_MACRO(hypot) -TVMET_DECLARE_MACRO(jn) -TVMET_DECLARE_MACRO(yn) -TVMET_DECLARE_MACRO(pow) -#if defined(TVMET_HAVE_COMPLEX) -TVMET_DECLARE_MACRO(polar) -#endif - -#undef TVMET_DECLARE_MACRO - - -/* - * binary_function(Vector, POD) - */ -#define TVMET_DECLARE_MACRO(NAME, TP) \ -template \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME, \ - VectorConstReference, \ - XprLiteral< TP > \ - >, \ - Sz \ -> \ -NAME(const Vector& lhs, TP rhs) TVMET_CXX_ALWAYS_INLINE; - -TVMET_DECLARE_MACRO(atan2, int) -TVMET_DECLARE_MACRO(drem, int) -TVMET_DECLARE_MACRO(fmod, int) -TVMET_DECLARE_MACRO(hypot, int) -TVMET_DECLARE_MACRO(jn, int) -TVMET_DECLARE_MACRO(yn, int) -TVMET_DECLARE_MACRO(pow, int) - -TVMET_DECLARE_MACRO(atan2, float) -TVMET_DECLARE_MACRO(drem, float) -TVMET_DECLARE_MACRO(fmod, float) -TVMET_DECLARE_MACRO(hypot, float) -TVMET_DECLARE_MACRO(jn, float) -TVMET_DECLARE_MACRO(yn, float) -TVMET_DECLARE_MACRO(pow, float) - -TVMET_DECLARE_MACRO(atan2, double) -TVMET_DECLARE_MACRO(drem, double) -TVMET_DECLARE_MACRO(fmod, double) -TVMET_DECLARE_MACRO(hypot, double) -TVMET_DECLARE_MACRO(jn, double) -TVMET_DECLARE_MACRO(yn, double) -TVMET_DECLARE_MACRO(pow, double) - -#undef TVMET_DECLARE_MACRO - - -/* - * complex support - */ - -#if defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH1) -template -XprVector< - XprBinOp< - Fcnl_pow >, - VectorConstReference, - XprLiteral< std::complex > - >, - Sz -> -pow(const Vector& lhs, - const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; - - -template -XprVector< - XprBinOp< - Fcnl_pow, std::complex >, - VectorConstReference, Sz>, - XprLiteral< std::complex > - >, - Sz -> -pow(const Vector, Sz>& lhs, - const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; - - -template -XprVector< - XprBinOp< - Fcnl_pow, T>, - VectorConstReference, Sz>, - XprLiteral - >, - Sz -> -pow(const Vector, Sz>& lhs, - const T& rhs) TVMET_CXX_ALWAYS_INLINE; - - -template -XprVector< - XprBinOp< - Fcnl_pow, int>, - VectorConstReference, Sz>, - XprLiteral - >, - Sz -> -pow(const Vector, Sz>& lhs, - int rhs) TVMET_CXX_ALWAYS_INLINE; - - -template -XprVector< - XprBinOp< - Fcnl_polar, - VectorConstReference, - XprLiteral - >, - Sz -> -polar(const Vector& lhs, const T& rhs) TVMET_CXX_ALWAYS_INLINE; - -#endif // defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH1) - -#if defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH2) -// to be written (atan2) -#endif // defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH2) - - -/********************************************************* - * PART II: IMPLEMENTATION - *********************************************************/ - -/* - * binary_function(Vector, Vector) - * binary_function(Vector, XprVector) - * binary_function(XprVector, Vector) - */ -#define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME, \ - VectorConstReference, \ - VectorConstReference \ - >, \ - Sz \ -> \ -NAME(const Vector& lhs, const Vector& rhs) { \ - typedef XprBinOp < \ - Fcnl_##NAME, \ - VectorConstReference, \ - VectorConstReference \ - > expr_type; \ - return XprVector( \ - expr_type(lhs.const_ref(), rhs.const_ref())); \ -} \ - \ -template \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME, \ - VectorConstReference, \ - XprVector \ - >, \ - Sz \ -> \ -NAME(const XprVector& lhs, const Vector& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME, \ - XprVector, \ - VectorConstReference \ - > expr_type; \ - return XprVector( \ - expr_type(lhs, rhs.const_ref())); \ -} \ - \ -template \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME, \ - VectorConstReference, \ - XprVector \ - >, \ - Sz \ -> \ -NAME(const Vector& lhs, const XprVector& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME, \ - VectorConstReference, \ - XprVector \ - > expr_type; \ - return XprVector( \ - expr_type(lhs.const_ref(), rhs)); \ -} - -TVMET_IMPLEMENT_MACRO(atan2) -TVMET_IMPLEMENT_MACRO(drem) -TVMET_IMPLEMENT_MACRO(fmod) -TVMET_IMPLEMENT_MACRO(hypot) -TVMET_IMPLEMENT_MACRO(jn) -TVMET_IMPLEMENT_MACRO(yn) -TVMET_IMPLEMENT_MACRO(pow) -#if defined(TVMET_HAVE_COMPLEX) -TVMET_IMPLEMENT_MACRO(polar) -#endif - -#undef TVMET_IMPLEMENT_MACRO - - -/* - * binary_function(Vector, POD) - */ -#define TVMET_IMPLEMENT_MACRO(NAME, TP) \ -template \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME, \ - VectorConstReference, \ - XprLiteral< TP > \ - >, \ - Sz \ -> \ -NAME(const Vector& lhs, TP rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME, \ - VectorConstReference, \ - XprLiteral< TP > \ - > expr_type; \ - return XprVector( \ - expr_type(lhs.const_ref(), XprLiteral< TP >(rhs))); \ -} - -TVMET_IMPLEMENT_MACRO(atan2, int) -TVMET_IMPLEMENT_MACRO(drem, int) -TVMET_IMPLEMENT_MACRO(fmod, int) -TVMET_IMPLEMENT_MACRO(hypot, int) -TVMET_IMPLEMENT_MACRO(jn, int) -TVMET_IMPLEMENT_MACRO(yn, int) -TVMET_IMPLEMENT_MACRO(pow, int) - -TVMET_IMPLEMENT_MACRO(atan2, float) -TVMET_IMPLEMENT_MACRO(drem, float) -TVMET_IMPLEMENT_MACRO(fmod, float) -TVMET_IMPLEMENT_MACRO(hypot, float) -TVMET_IMPLEMENT_MACRO(jn, float) -TVMET_IMPLEMENT_MACRO(yn, float) -TVMET_IMPLEMENT_MACRO(pow, float) - -TVMET_IMPLEMENT_MACRO(atan2, double) -TVMET_IMPLEMENT_MACRO(drem, double) -TVMET_IMPLEMENT_MACRO(fmod, double) -TVMET_IMPLEMENT_MACRO(hypot, double) -TVMET_IMPLEMENT_MACRO(jn, double) -TVMET_IMPLEMENT_MACRO(yn, double) -TVMET_IMPLEMENT_MACRO(pow, double) - -#undef TVMET_IMPLEMENT_MACRO - - -/* - * complex support - */ - -#if defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH1) -/** - * \fn pow(const Vector& lhs, const std::complex& rhs) - * \ingroup _binary_function - */ -template -inline -XprVector< - XprBinOp< - Fcnl_pow >, - VectorConstReference, - XprLiteral< std::complex > - >, - Sz -> -pow(const Vector& lhs, const std::complex& rhs) { - typedef XprBinOp< - Fcnl_pow >, - VectorConstReference, - XprLiteral< std::complex > - > expr_type; - return XprVector( - expr_type(lhs.const_ref(), XprLiteral< std::complex >(rhs))); -} - - -/** - * \fn pow(const Vector, Sz>& lhs, const std::complex& rhs) - * \ingroup _binary_function - */ -template -inline -XprVector< - XprBinOp< - Fcnl_pow, std::complex >, - VectorConstReference, Sz>, - XprLiteral< std::complex > - >, - Sz -> -pow(const Vector, Sz>& lhs, const std::complex& rhs) { - typedef XprBinOp< - Fcnl_pow, std::complex >, - VectorConstReference, Sz>, - XprLiteral< std::complex > - > expr_type; - return XprVector( - expr_type(lhs.const_ref(), XprLiteral< std::complex >(rhs))); -} - - -/** - * \fn pow(const Vector, Sz>& lhs, const T& rhs) - * \ingroup _binary_function - */ -template -inline -XprVector< - XprBinOp< - Fcnl_pow, T>, - VectorConstReference, Sz>, - XprLiteral - >, - Sz -> -pow(const Vector, Sz>& lhs, const T& rhs) { - typedef XprBinOp< - Fcnl_pow, T>, - VectorConstReference, Sz>, - XprLiteral - > expr_type; - return XprVector( - expr_type(lhs.const_ref(), XprLiteral(rhs))); -} - - -/** - * \fn pow(const Vector, Sz>& lhs, int rhs) - * \ingroup _binary_function - */ -template -inline -XprVector< - XprBinOp< - Fcnl_pow, int>, - VectorConstReference, Sz>, - XprLiteral - >, - Sz -> -pow(const Vector, Sz>& lhs, int rhs) { - typedef XprBinOp< - Fcnl_pow, int>, - VectorConstReference, Sz>, - XprLiteral - > expr_type; - return XprVector( - expr_type(lhs.const_ref(), XprLiteral(rhs))); -} - - -/** - * \fn polar(const Vector& lhs, const T& rhs) - * \ingroup _binary_function - */ -template -inline -XprVector< - XprBinOp< - Fcnl_polar, - VectorConstReference, - XprLiteral - >, - Sz -> -polar(const Vector& lhs, const T& rhs) { - typedef XprBinOp< - Fcnl_polar, - VectorConstReference, - XprLiteral - > expr_type; - return XprVector( - expr_type(lhs.const_ref(), XprLiteral(rhs))); -} -#endif // defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH1) - -#if defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH2) -// to be written (atan2) -#endif // defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH2) - - -} // namespace tvmet - -#endif // TVMET_VECTOR_BINARY_FUNCTIONS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/VectorEval.h b/tvmet-1.7.1/include/tvmet/VectorEval.h index 13b7d1a0c..6a851db7d 100644 --- a/tvmet-1.7.1/include/tvmet/VectorEval.h +++ b/tvmet-1.7.1/include/tvmet/VectorEval.h @@ -278,7 +278,7 @@ TVMET_IMPLEMENT_MACRO(double) * XprVector e1, std::complex z2, XprVector e3 * XprVector e1, XprVector e2, std::complex z3 */ -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /** @@ -361,7 +361,7 @@ eval(const XprVector& e1, const XprVector& e2, std::complex z return XprVector( expr_type(e1, e2, XprLiteral< std::complex >(z3))); } -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) } // namespace tvmet diff --git a/tvmet-1.7.1/include/tvmet/VectorFunctions.h b/tvmet-1.7.1/include/tvmet/VectorFunctions.h index c7ccd4da5..65174a7a0 100644 --- a/tvmet-1.7.1/include/tvmet/VectorFunctions.h +++ b/tvmet-1.7.1/include/tvmet/VectorFunctions.h @@ -55,7 +55,7 @@ XprVector< \ Sz \ > \ NAME (const Vector& lhs, \ - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const Vector& rhs) _tvmet_always_inline; \ \ template \ XprVector< \ @@ -67,7 +67,7 @@ XprVector< \ Sz \ > \ NAME (const XprVector& lhs, \ - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const Vector& rhs) _tvmet_always_inline; \ \ template \ XprVector< \ @@ -79,7 +79,7 @@ XprVector< \ Sz \ > \ NAME (const Vector& lhs, \ - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add) // per se element wise TVMET_DECLARE_MACRO(sub) // per se element wise @@ -107,7 +107,7 @@ XprVector< \ Sz \ > \ NAME (const Vector& lhs, \ - POD rhs) TVMET_CXX_ALWAYS_INLINE; \ + POD rhs) _tvmet_always_inline; \ \ template \ XprVector< \ @@ -119,7 +119,7 @@ XprVector< \ Sz \ > \ NAME (POD lhs, \ - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; + const Vector& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, int) TVMET_DECLARE_MACRO(sub, int) @@ -139,7 +139,7 @@ TVMET_DECLARE_MACRO(div, double) #undef TVMET_DECLARE_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * function(Vector, Sz>, std::complex) * function(std::complex, Vector, Sz>) @@ -157,7 +157,7 @@ XprVector< \ Sz \ > \ NAME (const Vector, Sz>& lhs, \ - const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const std::complex& rhs) _tvmet_always_inline; \ \ template \ XprVector< \ @@ -169,7 +169,7 @@ XprVector< \ Sz \ > \ NAME (const std::complex& lhs, \ - const Vector< std::complex, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE; + const Vector< std::complex, Sz>& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add) TVMET_DECLARE_MACRO(sub) @@ -178,7 +178,7 @@ TVMET_DECLARE_MACRO(div) #undef TVMET_DECLARE_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -188,34 +188,34 @@ TVMET_DECLARE_MACRO(div) template typename NumericTraits::sum_type -sum(const Vector& v) TVMET_CXX_ALWAYS_INLINE; +sum(const Vector& v) _tvmet_always_inline; template typename NumericTraits::sum_type -product(const Vector& v) TVMET_CXX_ALWAYS_INLINE; +product(const Vector& v) _tvmet_always_inline; template typename PromoteTraits::value_type dot(const Vector& lhs, - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; + const Vector& rhs) _tvmet_always_inline; template Vector::value_type, 3> cross(const Vector& lhs, - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; + const Vector& rhs) _tvmet_always_inline; template typename NumericTraits::sum_type -norm1(const Vector& v) TVMET_CXX_ALWAYS_INLINE; +norm1(const Vector& v) _tvmet_always_inline; template typename NumericTraits::sum_type -norm2(const Vector& v) TVMET_CXX_ALWAYS_INLINE; +norm2(const Vector& v) _tvmet_always_inline; template @@ -227,7 +227,7 @@ XprVector< >, Sz > -normalize(const Vector& v) TVMET_CXX_ALWAYS_INLINE; +normalize(const Vector& v) _tvmet_always_inline; /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -236,40 +236,40 @@ normalize(const Vector& v) TVMET_CXX_ALWAYS_INLINE; template Extremum -maximum(const XprVector& e); // NOT TVMET_CXX_ALWAYS_INLINE; +maximum(const XprVector& e); // NOT _tvmet_always_inline; template Extremum -maximum(const Vector& v) TVMET_CXX_ALWAYS_INLINE; +maximum(const Vector& v) _tvmet_always_inline; template Extremum -minimum(const XprVector& e); // NOT TVMET_CXX_ALWAYS_INLINE; +minimum(const XprVector& e); // NOT _tvmet_always_inline; template Extremum -minimum(const Vector& v) TVMET_CXX_ALWAYS_INLINE; +minimum(const Vector& v) _tvmet_always_inline; template typename E::value_type -max(const XprVector& e); // NOT TVMET_CXX_ALWAYS_INLINE; +max(const XprVector& e); // NOT _tvmet_always_inline; template -T max(const Vector& v) TVMET_CXX_ALWAYS_INLINE; +T max(const Vector& v) _tvmet_always_inline; template typename E::value_type -min(const XprVector& e); // NOT TVMET_CXX_ALWAYS_INLINE; +min(const XprVector& e); // NOT _tvmet_always_inline; template -T min(const Vector& v) TVMET_CXX_ALWAYS_INLINE; +T min(const Vector& v) _tvmet_always_inline; template @@ -277,7 +277,7 @@ XprVector< VectorConstReference, Sz > -cvector_ref(const T* mem) TVMET_CXX_ALWAYS_INLINE; +cvector_ref(const T* mem) _tvmet_always_inline; /********************************************************* @@ -430,7 +430,7 @@ TVMET_IMPLEMENT_MACRO(div, double) #undef TVMET_IMPLEMENT_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * function(Vector, Sz>, std::complex) * function(std::complex, Vector, Sz>) @@ -485,7 +485,7 @@ TVMET_IMPLEMENT_MACRO(div) #undef TVMET_IMPLEMENT_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/tvmet-1.7.1/include/tvmet/VectorOperators.h b/tvmet-1.7.1/include/tvmet/VectorOperators.h index 68cb04a05..04e6d89b5 100644 --- a/tvmet-1.7.1/include/tvmet/VectorOperators.h +++ b/tvmet-1.7.1/include/tvmet/VectorOperators.h @@ -35,7 +35,7 @@ namespace tvmet { template inline std::ostream& operator<<(std::ostream& os, - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; + const Vector& rhs) _tvmet_always_inline; /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -52,12 +52,12 @@ std::ostream& operator<<(std::ostream& os, template \ Vector& \ operator OP (Vector& lhs, \ - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const Vector& rhs) _tvmet_always_inline; \ \ template \ Vector& \ operator OP (Vector& lhs, \ - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add_eq, +=) // per se element wise TVMET_DECLARE_MACRO(sub_eq, -=) // per se element wise @@ -91,7 +91,7 @@ XprVector< \ Sz \ > \ operator OP (const Vector& lhs, \ - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const Vector& rhs) _tvmet_always_inline; \ \ template \ XprVector< \ @@ -103,7 +103,7 @@ XprVector< \ Sz \ > \ operator OP (const XprVector& lhs, \ - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const Vector& rhs) _tvmet_always_inline; \ \ template \ XprVector< \ @@ -115,7 +115,7 @@ XprVector< \ Sz \ > \ operator OP (const Vector& lhs, \ - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, +) // per se element wise TVMET_DECLARE_MACRO(sub, -) // per se element wise @@ -143,7 +143,7 @@ XprVector< \ Sz \ > \ operator OP (const Vector& lhs, \ - POD rhs) TVMET_CXX_ALWAYS_INLINE; \ + POD rhs) _tvmet_always_inline; \ \ template \ XprVector< \ @@ -155,7 +155,7 @@ XprVector< \ Sz \ > \ operator OP (POD lhs, \ - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; + const Vector& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, +, int) TVMET_DECLARE_MACRO(sub, -, int) @@ -175,7 +175,7 @@ TVMET_DECLARE_MACRO(div, /, double) #undef TVMET_DECLARE_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * operator(Vector, Sz>, std::complex) * operator(std::complex, Vector, Sz>) @@ -193,7 +193,7 @@ XprVector< \ Sz \ > \ operator OP (const Vector, Sz>& lhs, \ - const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const std::complex& rhs) _tvmet_always_inline; \ \ template \ XprVector< \ @@ -205,7 +205,7 @@ XprVector< \ Sz \ > \ operator OP (const std::complex& lhs, \ - const Vector< std::complex, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE; + const Vector< std::complex, Sz>& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, +) // per se element wise TVMET_DECLARE_MACRO(sub, -) // per se element wise @@ -213,7 +213,7 @@ TVMET_DECLARE_MACRO(mul, *) // per se element wise TVMET_DECLARE_MACRO(div, /) // per se element wise #undef TVMET_DECLARE_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) @@ -235,7 +235,7 @@ XprVector< \ >, \ Sz \ > \ -operator OP (const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; +operator OP (const Vector& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(neg, -) #undef TVMET_DECLARE_MACRO @@ -407,7 +407,7 @@ TVMET_IMPLEMENT_MACRO(div, /, double) #undef TVMET_IMPLEMENT_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * operator(Vector, Sz>, std::complex) * operator(std::complex, Vector, Sz>) @@ -452,7 +452,7 @@ TVMET_IMPLEMENT_MACRO(div, /) // per se element wise #undef TVMET_IMPLEMENT_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/tvmet-1.7.1/include/tvmet/VectorUnaryFunctions.h b/tvmet-1.7.1/include/tvmet/VectorUnaryFunctions.h index 6cb7bdddf..9099a21e4 100644 --- a/tvmet-1.7.1/include/tvmet/VectorUnaryFunctions.h +++ b/tvmet-1.7.1/include/tvmet/VectorUnaryFunctions.h @@ -34,7 +34,7 @@ namespace tvmet { /* * unary_function(Vector, Sz>) */ -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) #define TVMET_DECLARE_MACRO(NAME) \ template \ XprVector< \ @@ -44,7 +44,7 @@ XprVector< \ >, \ Sz \ > \ -NAME(const Vector, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE; +NAME(const Vector, Sz>& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(real) TVMET_DECLARE_MACRO(imag) @@ -52,7 +52,7 @@ TVMET_DECLARE_MACRO(conj) #undef TVMET_DECLARE_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /********************************************************* @@ -63,7 +63,7 @@ TVMET_DECLARE_MACRO(conj) /* * unary_function(Vector, Sz>) */ -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) #define TVMET_IMPLEMENT_MACRO(NAME) \ template \ inline \ @@ -88,7 +88,7 @@ TVMET_IMPLEMENT_MACRO(conj) #undef TVMET_IMPLEMENT_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) } // namespace tvmet diff --git a/tvmet-1.7.1/include/tvmet/config.h.cmake b/tvmet-1.7.1/include/tvmet/config.h.cmake index c378119db..707370c45 100644 --- a/tvmet-1.7.1/include/tvmet/config.h.cmake +++ b/tvmet-1.7.1/include/tvmet/config.h.cmake @@ -1,21 +1,6 @@ #ifndef _INCLUDE_TVMET_CONFIG_H #define _INCLUDE_TVMET_CONFIG_H -/* define if the compiler has complex */ -#cmakedefine TVMET_HAVE_COMPLEX - -/* define if the compiler has complex math functions */ -#cmakedefine TVMET_HAVE_COMPLEX_MATH1 - -/* define if the compiler has more complex math functions */ -#cmakedefine TVMET_HAVE_COMPLEX_MATH2 - -/* Define if the compiler supports IEEE math library */ -#cmakedefine TVMET_HAVE_IEEE_MATH - -/* Define if the compiler supports SYSV math library */ -#cmakedefine TVMET_HAVE_SYSV_MATH - /* Define to 1 if you have the header file. */ #cmakedefine TVMET_HAVE_SYS_TIME_H 1 diff --git a/tvmet-1.7.1/include/tvmet/tvmet.h b/tvmet-1.7.1/include/tvmet/tvmet.h index 7e7269a13..9af49498a 100644 --- a/tvmet-1.7.1/include/tvmet/tvmet.h +++ b/tvmet-1.7.1/include/tvmet/tvmet.h @@ -32,23 +32,6 @@ // in src/corelib/global/qglobal.h #define TVMET_UNUSED(x) (void)x -/* - * other compiler specific stuff - */ - -/** - * \def TVMET_CXX_ALWAYS_INLINE - * \brief Compiler specific stuff to force inline code if supported. - * - * Mainly, this declares the functions using g++'s - * __attribute__((always_inline)). This features is enabled - * on defined TVMET_OPTIMIZE. - */ -#if !defined(TVMET_CXX_ALWAYS_INLINE) -#define TVMET_CXX_ALWAYS_INLINE -#endif - - /* * Complexity triggers, compiler and architecture specific. * If not defined, use defaults. @@ -98,53 +81,10 @@ # define TVMET_COMPLEXITY_MV_TRIGGER 8*8 #endif - -/*********************************************************************** - * other specials - ***********************************************************************/ -#if defined(TVMET_HAVE_IEEE_MATH) -# define _ALL_SOURCE -# if !defined(_XOPEN_SOURCE) -# define _XOPEN_SOURCE -# endif -# if !defined(_XOPEN_SOURCE_EXTENDED) -# define _XOPEN_SOURCE_EXTENDED -# endif -#endif - - -/** - * \def TVMET_DEBUG - * This is defined if DEBUG is defined. This enables runtime error - * bounds checking. If you compile %tvmet from another source directory - * which defines DEBUG, then TVMET_DEBUG will be - * not defined (This behavior differs from release less than 0.6.0). - */ - - -/** - * \def TVMET_OPTIMIZE - * If this is defined tvmet uses some compiler specific keywords. - * Mainly, this declares the functions using gcc's - * __attribute__((always_inline)). This allows the - * compiler to produce high efficient code even on less - * optimization levels, like gcc's -O2 or even -O! - * This is known to work with gcc v3.3.3 (and higher). - * Using icc's v8 gnuc compatibility mode this may work, I've read - * that it's using as an hint, this means you can have static inline - * functions inside left. - */ -#if !defined(TVMET_OPTIMIZE) -# undef TVMET_CXX_ALWAYS_INLINE -# define TVMET_CXX_ALWAYS_INLINE -#endif - - /*********************************************************************** * Namespaces ***********************************************************************/ - /** * \namespace std * \brief Imported ISO/IEC 14882:1998 functions from std namespace. @@ -179,7 +119,7 @@ /*********************************************************************** * forwards ***********************************************************************/ -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) namespace std { template class complex; } diff --git a/tvmet-1.7.1/include/tvmet/util/Incrementor.h b/tvmet-1.7.1/include/tvmet/util/Incrementor.h index 2fbe1a630..809865de7 100644 --- a/tvmet-1.7.1/include/tvmet/util/Incrementor.h +++ b/tvmet-1.7.1/include/tvmet/util/Incrementor.h @@ -59,7 +59,7 @@ private: }; -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /** * \class Incrementor< std::complex > Incrementor.h "tvmet/util/Incrementor.h" * \brief Specialized Incrementor class. @@ -76,7 +76,7 @@ struct Incrementor< std::complex > { private: std::complex m_inc; }; -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) } // namespace util diff --git a/tvmet-1.7.1/include/tvmet/util/Random.h b/tvmet-1.7.1/include/tvmet/util/Random.h index 29a5dbe4f..611b12df2 100644 --- a/tvmet-1.7.1/include/tvmet/util/Random.h +++ b/tvmet-1.7.1/include/tvmet/util/Random.h @@ -65,7 +65,7 @@ template unsigned int Random::s_seed; -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /** * \class Random< std::complex > Random.h "tvmet/util/Random.h" * \brief Specialized Random class. @@ -86,7 +86,7 @@ public: // instance template unsigned int Random, MIN, MAX>::s_seed; -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) } // namespace util diff --git a/tvmet-1.7.1/include/tvmet/xpr/Matrix.h b/tvmet-1.7.1/include/tvmet/xpr/Matrix.h index 08b7bad85..91bbb00da 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/Matrix.h +++ b/tvmet-1.7.1/include/tvmet/xpr/Matrix.h @@ -154,7 +154,6 @@ private: #include #include -#include #include #include diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixBinaryFunctions.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixBinaryFunctions.h deleted file mode 100644 index 9dfca8e6d..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixBinaryFunctions.h +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * lesser General Public License for more details. - * - * You should have received a copy of the GNU lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: MatrixBinaryFunctions.h,v 1.8 2004/06/10 16:36:55 opetzold Exp $ - */ - -#ifndef TVMET_XPR_MATRIX_BINARY_FUNCTIONS_H -#define TVMET_XPR_MATRIX_BINARY_FUNCTIONS_H - -namespace tvmet { - - -/********************************************************* - * PART I: DECLARATION - *********************************************************/ - -/* - * binary_function(XprMatrix, XprMatrix) - */ -#define TVMET_DECLARE_MACRO(NAME) \ -template \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME, \ - XprMatrix, \ - XprMatrix \ - >, \ - Rows, Cols \ -> \ -NAME(const XprMatrix& lhs, \ - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; - -TVMET_DECLARE_MACRO(atan2) -TVMET_DECLARE_MACRO(drem) -TVMET_DECLARE_MACRO(fmod) -TVMET_DECLARE_MACRO(hypot) -TVMET_DECLARE_MACRO(jn) -TVMET_DECLARE_MACRO(yn) -TVMET_DECLARE_MACRO(pow) -#if defined(TVMET_HAVE_COMPLEX) - //TVMET_DECLARE_MACRO(polar) -#endif - -#undef TVMET_DECLARE_MACRO - - -/* - * binary_function(XprMatrix, POD) - */ -#define TVMET_DECLARE_MACRO(NAME, TP) \ -template \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME, \ - XprMatrix, \ - XprLiteral< TP > \ - >, \ - Rows, Cols \ -> \ -NAME(const XprMatrix& lhs, \ - TP rhs) TVMET_CXX_ALWAYS_INLINE; - -TVMET_DECLARE_MACRO(atan2, int) -TVMET_DECLARE_MACRO(drem, int) -TVMET_DECLARE_MACRO(fmod, int) -TVMET_DECLARE_MACRO(hypot, int) -TVMET_DECLARE_MACRO(jn, int) -TVMET_DECLARE_MACRO(yn, int) -TVMET_DECLARE_MACRO(pow, int) - -TVMET_DECLARE_MACRO(atan2, float) -TVMET_DECLARE_MACRO(drem, float) -TVMET_DECLARE_MACRO(fmod, float) -TVMET_DECLARE_MACRO(hypot, float) -TVMET_DECLARE_MACRO(jn, float) -TVMET_DECLARE_MACRO(yn, float) -TVMET_DECLARE_MACRO(pow, float) - -TVMET_DECLARE_MACRO(atan2, double) -TVMET_DECLARE_MACRO(drem, double) -TVMET_DECLARE_MACRO(fmod, double) -TVMET_DECLARE_MACRO(hypot,double) -TVMET_DECLARE_MACRO(jn, double) -TVMET_DECLARE_MACRO(yn, double) -TVMET_DECLARE_MACRO(pow, double) - -#undef TVMET_DECLARE_MACRO - - -#if defined(TVMET_HAVE_COMPLEX) -/* - * binary_function(XprMatrix, std::complex<>) - */ -#define TVMET_DECLARE_MACRO(NAME) \ -template \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME >, \ - XprMatrix, \ - XprLiteral< std::complex > \ - >, \ - Rows, Cols \ -> \ -NAME(const XprMatrix& lhs, \ - const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; - -TVMET_DECLARE_MACRO(pow) - -TVMET_DECLARE_MACRO(atan2) -TVMET_DECLARE_MACRO(drem) -TVMET_DECLARE_MACRO(fmod) -TVMET_DECLARE_MACRO(hypot) -TVMET_DECLARE_MACRO(jn) -TVMET_DECLARE_MACRO(yn) - -#undef TVMET_DECLARE_MACRO - -#endif // defined(TVMET_HAVE_COMPLEX) - - -/********************************************************* - * PART II: IMPLEMENTATION - *********************************************************/ - - -/* - * binary_function(XprMatrix, XprMatrix) - */ -#define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME, \ - XprMatrix, \ - XprMatrix \ - >, \ - Rows, Cols \ -> \ -NAME(const XprMatrix& lhs, const XprMatrix& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME, \ - XprMatrix, \ - XprMatrix \ - > expr_type; \ - return XprMatrix( \ - expr_type(lhs, rhs)); \ -} - -TVMET_IMPLEMENT_MACRO(atan2) -TVMET_IMPLEMENT_MACRO(drem) -TVMET_IMPLEMENT_MACRO(fmod) -TVMET_IMPLEMENT_MACRO(hypot) -TVMET_IMPLEMENT_MACRO(jn) -TVMET_IMPLEMENT_MACRO(yn) -TVMET_IMPLEMENT_MACRO(pow) -#if defined(TVMET_HAVE_COMPLEX) - //TVMET_IMPLEMENT_MACRO(polar) -#endif - -#undef TVMET_IMPLEMENT_MACRO - - -/* - * binary_function(XprMatrix, POD) - */ -#define TVMET_IMPLEMENT_MACRO(NAME, TP) \ -template \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME, \ - XprMatrix, \ - XprLiteral< TP > \ - >, \ - Rows, Cols \ -> \ -NAME(const XprMatrix& lhs, TP rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME, \ - XprMatrix, \ - XprLiteral< TP > \ - > expr_type; \ - return XprMatrix( \ - expr_type(lhs, XprLiteral< TP >(rhs))); \ -} - -TVMET_IMPLEMENT_MACRO(atan2, int) -TVMET_IMPLEMENT_MACRO(drem, int) -TVMET_IMPLEMENT_MACRO(fmod, int) -TVMET_IMPLEMENT_MACRO(hypot, int) -TVMET_IMPLEMENT_MACRO(jn, int) -TVMET_IMPLEMENT_MACRO(yn, int) -TVMET_IMPLEMENT_MACRO(pow, int) - -TVMET_IMPLEMENT_MACRO(atan2, float) -TVMET_IMPLEMENT_MACRO(drem, float) -TVMET_IMPLEMENT_MACRO(fmod, float) -TVMET_IMPLEMENT_MACRO(hypot, float) -TVMET_IMPLEMENT_MACRO(jn, float) -TVMET_IMPLEMENT_MACRO(yn, float) -TVMET_IMPLEMENT_MACRO(pow, float) - -TVMET_IMPLEMENT_MACRO(atan2, double) -TVMET_IMPLEMENT_MACRO(drem, double) -TVMET_IMPLEMENT_MACRO(fmod, double) -TVMET_IMPLEMENT_MACRO(hypot,double) -TVMET_IMPLEMENT_MACRO(jn, double) -TVMET_IMPLEMENT_MACRO(yn, double) -TVMET_IMPLEMENT_MACRO(pow, double) - -#undef TVMET_IMPLEMENT_MACRO - - -#if defined(TVMET_HAVE_COMPLEX) -/* - * binary_function(XprMatrix, std::complex<>) - */ -#define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME >, \ - XprMatrix, \ - XprLiteral< std::complex > \ - >, \ - Rows, Cols \ -> \ -NAME(const XprMatrix& lhs, const std::complex& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME >, \ - XprMatrix, \ - XprLiteral< std::complex > \ - > expr_type; \ - return XprMatrix( \ - expr_type(lhs, XprLiteral< std::complex >(rhs))); \ -} - -TVMET_IMPLEMENT_MACRO(pow) - -TVMET_IMPLEMENT_MACRO(atan2) -TVMET_IMPLEMENT_MACRO(drem) -TVMET_IMPLEMENT_MACRO(fmod) -TVMET_IMPLEMENT_MACRO(hypot) -TVMET_IMPLEMENT_MACRO(jn) -TVMET_IMPLEMENT_MACRO(yn) - -#undef TVMET_IMPLEMENT_MACRO - -#endif // defined(TVMET_HAVE_COMPLEX) - - -} // namespace tvmet - -#endif // TVMET_XPR_MATRIX_BINARY_FUNCTIONS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixFunctions.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixFunctions.h index 044622be3..288efb798 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixFunctions.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MatrixFunctions.h @@ -61,7 +61,7 @@ XprMatrix< \ Rows, Cols \ > \ NAME (const XprMatrix& lhs, \ - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add) // per se element wise TVMET_DECLARE_MACRO(sub) // per se element wise @@ -89,7 +89,7 @@ XprMatrix< \ Rows, Cols \ > \ NAME (const XprMatrix& lhs, \ - POD rhs) TVMET_CXX_ALWAYS_INLINE; \ + POD rhs) _tvmet_always_inline; \ \ template \ XprMatrix< \ @@ -101,7 +101,7 @@ XprMatrix< \ Rows, Cols \ > \ NAME (POD lhs, \ - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, int) TVMET_DECLARE_MACRO(sub, int) @@ -121,7 +121,7 @@ TVMET_DECLARE_MACRO(div, double) #undef TVMET_DECLARE_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * function(XprMatrix, complex) * function(complex, XprMatrix) @@ -139,7 +139,7 @@ XprMatrix< \ Rows, Cols \ > \ NAME (const XprMatrix& lhs, \ - const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const std::complex& rhs) _tvmet_always_inline; \ \ template \ XprMatrix< \ @@ -151,7 +151,7 @@ XprMatrix< \ Rows, Cols \ > \ NAME (const std::complex& lhs, \ - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add) TVMET_DECLARE_MACRO(sub) @@ -160,7 +160,7 @@ TVMET_DECLARE_MACRO(div) #undef TVMET_DECLARE_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -178,7 +178,7 @@ XprMatrix< Rows1, Cols2 // return Dim > prod(const XprMatrix& lhs, - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; template trans_prod(const XprMatrix& lhs, - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; template MtM_prod(const XprMatrix& lhs, - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; template MMt_prod(const XprMatrix& lhs, - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -235,7 +235,7 @@ XprVector< Rows > prod(const XprMatrix& lhs, - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -250,13 +250,13 @@ XprMatrix< >, Cols, Rows > -trans(const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; +trans(const XprMatrix& rhs) _tvmet_always_inline; #if 0 // XXX needs declaration of meta::Matrix::trace template typename NumericTraits::sum_type -trace(const XprMatrix& m)TVMET_CXX_ALWAYS_INLINE; +trace(const XprMatrix& m)_tvmet_always_inline; #endif @@ -269,7 +269,7 @@ XprVector< Cols > row(const XprMatrix& m, - int no) TVMET_CXX_ALWAYS_INLINE; + int no) _tvmet_always_inline; template @@ -280,7 +280,7 @@ XprVector< >, Rows > -col(const XprMatrix& m, int no) TVMET_CXX_ALWAYS_INLINE; +col(const XprMatrix& m, int no) _tvmet_always_inline; template @@ -291,7 +291,7 @@ XprVector< >, Sz > -diag(const XprMatrix& m) TVMET_CXX_ALWAYS_INLINE; +diag(const XprMatrix& m) _tvmet_always_inline; /********************************************************* @@ -402,7 +402,7 @@ TVMET_IMPLEMENT_MACRO(div, double) #undef TVMET_IMPLEMENT_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * function(XprMatrix, complex) * function(complex, XprMatrix) @@ -459,7 +459,7 @@ TVMET_IMPLEMENT_MACRO(div) #undef TVMET_IMPLEMENT_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixOperators.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixOperators.h index b35256275..6f31d88f4 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixOperators.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MatrixOperators.h @@ -57,7 +57,7 @@ XprMatrix< \ Rows1, Cols1 \ > \ operator OP (const XprMatrix& lhs, \ - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, +) // per se element wise TVMET_DECLARE_MACRO(sub, -) // per se element wise @@ -84,7 +84,7 @@ XprMatrix< \ Rows, Cols \ > \ operator OP (const XprMatrix& lhs, \ - POD rhs) TVMET_CXX_ALWAYS_INLINE; \ + POD rhs) _tvmet_always_inline; \ \ template \ XprMatrix< \ @@ -96,7 +96,7 @@ XprMatrix< \ Rows, Cols \ > \ operator OP (POD lhs, \ - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, +, int) TVMET_DECLARE_MACRO(sub, -, int) @@ -116,7 +116,7 @@ TVMET_DECLARE_MACRO(div, /, double) #undef TVMET_DECLARE_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * operator(XprMatrix, complex<>) * operator(complex<>, XprMatrix) @@ -134,7 +134,7 @@ XprMatrix< \ Rows, Cols \ > \ operator OP (const XprMatrix& lhs, \ - const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const std::complex& rhs) _tvmet_always_inline; \ \ template \ XprMatrix< \ @@ -146,7 +146,7 @@ XprMatrix< \ Rows, Cols \ > \ operator OP (const std::complex& lhs, \ - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, +) TVMET_DECLARE_MACRO(sub, -) @@ -155,7 +155,7 @@ TVMET_DECLARE_MACRO(div, /) #undef TVMET_DECLARE_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -179,7 +179,7 @@ XprMatrix< Rows1, Cols2 > operator*(const XprMatrix& lhs, - const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprMatrix& rhs) _tvmet_always_inline; /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -203,7 +203,7 @@ XprVector< Rows > operator*(const XprMatrix& lhs, - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; @@ -225,7 +225,7 @@ XprMatrix< \ >, \ Rows, Cols \ > \ -operator OP (const XprMatrix& m) TVMET_CXX_ALWAYS_INLINE; +operator OP (const XprMatrix& m) _tvmet_always_inline; TVMET_DECLARE_MACRO(neg, -) @@ -329,7 +329,7 @@ TVMET_IMPLEMENT_MACRO(div, /, double) #undef TVMET_IMPLEMENT_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * operator(XprMatrix, complex<>) * operator(complex<>, XprMatrix) @@ -374,7 +374,7 @@ TVMET_IMPLEMENT_MACRO(div, /) #undef TVMET_IMPLEMENT_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/tvmet-1.7.1/include/tvmet/xpr/Vector.h b/tvmet-1.7.1/include/tvmet/xpr/Vector.h index e2a798f85..65db2a1f1 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/Vector.h +++ b/tvmet-1.7.1/include/tvmet/xpr/Vector.h @@ -144,7 +144,6 @@ private: #include #include -#include #include #include diff --git a/tvmet-1.7.1/include/tvmet/xpr/VectorBinaryFunctions.h b/tvmet-1.7.1/include/tvmet/xpr/VectorBinaryFunctions.h deleted file mode 100644 index ac59e9dc6..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/VectorBinaryFunctions.h +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: VectorBinaryFunctions.h,v 1.8 2004/06/10 16:36:55 opetzold Exp $ - */ - -#ifndef TVMET_XPR_VECTOR_BINARY_FUNCTIONS_H -#define TVMET_XPR_VECTOR_BINARY_FUNCTIONS_H - -namespace tvmet { - - -/********************************************************* - * PART I: DECLARATION - *********************************************************/ - - -/* - * binary_function(XprVector, XprVector) - */ -#define TVMET_DECLARE_MACRO(NAME) \ -template \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME, \ - XprVector, \ - XprVector \ - >, \ - Sz \ -> \ -NAME(const XprVector& lhs, \ - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; - -TVMET_DECLARE_MACRO(atan2) -TVMET_DECLARE_MACRO(drem) -TVMET_DECLARE_MACRO(fmod) -TVMET_DECLARE_MACRO(hypot) -TVMET_DECLARE_MACRO(jn) -TVMET_DECLARE_MACRO(yn) -TVMET_DECLARE_MACRO(pow) -#if defined(TVMET_HAVE_COMPLEX) -TVMET_DECLARE_MACRO(polar) -#endif - -#undef TVMET_DECLARE_MACRO - - -/* - * binary_function(XprVector, POD) - */ -#define TVMET_DECLARE_MACRO(NAME, TP) \ -template \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME, \ - XprVector, \ - XprLiteral< TP > \ - >, \ - Sz \ -> \ -NAME(const XprVector& lhs, \ - TP rhs) TVMET_CXX_ALWAYS_INLINE; - -TVMET_DECLARE_MACRO(atan2, int) -TVMET_DECLARE_MACRO(drem, int) -TVMET_DECLARE_MACRO(fmod, int) -TVMET_DECLARE_MACRO(hypot, int) -TVMET_DECLARE_MACRO(jn, int) -TVMET_DECLARE_MACRO(yn, int) -TVMET_DECLARE_MACRO(pow, int) - -TVMET_DECLARE_MACRO(atan2, float) -TVMET_DECLARE_MACRO(drem, float) -TVMET_DECLARE_MACRO(fmod, float) -TVMET_DECLARE_MACRO(hypot, float) -TVMET_DECLARE_MACRO(jn, float) -TVMET_DECLARE_MACRO(yn, float) -TVMET_DECLARE_MACRO(pow, float) - -TVMET_DECLARE_MACRO(atan2, double) -TVMET_DECLARE_MACRO(drem, double) -TVMET_DECLARE_MACRO(fmod, double) -TVMET_DECLARE_MACRO(hypot, double) -TVMET_DECLARE_MACRO(jn, double) -TVMET_DECLARE_MACRO(yn, double) -TVMET_DECLARE_MACRO(pow, double) - -#undef TVMET_DECLARE_MACRO - - -#if defined(TVMET_HAVE_COMPLEX) -/* - * binary_function(XprVector, std::complex<>) - */ -#define TVMET_DECLARE_MACRO(NAME) \ -template \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME >, \ - XprVector, \ - XprLiteral< std::complex > \ - >, \ - Sz \ -> \ -NAME(const XprVector& lhs, \ - const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; - -TVMET_DECLARE_MACRO(atan2) -TVMET_DECLARE_MACRO(drem) -TVMET_DECLARE_MACRO(fmod) -TVMET_DECLARE_MACRO(hypot) -TVMET_DECLARE_MACRO(jn) -TVMET_DECLARE_MACRO(yn) -TVMET_DECLARE_MACRO(pow) - -#undef TVMET_DECLARE_MACRO - -#endif // defined(TVMET_HAVE_COMPLEX) - - -/********************************************************* - * PART II: IMPLEMENTATION - *********************************************************/ - - -/* - * binary_function(XprVector, XprVector) - */ -#define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME, \ - XprVector, \ - XprVector \ - >, \ - Sz \ -> \ -NAME(const XprVector& lhs, const XprVector& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME, \ - XprVector, \ - XprVector \ - > expr_type; \ - return XprVector( \ - expr_type(lhs, rhs)); \ -} - -TVMET_IMPLEMENT_MACRO(atan2) -TVMET_IMPLEMENT_MACRO(drem) -TVMET_IMPLEMENT_MACRO(fmod) -TVMET_IMPLEMENT_MACRO(hypot) -TVMET_IMPLEMENT_MACRO(jn) -TVMET_IMPLEMENT_MACRO(yn) -TVMET_IMPLEMENT_MACRO(pow) -#if defined(TVMET_HAVE_COMPLEX) -TVMET_IMPLEMENT_MACRO(polar) -#endif - -#undef TVMET_IMPLEMENT_MACRO - - -/* - * binary_function(XprVector, POD) - */ -#define TVMET_IMPLEMENT_MACRO(NAME, TP) \ -template \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME, \ - XprVector, \ - XprLiteral< TP > \ - >, \ - Sz \ -> \ -NAME(const XprVector& lhs, TP rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME, \ - XprVector, \ - XprLiteral< TP > \ - > expr_type; \ - return XprVector( \ - expr_type(lhs, XprLiteral< TP >(rhs))); \ -} - -TVMET_IMPLEMENT_MACRO(atan2, int) -TVMET_IMPLEMENT_MACRO(drem, int) -TVMET_IMPLEMENT_MACRO(fmod, int) -TVMET_IMPLEMENT_MACRO(hypot, int) -TVMET_IMPLEMENT_MACRO(jn, int) -TVMET_IMPLEMENT_MACRO(yn, int) -TVMET_IMPLEMENT_MACRO(pow, int) - -TVMET_IMPLEMENT_MACRO(atan2, float) -TVMET_IMPLEMENT_MACRO(drem, float) -TVMET_IMPLEMENT_MACRO(fmod, float) -TVMET_IMPLEMENT_MACRO(hypot, float) -TVMET_IMPLEMENT_MACRO(jn, float) -TVMET_IMPLEMENT_MACRO(yn, float) -TVMET_IMPLEMENT_MACRO(pow, float) - -TVMET_IMPLEMENT_MACRO(atan2, double) -TVMET_IMPLEMENT_MACRO(drem, double) -TVMET_IMPLEMENT_MACRO(fmod, double) -TVMET_IMPLEMENT_MACRO(hypot, double) -TVMET_IMPLEMENT_MACRO(jn, double) -TVMET_IMPLEMENT_MACRO(yn, double) -TVMET_IMPLEMENT_MACRO(pow, double) - -#undef TVMET_IMPLEMENT_MACRO - - -#if defined(TVMET_HAVE_COMPLEX) -/* - * binary_function(XprVector, std::complex<>) - */ -#define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME >, \ - XprVector, \ - XprLiteral< std::complex > \ - >, \ - Sz \ -> \ -NAME(const XprVector& lhs, const std::complex& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME >, \ - XprVector, \ - XprLiteral< std::complex > \ - > expr_type; \ - return XprVector( \ - expr_type(lhs, XprLiteral< std::complex >(rhs))); \ -} - -TVMET_IMPLEMENT_MACRO(atan2) -TVMET_IMPLEMENT_MACRO(drem) -TVMET_IMPLEMENT_MACRO(fmod) -TVMET_IMPLEMENT_MACRO(hypot) -TVMET_IMPLEMENT_MACRO(jn) -TVMET_IMPLEMENT_MACRO(yn) -TVMET_IMPLEMENT_MACRO(pow) - -#undef TVMET_IMPLEMENT_MACRO - -#endif // defined(TVMET_HAVE_COMPLEX) - - -} // namespace tvmet - -#endif // TVMET_XPR_VECTOR_BINARY_FUNCTIONS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/VectorFunctions.h b/tvmet-1.7.1/include/tvmet/xpr/VectorFunctions.h index 80ee484b3..846aaf842 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/VectorFunctions.h +++ b/tvmet-1.7.1/include/tvmet/xpr/VectorFunctions.h @@ -55,7 +55,7 @@ XprVector< \ Sz \ > \ NAME (const XprVector& lhs, \ - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add) // per se element wise TVMET_DECLARE_MACRO(sub) // per se element wise @@ -83,7 +83,7 @@ XprVector< \ Sz \ > \ NAME (const XprVector& lhs, \ - POD rhs) TVMET_CXX_ALWAYS_INLINE; \ + POD rhs) _tvmet_always_inline; \ \ template \ XprVector< \ @@ -95,7 +95,7 @@ XprVector< \ Sz \ > \ NAME (POD lhs, \ - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, int) TVMET_DECLARE_MACRO(sub, int) @@ -115,7 +115,7 @@ TVMET_DECLARE_MACRO(div, double) #undef TVMET_DECLARE_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * function(XprMatrix, complex) * function(complex, XprMatrix) @@ -133,7 +133,7 @@ XprVector< \ Sz \ > \ NAME (const XprVector& lhs, \ - const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const std::complex& rhs) _tvmet_always_inline; \ \ template \ XprVector< \ @@ -145,7 +145,7 @@ XprVector< \ Sz \ > \ NAME (const std::complex& lhs, \ - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add) TVMET_DECLARE_MACRO(sub) @@ -154,7 +154,7 @@ TVMET_DECLARE_MACRO(div) #undef TVMET_DECLARE_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -164,12 +164,12 @@ TVMET_DECLARE_MACRO(div) template typename NumericTraits::sum_type -sum(const XprVector& v) TVMET_CXX_ALWAYS_INLINE; +sum(const XprVector& v) _tvmet_always_inline; template typename NumericTraits::sum_type -product(const XprVector& v) TVMET_CXX_ALWAYS_INLINE; +product(const XprVector& v) _tvmet_always_inline; template @@ -178,19 +178,19 @@ typename PromoteTraits< typename E2::value_type >::value_type dot(const XprVector& lhs, - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; template typename PromoteTraits::value_type dot(const Vector& lhs, - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; template typename PromoteTraits::value_type dot(const XprVector& lhs, - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; + const Vector& rhs) _tvmet_always_inline; template @@ -202,31 +202,31 @@ Vector< 3 > cross(const XprVector& lhs, - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; template Vector< typename PromoteTraits::value_type, 3> cross(const Vector& lhs, - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; template Vector< typename PromoteTraits::value_type, 3> cross(const XprVector& lhs, - const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; + const Vector& rhs) _tvmet_always_inline; template typename NumericTraits::sum_type -norm1(const XprVector& v) TVMET_CXX_ALWAYS_INLINE; +norm1(const XprVector& v) _tvmet_always_inline; template typename NumericTraits::sum_type -norm2(const XprVector& v) TVMET_CXX_ALWAYS_INLINE; +norm2(const XprVector& v) _tvmet_always_inline; template @@ -238,7 +238,7 @@ XprVector< >, Sz > -normalize(const XprVector& v) TVMET_CXX_ALWAYS_INLINE; +normalize(const XprVector& v) _tvmet_always_inline; /********************************************************* @@ -343,7 +343,7 @@ TVMET_IMPLEMENT_MACRO(div, double) #undef TVMET_IMPLEMENT_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * function(XprMatrix, complex) * function(complex, XprMatrix) @@ -398,7 +398,7 @@ TVMET_IMPLEMENT_MACRO(div) #undef TVMET_IMPLEMENT_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/tvmet-1.7.1/include/tvmet/xpr/VectorOperators.h b/tvmet-1.7.1/include/tvmet/xpr/VectorOperators.h index 947d38666..5f5bf6803 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/VectorOperators.h +++ b/tvmet-1.7.1/include/tvmet/xpr/VectorOperators.h @@ -53,7 +53,7 @@ XprVector< \ Sz \ > \ operator OP (const XprVector& lhs, \ - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, +) // per se element wise TVMET_DECLARE_MACRO(sub, -) // per se element wise @@ -82,7 +82,7 @@ XprVector< \ Sz \ > \ operator OP (const XprVector& lhs, \ - POD rhs) TVMET_CXX_ALWAYS_INLINE; \ + POD rhs) _tvmet_always_inline; \ \ template \ inline \ @@ -95,7 +95,7 @@ XprVector< \ Sz \ > \ operator OP (POD lhs, \ - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, +, int) TVMET_DECLARE_MACRO(sub, -, int) @@ -115,7 +115,7 @@ TVMET_DECLARE_MACRO(div, /, double) #undef TVMET_DECLARE_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * operator(XprVector, complex) * operator(complex, XprVector) @@ -133,7 +133,7 @@ XprVector< \ Sz \ > \ operator OP (const XprVector& lhs, \ - const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ + const std::complex& rhs) _tvmet_always_inline; \ \ template \ inline \ @@ -146,7 +146,7 @@ XprVector< \ Sz \ > \ operator OP (const std::complex& lhs, \ - const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; + const XprVector& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(add, +) // per se element wise TVMET_DECLARE_MACRO(sub, -) // per se element wise @@ -155,7 +155,7 @@ TVMET_DECLARE_MACRO(div, /) // per se element wise #undef TVMET_DECLARE_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -176,7 +176,7 @@ XprVector< \ >, \ Sz \ > \ -operator OP (const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; +operator OP (const XprVector& rhs) _tvmet_always_inline; TVMET_DECLARE_MACRO(neg, -) @@ -275,7 +275,7 @@ TVMET_IMPLEMENT_MACRO(div, /, double) #undef TVMET_IMPLEMENT_MACRO -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) /* * operator(XprVector, complex) * operator(complex, XprVector) @@ -319,7 +319,7 @@ TVMET_IMPLEMENT_MACRO(div, /) // per se element wise #undef TVMET_IMPLEMENT_MACRO -#endif // defined(TVMET_HAVE_COMPLEX) +#endif // defined(EIGEN_USE_COMPLEX) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/tvmet-1.7.1/testsuite/TestConstruction.cc b/tvmet-1.7.1/testsuite/TestConstruction.cc index 1071fadc0..b970b03c1 100644 --- a/tvmet-1.7.1/testsuite/TestConstruction.cc +++ b/tvmet-1.7.1/testsuite/TestConstruction.cc @@ -35,6 +35,6 @@ CPPUNIT_TEST_SUITE_REGISTRATION( TestConstruction ); CPPUNIT_TEST_SUITE_REGISTRATION( TestConstruction ); -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) CPPUNIT_TEST_SUITE_REGISTRATION( TestConstruction< std::complex > ); #endif diff --git a/tvmet-1.7.1/testsuite/TestDimension.cc b/tvmet-1.7.1/testsuite/TestDimension.cc index 3b9672be8..473fe5a52 100644 --- a/tvmet-1.7.1/testsuite/TestDimension.cc +++ b/tvmet-1.7.1/testsuite/TestDimension.cc @@ -35,6 +35,6 @@ CPPUNIT_TEST_SUITE_REGISTRATION( TestDimension ); CPPUNIT_TEST_SUITE_REGISTRATION( TestDimension ); -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) CPPUNIT_TEST_SUITE_REGISTRATION( TestDimension< std::complex > ); #endif diff --git a/tvmet-1.7.1/testsuite/TestNumericTraitsComplex.cc b/tvmet-1.7.1/testsuite/TestNumericTraitsComplex.cc index 6518724ea..0f2546329 100644 --- a/tvmet-1.7.1/testsuite/TestNumericTraitsComplex.cc +++ b/tvmet-1.7.1/testsuite/TestNumericTraitsComplex.cc @@ -32,7 +32,7 @@ * instance ****************************************************************************/ -#if defined(TVMET_HAVE_COMPLEX) +#if defined(EIGEN_USE_COMPLEX) CPPUNIT_TEST_SUITE_REGISTRATION( TestNumericTraitsComplex< std::complex > ); CPPUNIT_TEST_SUITE_REGISTRATION( TestNumericTraitsComplex< std::complex > ); CPPUNIT_TEST_SUITE_REGISTRATION( TestNumericTraitsComplex< std::complex > ); diff --git a/tvmet-1.7.1/testsuite/main.h b/tvmet-1.7.1/testsuite/main.h index 9d15ce4e9..da1fed02d 100644 --- a/tvmet-1.7.1/testsuite/main.h +++ b/tvmet-1.7.1/testsuite/main.h @@ -23,10 +23,11 @@ #include #include -#ifdef TVMET_HAVE_COMPLEX +#ifdef EIGEN_USE_COMPLEX #include #endif +#define EIGEN_USE_COMPLEX #include #include diff --git a/tvmet-1.7.1/testsuite/selftest.cpp b/tvmet-1.7.1/testsuite/selftest.cpp index e23399b10..1b0ea324e 100644 --- a/tvmet-1.7.1/testsuite/selftest.cpp +++ b/tvmet-1.7.1/testsuite/selftest.cpp @@ -69,7 +69,7 @@ void TvmetTestSuite::selfTest() basics2 (); basics2 (); -#ifdef TVMET_HAVE_COMPLEX +#ifdef EIGEN_USE_COMPLEX basics1, 4> (); basics1, 4> (); basics2 > ();