mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
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.
This commit is contained in:
parent
152e09a14d
commit
37bd64b496
@ -1,22 +0,0 @@
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
|
||||
MACRO (CHECK_COMPLEX _RESULT)
|
||||
|
||||
SET(_CHECK_COMPLEX_SOURCE_CODE "
|
||||
|
||||
#include<complex>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
complex<double> x(1.0, 1.0);
|
||||
complex<float> y(1.0f, 1.0f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
")
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("${_CHECK_COMPLEX_SOURCE_CODE}" ${_RESULT})
|
||||
|
||||
ENDMACRO (CHECK_COMPLEX)
|
@ -1,23 +0,0 @@
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
|
||||
MACRO (CHECK_COMPLEX_MATH1 _RESULT)
|
||||
|
||||
SET(_CHECK_COMPLEX_MATH1_SOURCE_CODE "
|
||||
|
||||
#include<complex>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
complex<double> 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)
|
@ -1,22 +0,0 @@
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
|
||||
MACRO (CHECK_COMPLEX_MATH2 _RESULT)
|
||||
|
||||
SET(_CHECK_COMPLEX_MATH2_SOURCE_CODE "
|
||||
|
||||
#include<complex>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
complex<double> 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)
|
@ -1,30 +0,0 @@
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
|
||||
MACRO (CHECK_IEEE_MATH _RESULT)
|
||||
|
||||
SET(_CHECK_IEEE_MATH_SOURCE_CODE "
|
||||
|
||||
#include<cmath>
|
||||
|
||||
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)
|
@ -1,34 +0,0 @@
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
|
||||
MACRO (CHECK_SYSV_MATH _RESULT)
|
||||
|
||||
SET(_CHECK_SYSV_MATH_SOURCE_CODE "
|
||||
|
||||
#include<cmath>
|
||||
|
||||
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)
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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<T>&", "std::complex<T>") );
|
||||
#endif // HAVE_COMPLEX
|
||||
}
|
||||
|
@ -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<T,T> : public BinaryFunctional {
|
||||
<< std::endl;
|
||||
}
|
||||
};
|
||||
#endif // defined(TVMET_HAVE_COMPLEX)
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/**
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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 <class T2> Matrix& M_add_eq(const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& M_sub_eq(const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& M_mul_eq(const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& M_div_eq(const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& M_mod_eq(const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& M_xor_eq(const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& M_and_eq(const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& M_or_eq (const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& M_shl_eq(const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& M_shr_eq(const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& M_add_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& M_sub_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& M_mul_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& M_div_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& M_mod_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& M_xor_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& M_and_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& M_or_eq (const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& M_shl_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& M_shr_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
|
||||
public: // math operators with expressions
|
||||
// NOTE: access using the operators in ns element_wise, since that's what is does
|
||||
template <class E> Matrix& M_add_eq(const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& M_sub_eq(const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& M_mul_eq(const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& M_div_eq(const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& M_mod_eq(const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& M_xor_eq(const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& M_and_eq(const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& M_or_eq (const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& M_shl_eq(const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& M_shr_eq(const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& M_add_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& M_sub_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& M_mul_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& M_div_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& M_mod_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& M_xor_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& M_and_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& M_or_eq (const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& M_shl_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& M_shr_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
|
||||
public: // aliased math operators with expressions
|
||||
template <class T2> Matrix& alias_assign(const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& alias_add_eq(const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& alias_sub_eq(const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& alias_mul_eq(const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& alias_div_eq(const Matrix<T2, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Matrix& alias_assign(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& alias_add_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& alias_sub_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& alias_mul_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& alias_div_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
|
||||
template <class E> Matrix& alias_assign(const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& alias_add_eq(const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& alias_sub_eq(const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& alias_mul_eq(const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& alias_div_eq(const XprMatrix<E, Rows, Cols>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Matrix& alias_assign(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& alias_add_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& alias_sub_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& alias_mul_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& alias_div_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
|
||||
public: // io
|
||||
/** Structure for info printing as Matrix<T, Rows, Cols>. */
|
||||
@ -443,7 +443,6 @@ typedef Matrix<double, 4, 4> Matrix4d;
|
||||
|
||||
#include <tvmet/MatrixImpl.h>
|
||||
#include <tvmet/MatrixFunctions.h>
|
||||
#include <tvmet/MatrixBinaryFunctions.h>
|
||||
#include <tvmet/MatrixUnaryFunctions.h>
|
||||
#include <tvmet/MatrixOperators.h>
|
||||
#include <tvmet/MatrixEval.h>
|
||||
|
@ -1,492 +0,0 @@
|
||||
/*
|
||||
* Tiny Vector Matrix Library
|
||||
* Dense Vector Matrix Libary of Tiny size using Expression Templates
|
||||
*
|
||||
* Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net>
|
||||
*
|
||||
* 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<T1, Rows, Cols>, Matrix<T2, Rows, Cols>)
|
||||
* binary_function(Matrix<T1, Rows, Cols>, XprMatrix<E, Rows, Cols>)
|
||||
* binary_function(XprMatrix<E, Rows, Cols>, Matrix<T, Rows, Cols>)
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME) \
|
||||
template<class T1, class T2, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T1, T2>, \
|
||||
MatrixConstReference<T1, Rows, Cols>, \
|
||||
MatrixConstReference<T2, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const Matrix<T1, Rows, Cols>& lhs, \
|
||||
const Matrix<T2, Cols, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
\
|
||||
template<class E, class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
MatrixConstReference<T, Rows, Cols>, \
|
||||
XprMatrix<E, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const XprMatrix<E, Rows, Cols>& lhs, \
|
||||
const Matrix<T, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
\
|
||||
template<class E, class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T, typename E::value_type>, \
|
||||
MatrixConstReference<T, Rows, Cols>, \
|
||||
XprMatrix<E, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const Matrix<T, Rows, Cols>& lhs, \
|
||||
const XprMatrix<E, Rows, Cols>& 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<T, Rows, Cols>, POD)
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, TP) \
|
||||
template<class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T, TP >, \
|
||||
MatrixConstReference<T, Rows, Cols>, \
|
||||
XprLiteral< TP > \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const Matrix<T, Rows, Cols>& 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<class T, int Rows, int Cols>
|
||||
XprMatrix<
|
||||
XprBinOp<
|
||||
Fcnl_pow<T, std::complex<T> >,
|
||||
MatrixConstReference<T, Rows, Cols>,
|
||||
XprLiteral< std::complex<T> >
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
pow(const Matrix<T, Rows, Cols>& lhs,
|
||||
const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
|
||||
|
||||
template<class T, int Rows, int Cols>
|
||||
XprMatrix<
|
||||
XprBinOp<
|
||||
Fcnl_pow< std::complex<T>, std::complex<T> >,
|
||||
MatrixConstReference<std::complex<T>, Rows, Cols>,
|
||||
XprLiteral< std::complex<T> >
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
pow(const Matrix<std::complex<T>, Rows, Cols>& lhs,
|
||||
const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
|
||||
|
||||
/**
|
||||
* \fn pow(const Matrix<std::complex<T>, Rows, Cols>& lhs, const T& rhs)
|
||||
* \ingroup _binary_function
|
||||
*/
|
||||
template<class T, int Rows, int Cols>
|
||||
XprMatrix<
|
||||
XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, T>,
|
||||
MatrixConstReference<std::complex<T>, Rows, Cols>,
|
||||
XprLiteral<T>
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
pow(const Matrix<std::complex<T>, Rows, Cols>& lhs,
|
||||
const T& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
|
||||
|
||||
/**
|
||||
* \fn pow(const Matrix<std::complex<T>, Rows, Cols>& lhs, int rhs)
|
||||
* \ingroup _binary_function
|
||||
*/
|
||||
template<class T, int Rows, int Cols>
|
||||
XprMatrix<
|
||||
XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, int>,
|
||||
MatrixConstReference<std::complex<T>, Rows, Cols>,
|
||||
XprLiteral<int>
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
pow(const Matrix<std::complex<T>, Rows, Cols>& lhs,
|
||||
int rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
|
||||
|
||||
template<class T, int Rows, int Cols>
|
||||
XprMatrix<
|
||||
XprBinOp<
|
||||
Fcnl_polar<T, T>,
|
||||
MatrixConstReference<T, Rows, Cols>,
|
||||
XprLiteral<T>
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
polar(const Matrix<T, Rows, Cols>& 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<T1, Rows, Cols>, Matrix<T2, Rows, Cols>)
|
||||
* binary_function(Matrix<T1, Rows, Cols>, XprMatrix<E, Rows, Cols>)
|
||||
* binary_function(XprMatrix<E, Rows, Cols>, Matrix<T, Rows, Cols>)
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T1, class T2, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T1, T2>, \
|
||||
MatrixConstReference<T1, Rows, Cols>, \
|
||||
MatrixConstReference<T2, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const Matrix<T1, Rows, Cols>& lhs, const Matrix<T2, Cols, Cols>& rhs) { \
|
||||
typedef XprBinOp < \
|
||||
Fcnl_##NAME<T1, T2>, \
|
||||
MatrixConstReference<T1, Rows, Cols>, \
|
||||
MatrixConstReference<T2, Rows, Cols> \
|
||||
> expr_type; \
|
||||
return XprMatrix<expr_type, Rows, Cols>( \
|
||||
expr_type(lhs.const_ref(), rhs.const_ref())); \
|
||||
} \
|
||||
\
|
||||
template<class E, class T, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
MatrixConstReference<T, Rows, Cols>, \
|
||||
XprMatrix<E, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const XprMatrix<E, Rows, Cols>& lhs, const Matrix<T, Rows, Cols>& rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
XprMatrix<E, Rows, Cols>, \
|
||||
MatrixConstReference<T, Rows, Cols> \
|
||||
> expr_type; \
|
||||
return XprMatrix<expr_type, Rows, Cols>( \
|
||||
expr_type(lhs, rhs.const_ref())); \
|
||||
} \
|
||||
\
|
||||
template<class E, class T, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T, typename E::value_type>, \
|
||||
MatrixConstReference<T, Rows, Cols>, \
|
||||
XprMatrix<E, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const Matrix<T, Rows, Cols>& lhs, const XprMatrix<E, Rows, Cols>& rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<T, typename E::value_type>, \
|
||||
MatrixConstReference<T, Rows, Cols>, \
|
||||
XprMatrix<E, Rows, Cols> \
|
||||
> expr_type; \
|
||||
return XprMatrix<expr_type, Rows, Cols>( \
|
||||
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<T, Rows, Cols>, POD)
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, TP) \
|
||||
template<class T, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T, TP >, \
|
||||
MatrixConstReference<T, Rows, Cols>, \
|
||||
XprLiteral< TP > \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const Matrix<T, Rows, Cols>& lhs, TP rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<T, TP >, \
|
||||
MatrixConstReference<T, Rows, Cols>, \
|
||||
XprLiteral< TP > \
|
||||
> expr_type; \
|
||||
return XprMatrix<expr_type, Rows, Cols>( \
|
||||
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<T, Rows, Cols>& lhs, const std::complex<T>& rhs)
|
||||
* \ingroup _binary_function
|
||||
*/
|
||||
template<class T, int Rows, int Cols>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprBinOp<
|
||||
Fcnl_pow<T, std::complex<T> >,
|
||||
MatrixConstReference<T, Rows, Cols>,
|
||||
XprLiteral< std::complex<T> >
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
pow(const Matrix<T, Rows, Cols>& lhs, const std::complex<T>& rhs) {
|
||||
typedef XprBinOp<
|
||||
Fcnl_pow<T, std::complex<T> >,
|
||||
MatrixConstReference<T, Rows, Cols>,
|
||||
XprLiteral< std::complex<T> >
|
||||
> expr_type;
|
||||
return XprMatrix<expr_type, Rows, Cols>(
|
||||
expr_type(lhs.const_ref(), XprLiteral< std::complex<T> >(rhs)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn pow(const Matrix<std::complex<T>, Rows, Cols>& lhs, const std::complex<T>& rhs)
|
||||
* \ingroup _binary_function
|
||||
*/
|
||||
template<class T, int Rows, int Cols>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprBinOp<
|
||||
Fcnl_pow< std::complex<T>, std::complex<T> >,
|
||||
MatrixConstReference<std::complex<T>, Rows, Cols>,
|
||||
XprLiteral< std::complex<T> >
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
pow(const Matrix<std::complex<T>, Rows, Cols>& lhs, const std::complex<T>& rhs) {
|
||||
typedef XprBinOp<
|
||||
Fcnl_pow< std::complex<T>, std::complex<T> >,
|
||||
MatrixConstReference<std::complex<T>, Rows, Cols>,
|
||||
XprLiteral< std::complex<T> >
|
||||
> expr_type;
|
||||
return XprMatrix<expr_type, Rows, Cols>(
|
||||
expr_type(lhs.const_ref(), XprLiteral< std::complex<T> >(rhs)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn pow(const Matrix<std::complex<T>, Rows, Cols>& lhs, const T& rhs)
|
||||
* \ingroup _binary_function
|
||||
*/
|
||||
template<class T, int Rows, int Cols>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, T>,
|
||||
MatrixConstReference<std::complex<T>, Rows, Cols>,
|
||||
XprLiteral<T>
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
pow(const Matrix<std::complex<T>, Rows, Cols>& lhs, const T& rhs) {
|
||||
typedef XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, T>,
|
||||
MatrixConstReference<std::complex<T>, Rows, Cols>,
|
||||
XprLiteral<T>
|
||||
> expr_type;
|
||||
return XprMatrix<expr_type, Rows, Cols>(
|
||||
expr_type(lhs.const_ref(), XprLiteral<T>(rhs)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn pow(const Matrix<std::complex<T>, Rows, Cols>& lhs, int rhs)
|
||||
* \ingroup _binary_function
|
||||
*/
|
||||
template<class T, int Rows, int Cols>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, int>,
|
||||
MatrixConstReference<std::complex<T>, Rows, Cols>,
|
||||
XprLiteral<int>
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
pow(const Matrix<std::complex<T>, Rows, Cols>& lhs, int rhs) {
|
||||
typedef XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, int>,
|
||||
MatrixConstReference<std::complex<T>, Rows, Cols>,
|
||||
XprLiteral<int>
|
||||
> expr_type;
|
||||
return XprMatrix<expr_type, Rows, Cols>(
|
||||
expr_type(lhs.const_ref(), XprLiteral<int>(rhs)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn polar(const Matrix<T, Rows, Cols>& lhs, const T& rhs)
|
||||
* \ingroup _binary_function
|
||||
*/
|
||||
template<class T, int Rows, int Cols>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprBinOp<
|
||||
Fcnl_polar<T, T>,
|
||||
MatrixConstReference<T, Rows, Cols>,
|
||||
XprLiteral<T>
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
polar(const Matrix<T, Rows, Cols>& lhs, const T& rhs) {
|
||||
typedef XprBinOp<
|
||||
Fcnl_polar<T, T>,
|
||||
MatrixConstReference<T, Rows, Cols>,
|
||||
XprLiteral<T>
|
||||
> expr_type;
|
||||
return XprMatrix<expr_type, Rows, Cols>(
|
||||
expr_type(lhs.const_ref(), XprLiteral<T>(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:
|
@ -282,7 +282,7 @@ TVMET_IMPLEMENT_MACRO(double)
|
||||
* XprMatrix<E1, Rows, Cols> e1, std::complex<T> z2, XprMatrix<E3, Rows, Cols> e3
|
||||
* XprMatrix<E1, Rows, Cols> e1, XprMatrix<E2, Rows, Cols> e2, std::complex<T> z3
|
||||
*/
|
||||
#if defined(TVMET_HAVE_COMPLEX)
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
/**
|
||||
* \fn eval(const XprMatrix<E, Rows, Cols>& e, const std::complex<T>& x2, const std::complex<T>& x3)
|
||||
@ -366,7 +366,7 @@ eval(const XprMatrix<E1, Rows, Cols>& e1, const XprMatrix<E2, Rows, Cols>& e2, c
|
||||
return XprMatrix<expr_type, Rows, Cols>(
|
||||
expr_type(e1, e2, XprLiteral< std::complex<T> >(x3)));
|
||||
}
|
||||
#endif // defined(TVMET_HAVE_COMPLEX)
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
@ -59,7 +59,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME (const Matrix<T1, Rows, Cols>& lhs, \
|
||||
const Matrix<T2, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const Matrix<T2, Rows, Cols>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
@ -71,7 +71,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME (const XprMatrix<E, Rows, Cols>& lhs, \
|
||||
const Matrix<T, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const Matrix<T, Rows, Cols>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, class E, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
@ -83,7 +83,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME (const Matrix<T, Rows, Cols>& lhs, \
|
||||
const XprMatrix<E, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E, Rows, Cols>& 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<T, Rows, Cols>& lhs, \
|
||||
POD rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
POD rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
@ -123,7 +123,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME (POD lhs, \
|
||||
const Matrix<T, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Matrix<T, Rows, Cols>& 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<T, Rows, Cols>, complex<T>)
|
||||
* function(complex<T>, Matrix<T, Rows, Cols>)
|
||||
@ -161,7 +161,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME (const Matrix< std::complex<T>, Rows, Cols>& lhs, \
|
||||
const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const std::complex<T>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
@ -173,7 +173,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME (const std::complex<T>& lhs, \
|
||||
const Matrix< std::complex<T>, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Matrix< std::complex<T>, 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<T1, Rows1, Cols1>& lhs,
|
||||
const Matrix<T2, Cols1, Cols2>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Matrix<T2, Cols1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E1, int Rows1, int Cols1,
|
||||
@ -213,7 +213,7 @@ XprMatrix<
|
||||
Rows1, Cols2 // return Dim
|
||||
>
|
||||
prod(const XprMatrix<E1, Rows1, Cols1>& lhs,
|
||||
const Matrix<T2, Cols1, Cols2>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Matrix<T2, Cols1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T1, int Rows1, int Cols1,
|
||||
@ -226,7 +226,7 @@ XprMatrix<
|
||||
Rows1, Cols2 // return Dim
|
||||
>
|
||||
prod(const Matrix<T1, Rows1, Cols1>& lhs,
|
||||
const XprMatrix<E2, Cols1, Cols2>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E2, Cols1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T1, int Rows1, int Cols1,
|
||||
@ -239,7 +239,7 @@ XprMatrix<
|
||||
Cols2, Rows1 // return Dim
|
||||
>
|
||||
trans_prod(const Matrix<T1, Rows1, Cols1>& lhs,
|
||||
const Matrix<T2, Cols1, Cols2>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Matrix<T2, Cols1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T1, int Rows1, int Cols1,
|
||||
@ -252,7 +252,7 @@ XprMatrix<
|
||||
Cols1, Cols2 // return Dim
|
||||
>
|
||||
MtM_prod(const Matrix<T1, Rows1, Cols1>& lhs,
|
||||
const Matrix<T2, Rows1, Cols2>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Matrix<T2, Rows1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T1, int Rows1, int Cols1,
|
||||
@ -265,7 +265,7 @@ XprMatrix<
|
||||
Rows1, Rows2 // return Dim
|
||||
>
|
||||
MMt_prod(const Matrix<T1, Rows1, Cols1>& lhs,
|
||||
const Matrix<T2, Rows2, Cols1>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Matrix<T2, Rows2, Cols1>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@ -282,7 +282,7 @@ XprVector<
|
||||
Rows
|
||||
>
|
||||
prod(const Matrix<T1, Rows, Cols>& lhs,
|
||||
const Vector<T2, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Vector<T2, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T1, class E2, int Rows, int Cols>
|
||||
@ -294,7 +294,7 @@ XprVector<
|
||||
Rows
|
||||
>
|
||||
prod(const Matrix<T1, Rows, Cols>& lhs,
|
||||
const XprVector<E2, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E2, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E1, class T2, int Rows, int Cols>
|
||||
@ -306,7 +306,7 @@ XprVector<
|
||||
Rows
|
||||
>
|
||||
prod(const XprMatrix<E1, Rows, Cols>& lhs,
|
||||
const Vector<T2, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Vector<T2, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T1, class T2, int Rows, int Cols>
|
||||
@ -318,7 +318,7 @@ XprVector<
|
||||
Cols
|
||||
>
|
||||
Mtx_prod(const Matrix<T1, Rows, Cols>& lhs,
|
||||
const Vector<T2, Rows>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Vector<T2, Rows>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@ -333,12 +333,12 @@ XprMatrix<
|
||||
>,
|
||||
Cols, Rows
|
||||
>
|
||||
trans(const Matrix<T, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
trans(const Matrix<T, Rows, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
typename NumericTraits<T>::sum_type
|
||||
trace(const Matrix<T, Sz, Sz>& m) TVMET_CXX_ALWAYS_INLINE;
|
||||
trace(const Matrix<T, Sz, Sz>& m) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Rows, int Cols>
|
||||
@ -350,7 +350,7 @@ XprVector<
|
||||
Cols
|
||||
>
|
||||
row(const Matrix<T, Rows, Cols>& m,
|
||||
int no) TVMET_CXX_ALWAYS_INLINE;
|
||||
int no) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Rows, int Cols>
|
||||
@ -362,7 +362,7 @@ XprVector<
|
||||
Rows
|
||||
>
|
||||
col(const Matrix<T, Rows, Cols>& m,
|
||||
int no) TVMET_CXX_ALWAYS_INLINE;
|
||||
int no) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
@ -373,7 +373,7 @@ XprVector<
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
diag(const Matrix<T, Sz, Sz>& m) TVMET_CXX_ALWAYS_INLINE;
|
||||
diag(const Matrix<T, Sz, Sz>& m) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@ -383,40 +383,40 @@ diag(const Matrix<T, Sz, Sz>& m) TVMET_CXX_ALWAYS_INLINE;
|
||||
|
||||
template<class E, int Rows, int Cols>
|
||||
Extremum<typename E::value_type, int, matrix_tag>
|
||||
maximum(const XprMatrix<E, Rows, Cols>& e); // NOT TVMET_CXX_ALWAYS_INLINE;
|
||||
maximum(const XprMatrix<E, Rows, Cols>& e); // NOT _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Rows, int Cols>
|
||||
Extremum<T, int, matrix_tag>
|
||||
maximum(const Matrix<T, Rows, Cols>& m) TVMET_CXX_ALWAYS_INLINE;
|
||||
maximum(const Matrix<T, Rows, Cols>& m) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Rows, int Cols>
|
||||
Extremum<typename E::value_type, int, matrix_tag>
|
||||
minimum(const XprMatrix<E, Rows, Cols>& e); // NOT TVMET_CXX_ALWAYS_INLINE;
|
||||
minimum(const XprMatrix<E, Rows, Cols>& e); // NOT _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Rows, int Cols>
|
||||
Extremum<T, int, matrix_tag>
|
||||
minimum(const Matrix<T, Rows, Cols>& m) TVMET_CXX_ALWAYS_INLINE;
|
||||
minimum(const Matrix<T, Rows, Cols>& m) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Rows, int Cols>
|
||||
typename E::value_type
|
||||
max(const XprMatrix<E, Rows, Cols>& e); // NOT TVMET_CXX_ALWAYS_INLINE;
|
||||
max(const XprMatrix<E, Rows, Cols>& e); // NOT _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Rows, int Cols>
|
||||
T max(const Matrix<T, Rows, Cols>& m) TVMET_CXX_ALWAYS_INLINE;
|
||||
T max(const Matrix<T, Rows, Cols>& m) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Rows, int Cols>
|
||||
typename E::value_type
|
||||
min(const XprMatrix<E, Rows, Cols>& e); // NOT TVMET_CXX_ALWAYS_INLINE;
|
||||
min(const XprMatrix<E, Rows, Cols>& e); // NOT _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Rows, int Cols>
|
||||
T min(const Matrix<T, Rows, Cols>& m) TVMET_CXX_ALWAYS_INLINE;
|
||||
T min(const Matrix<T, Rows, Cols>& m) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@ -429,7 +429,7 @@ XprMatrix<
|
||||
XprIdentity<T, Rows, Cols>,
|
||||
Rows, Cols
|
||||
>
|
||||
identity() TVMET_CXX_ALWAYS_INLINE;
|
||||
identity() _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class M>
|
||||
@ -439,7 +439,7 @@ XprMatrix<
|
||||
M::Rows, M::Cols>,
|
||||
M::Rows, M::Cols
|
||||
>
|
||||
identity() TVMET_CXX_ALWAYS_INLINE;
|
||||
identity() _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Rows, int Cols>
|
||||
@ -447,7 +447,7 @@ XprMatrix<
|
||||
MatrixConstReference<T, Rows, Cols>,
|
||||
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<T, Rows, Cols>, complex<T>)
|
||||
* function(complex<T>, Matrix<T, Rows, Cols>)
|
||||
@ -657,7 +657,7 @@ TVMET_IMPLEMENT_MACRO(div)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
#endif // defined(TVMET_HAVE_COMPLEX)
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
@ -34,7 +34,7 @@ namespace tvmet {
|
||||
|
||||
template<class T, int Rows, int Cols>
|
||||
std::ostream& operator<<(std::ostream& os,
|
||||
const Matrix<T, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Matrix<T, Rows, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@ -52,12 +52,12 @@ std::ostream& operator<<(std::ostream& os,
|
||||
template<class T1, class T2, int Rows, int Cols> \
|
||||
Matrix<T1, Rows, Cols>& \
|
||||
operator OP (Matrix<T1, Rows, Cols>& lhs, \
|
||||
const Matrix<T2, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const Matrix<T2, Rows, Cols>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, class E, int Rows, int Cols> \
|
||||
Matrix<T, Rows, Cols>& \
|
||||
operator OP (Matrix<T, Rows, Cols>& lhs, \
|
||||
const XprMatrix<E, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E, Rows, Cols>& 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<T1, Rows, Cols>& lhs, \
|
||||
const Matrix<T2, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const Matrix<T2, Rows, Cols>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
@ -104,7 +104,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const XprMatrix<E, Rows, Cols>& lhs, \
|
||||
const Matrix<T, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const Matrix<T, Rows, Cols>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, class E, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
@ -116,7 +116,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const Matrix<T, Rows, Cols>& lhs, \
|
||||
const XprMatrix<E, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E, Rows, Cols>& 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<T, Rows, Cols>& lhs, \
|
||||
POD rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
POD rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
@ -155,7 +155,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (POD lhs, \
|
||||
const Matrix<T, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Matrix<T, Rows, Cols>& 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<T, Rows, Cols>, complex<T>)
|
||||
* operator(complex<T>, Matrix<T, Rows, Cols>)
|
||||
@ -193,7 +193,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const Matrix< std::complex<T>, Rows, Cols>& lhs, \
|
||||
const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const std::complex<T>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
@ -205,7 +205,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const std::complex<T>& lhs, \
|
||||
const Matrix< std::complex<T>, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Matrix< std::complex<T>, 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<T1, Rows1, Cols1>& lhs,
|
||||
const Matrix<T2, Cols1, Cols2>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Matrix<T2, Cols1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E1, int Rows1, int Cols1,
|
||||
@ -245,7 +245,7 @@ XprMatrix<
|
||||
Rows1, Cols2
|
||||
>
|
||||
operator*(const XprMatrix<E1, Rows1, Cols1>& lhs,
|
||||
const Matrix<T2, Cols1, Cols2>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Matrix<T2, Cols1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T1, int Rows1, int Cols1,
|
||||
@ -258,7 +258,7 @@ XprMatrix<
|
||||
Rows1, Cols2
|
||||
>
|
||||
operator*(const Matrix<T1, Rows1, Cols1>& lhs,
|
||||
const XprMatrix<E2, Cols1, Cols2>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E2, Cols1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@ -275,7 +275,7 @@ XprVector<
|
||||
Rows
|
||||
>
|
||||
operator*(const Matrix<T1, Rows, Cols>& lhs,
|
||||
const Vector<T2, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Vector<T2, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T1, class E2, int Rows, int Cols>
|
||||
@ -287,7 +287,7 @@ XprVector<
|
||||
Rows
|
||||
>
|
||||
operator*(const Matrix<T1, Rows, Cols>& lhs,
|
||||
const XprVector<E2, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E2, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E1, class T2, int Rows, int Cols>
|
||||
@ -299,7 +299,7 @@ XprVector<
|
||||
Rows
|
||||
>
|
||||
operator*(const XprMatrix<E1, Rows, Cols>& lhs,
|
||||
const Vector<T2, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Vector<T2, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@ -320,7 +320,7 @@ XprMatrix< \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const Matrix<T, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
operator OP (const Matrix<T, Rows, Cols>& 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<T, Rows, Cols>, complex<T>)
|
||||
* operator(complex<T>, Matrix<T, Rows, Cols>)
|
||||
@ -540,7 +540,7 @@ TVMET_IMPLEMENT_MACRO(div, /)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
#endif // defined(TVMET_HAVE_COMPLEX)
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
@ -29,7 +29,7 @@ namespace tvmet {
|
||||
/*
|
||||
* unary_function(Matrix<std::complex<T>, Rows, Cols>)
|
||||
*/
|
||||
#if defined(TVMET_HAVE_COMPLEX)
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
#define TVMET_DECLARE_MACRO(NAME) \
|
||||
template<class T, int Rows, int Cols> \
|
||||
inline \
|
||||
@ -40,7 +40,7 @@ XprMatrix< \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const Matrix<std::complex<T>, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
NAME(const Matrix<std::complex<T>, 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<std::complex<T>, Rows, Cols>)
|
||||
*/
|
||||
#if defined(TVMET_HAVE_COMPLEX)
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T, int Rows, int Cols> \
|
||||
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
|
||||
|
@ -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 <complex>
|
||||
#endif
|
||||
#include <cmath>
|
||||
@ -352,7 +352,7 @@ struct NumericTraits<double> {
|
||||
/*
|
||||
* numeric traits for complex types
|
||||
*/
|
||||
#if defined(TVMET_HAVE_COMPLEX)
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
/**
|
||||
* \class NumericTraits< std::complex<int> > NumericTraits.h "tvmet/NumericTraits.h"
|
||||
@ -577,7 +577,7 @@ struct NumericTraits< std::complex<double> > {
|
||||
};
|
||||
|
||||
|
||||
#endif // defined(TVMET_HAVE_COMPLEX)
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
@ -67,11 +67,11 @@ TVMET_PRECISION(double, 800)
|
||||
/*
|
||||
* complex types
|
||||
*/
|
||||
#if defined(TVMET_HAVE_COMPLEX)
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
TVMET_PRECISION(std::complex<int>, 1000)
|
||||
TVMET_PRECISION(std::complex<float>, 1600)
|
||||
TVMET_PRECISION(std::complex<double>, 1700)
|
||||
#endif // defined(TVMET_HAVE_COMPLEX)
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/** \class PrecisionTraits<int> TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
|
@ -54,7 +54,7 @@ TVMET_IMPLEMENT_MACRO(neg, -)
|
||||
*/
|
||||
|
||||
|
||||
#if defined(TVMET_HAVE_COMPLEX)
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
/**
|
||||
* \class Fcnl_conj< std::complex<T> > 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
|
||||
|
||||
|
@ -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 <class T2> Vector& M_add_eq(const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& M_sub_eq(const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& M_mul_eq(const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& M_div_eq(const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& M_mod_eq(const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& M_xor_eq(const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& M_and_eq(const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& M_or_eq (const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& M_shl_eq(const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& M_shr_eq(const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& M_add_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& M_sub_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& M_mul_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& M_div_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& M_mod_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& M_xor_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& M_and_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& M_or_eq (const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& M_shl_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& M_shr_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
|
||||
public: // math operators with expressions
|
||||
// NOTE: access using the operators in ns element_wise, since that's what is does
|
||||
template <class E> Vector& M_add_eq(const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& M_sub_eq(const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& M_mul_eq(const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& M_div_eq(const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& M_mod_eq(const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& M_xor_eq(const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& M_and_eq(const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& M_or_eq (const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& M_shl_eq(const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& M_shr_eq(const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& M_add_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& M_sub_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& M_mul_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& M_div_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& M_mod_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& M_xor_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& M_and_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& M_or_eq (const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& M_shl_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& M_shr_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
|
||||
public: // aliased math operators with expressions, used with proxy
|
||||
template <class T2> Vector& alias_assign(const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& alias_add_eq(const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& alias_sub_eq(const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& alias_mul_eq(const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& alias_div_eq(const Vector<T2, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class T2> Vector& alias_assign(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& alias_add_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& alias_sub_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& alias_mul_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& alias_div_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
|
||||
template <class E> Vector& alias_assign(const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& alias_add_eq(const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& alias_sub_eq(const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& alias_mul_eq(const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& alias_div_eq(const XprVector<E, Size>&) TVMET_CXX_ALWAYS_INLINE;
|
||||
template <class E> Vector& alias_assign(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& alias_add_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& alias_sub_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& alias_mul_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& alias_div_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
|
||||
public: // io
|
||||
/** Structure for info printing as Vector<T, Size>. */
|
||||
@ -503,7 +503,6 @@ typedef Vector<double, 4> Vector4d;
|
||||
|
||||
#include <tvmet/VectorImpl.h>
|
||||
#include <tvmet/VectorFunctions.h>
|
||||
#include <tvmet/VectorBinaryFunctions.h>
|
||||
#include <tvmet/VectorUnaryFunctions.h>
|
||||
#include <tvmet/VectorOperators.h>
|
||||
#include <tvmet/VectorEval.h>
|
||||
|
@ -1,490 +0,0 @@
|
||||
/*
|
||||
* Tiny Vector Matrix Library
|
||||
* Dense Vector Matrix Libary of Tiny size using Expression Templates
|
||||
*
|
||||
* Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net>
|
||||
*
|
||||
* 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 <tvmet/NumericTraits.h>
|
||||
#include <tvmet/Extremum.h>
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
|
||||
/*********************************************************
|
||||
* PART I: DECLARATION
|
||||
*********************************************************/
|
||||
|
||||
/*
|
||||
* binary_function(Vector<T1, Sz>, Vector<T1, Sz>)
|
||||
* binary_function(Vector<T, Sz>, XprVector<E>)
|
||||
* binary_function(XprVector<E>, Vector<T, Sz>)
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME) \
|
||||
template<class T1, class T2, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T1, T2>, \
|
||||
VectorConstReference<T1, Sz>, \
|
||||
VectorConstReference<T2, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const Vector<T1, Sz>& lhs, \
|
||||
const Vector<T2, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
VectorConstReference<T, Sz>, \
|
||||
XprVector<E, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const XprVector<E, Sz>& lhs, \
|
||||
const Vector<T, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T, typename E::value_type>, \
|
||||
VectorConstReference<T, Sz>, \
|
||||
XprVector<E, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const Vector<T, Sz>& lhs, \
|
||||
const XprVector<E, Sz>& 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<T, Sz>, POD)
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, TP) \
|
||||
template<class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T, TP >, \
|
||||
VectorConstReference<T, Sz>, \
|
||||
XprLiteral< TP > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const Vector<T, Sz>& 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<class T, int Sz>
|
||||
XprVector<
|
||||
XprBinOp<
|
||||
Fcnl_pow<T, std::complex<T> >,
|
||||
VectorConstReference<T, Sz>,
|
||||
XprLiteral< std::complex<T> >
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
pow(const Vector<T, Sz>& lhs,
|
||||
const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
XprVector<
|
||||
XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, std::complex<T> >,
|
||||
VectorConstReference<std::complex<T>, Sz>,
|
||||
XprLiteral< std::complex<T> >
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
pow(const Vector<std::complex<T>, Sz>& lhs,
|
||||
const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
XprVector<
|
||||
XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, T>,
|
||||
VectorConstReference<std::complex<T>, Sz>,
|
||||
XprLiteral<T>
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
pow(const Vector<std::complex<T>, Sz>& lhs,
|
||||
const T& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
XprVector<
|
||||
XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, int>,
|
||||
VectorConstReference<std::complex<T>, Sz>,
|
||||
XprLiteral<int>
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
pow(const Vector<std::complex<T>, Sz>& lhs,
|
||||
int rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
XprVector<
|
||||
XprBinOp<
|
||||
Fcnl_polar<T, T>,
|
||||
VectorConstReference<T, Sz>,
|
||||
XprLiteral<T>
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
polar(const Vector<T, Sz>& 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<T1, Sz>, Vector<T1, Sz>)
|
||||
* binary_function(Vector<T, Sz>, XprVector<E>)
|
||||
* binary_function(XprVector<E>, Vector<T, Sz>)
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T1, class T2, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T1, T2>, \
|
||||
VectorConstReference<T1, Sz>, \
|
||||
VectorConstReference<T2, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const Vector<T1, Sz>& lhs, const Vector<T2, Sz>& rhs) { \
|
||||
typedef XprBinOp < \
|
||||
Fcnl_##NAME<T1, T2>, \
|
||||
VectorConstReference<T1, Sz>, \
|
||||
VectorConstReference<T2, Sz> \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
expr_type(lhs.const_ref(), rhs.const_ref())); \
|
||||
} \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
VectorConstReference<T, Sz>, \
|
||||
XprVector<E, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const XprVector<E, Sz>& lhs, const Vector<T, Sz>& rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
XprVector<E, Sz>, \
|
||||
VectorConstReference<T, Sz> \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
expr_type(lhs, rhs.const_ref())); \
|
||||
} \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T, typename E::value_type>, \
|
||||
VectorConstReference<T, Sz>, \
|
||||
XprVector<E, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const Vector<T, Sz>& lhs, const XprVector<E, Sz>& rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<T, typename E::value_type>, \
|
||||
VectorConstReference<T, Sz>, \
|
||||
XprVector<E, Sz> \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
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<T, Sz>, POD)
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, TP) \
|
||||
template<class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T, TP >, \
|
||||
VectorConstReference<T, Sz>, \
|
||||
XprLiteral< TP > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const Vector<T, Sz>& lhs, TP rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<T, TP >, \
|
||||
VectorConstReference<T, Sz>, \
|
||||
XprLiteral< TP > \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
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<T, Sz>& lhs, const std::complex<T>& rhs)
|
||||
* \ingroup _binary_function
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
XprVector<
|
||||
XprBinOp<
|
||||
Fcnl_pow<T, std::complex<T> >,
|
||||
VectorConstReference<T, Sz>,
|
||||
XprLiteral< std::complex<T> >
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
pow(const Vector<T, Sz>& lhs, const std::complex<T>& rhs) {
|
||||
typedef XprBinOp<
|
||||
Fcnl_pow<T, std::complex<T> >,
|
||||
VectorConstReference<T, Sz>,
|
||||
XprLiteral< std::complex<T> >
|
||||
> expr_type;
|
||||
return XprVector<expr_type, Sz>(
|
||||
expr_type(lhs.const_ref(), XprLiteral< std::complex<T> >(rhs)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn pow(const Vector<std::complex<T>, Sz>& lhs, const std::complex<T>& rhs)
|
||||
* \ingroup _binary_function
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
XprVector<
|
||||
XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, std::complex<T> >,
|
||||
VectorConstReference<std::complex<T>, Sz>,
|
||||
XprLiteral< std::complex<T> >
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
pow(const Vector<std::complex<T>, Sz>& lhs, const std::complex<T>& rhs) {
|
||||
typedef XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, std::complex<T> >,
|
||||
VectorConstReference<std::complex<T>, Sz>,
|
||||
XprLiteral< std::complex<T> >
|
||||
> expr_type;
|
||||
return XprVector<expr_type, Sz>(
|
||||
expr_type(lhs.const_ref(), XprLiteral< std::complex<T> >(rhs)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn pow(const Vector<std::complex<T>, Sz>& lhs, const T& rhs)
|
||||
* \ingroup _binary_function
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
XprVector<
|
||||
XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, T>,
|
||||
VectorConstReference<std::complex<T>, Sz>,
|
||||
XprLiteral<T>
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
pow(const Vector<std::complex<T>, Sz>& lhs, const T& rhs) {
|
||||
typedef XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, T>,
|
||||
VectorConstReference<std::complex<T>, Sz>,
|
||||
XprLiteral<T>
|
||||
> expr_type;
|
||||
return XprVector<expr_type, Sz>(
|
||||
expr_type(lhs.const_ref(), XprLiteral<T>(rhs)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn pow(const Vector<std::complex<T>, Sz>& lhs, int rhs)
|
||||
* \ingroup _binary_function
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
XprVector<
|
||||
XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, int>,
|
||||
VectorConstReference<std::complex<T>, Sz>,
|
||||
XprLiteral<int>
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
pow(const Vector<std::complex<T>, Sz>& lhs, int rhs) {
|
||||
typedef XprBinOp<
|
||||
Fcnl_pow<std::complex<T>, int>,
|
||||
VectorConstReference<std::complex<T>, Sz>,
|
||||
XprLiteral<int>
|
||||
> expr_type;
|
||||
return XprVector<expr_type, Sz>(
|
||||
expr_type(lhs.const_ref(), XprLiteral<int>(rhs)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn polar(const Vector<T, Sz>& lhs, const T& rhs)
|
||||
* \ingroup _binary_function
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
XprVector<
|
||||
XprBinOp<
|
||||
Fcnl_polar<T, T>,
|
||||
VectorConstReference<T, Sz>,
|
||||
XprLiteral<T>
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
polar(const Vector<T, Sz>& lhs, const T& rhs) {
|
||||
typedef XprBinOp<
|
||||
Fcnl_polar<T, T>,
|
||||
VectorConstReference<T, Sz>,
|
||||
XprLiteral<T>
|
||||
> expr_type;
|
||||
return XprVector<expr_type, Sz>(
|
||||
expr_type(lhs.const_ref(), XprLiteral<T>(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:
|
@ -278,7 +278,7 @@ TVMET_IMPLEMENT_MACRO(double)
|
||||
* XprVector<E1, Sz> e1, std::complex<T> z2, XprVector<E3, Sz> e3
|
||||
* XprVector<E1, Sz> e1, XprVector<E2, Sz> e2, std::complex<T> z3
|
||||
*/
|
||||
#if defined(TVMET_HAVE_COMPLEX)
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/**
|
||||
@ -361,7 +361,7 @@ eval(const XprVector<E1, Sz>& e1, const XprVector<E2, Sz>& e2, std::complex<T> z
|
||||
return XprVector<expr_type, Sz>(
|
||||
expr_type(e1, e2, XprLiteral< std::complex<T> >(z3)));
|
||||
}
|
||||
#endif // defined(TVMET_HAVE_COMPLEX)
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
@ -55,7 +55,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const Vector<T1, Sz>& lhs, \
|
||||
const Vector<T2, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const Vector<T2, Sz>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
XprVector< \
|
||||
@ -67,7 +67,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const XprVector<E, Sz>& lhs, \
|
||||
const Vector<T, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const Vector<T, Sz>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
XprVector< \
|
||||
@ -79,7 +79,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const Vector<T, Sz>& lhs, \
|
||||
const XprVector<E, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E, Sz>& 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<T, Sz>& lhs, \
|
||||
POD rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
POD rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, int Sz> \
|
||||
XprVector< \
|
||||
@ -119,7 +119,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
NAME (POD lhs, \
|
||||
const Vector<T, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Vector<T, Sz>& 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<std::complex<T>, Sz>, std::complex<T>)
|
||||
* function(std::complex<T>, Vector<std::complex<T>, Sz>)
|
||||
@ -157,7 +157,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const Vector<std::complex<T>, Sz>& lhs, \
|
||||
const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const std::complex<T>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, int Sz> \
|
||||
XprVector< \
|
||||
@ -169,7 +169,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const std::complex<T>& lhs, \
|
||||
const Vector< std::complex<T>, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Vector< std::complex<T>, 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<class T, int Sz>
|
||||
typename NumericTraits<T>::sum_type
|
||||
sum(const Vector<T, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
sum(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
typename NumericTraits<T>::sum_type
|
||||
product(const Vector<T, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
product(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T1, class T2, int Sz>
|
||||
typename PromoteTraits<T1, T2>::value_type
|
||||
dot(const Vector<T1, Sz>& lhs,
|
||||
const Vector<T2, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Vector<T2, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T1, class T2>
|
||||
Vector<typename PromoteTraits<T1, T2>::value_type, 3>
|
||||
cross(const Vector<T1, 3>& lhs,
|
||||
const Vector<T2, 3>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Vector<T2, 3>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
typename NumericTraits<T>::sum_type
|
||||
norm1(const Vector<T, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
norm1(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
typename NumericTraits<T>::sum_type
|
||||
norm2(const Vector<T, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
norm2(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
@ -227,7 +227,7 @@ XprVector<
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
normalize(const Vector<T, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
normalize(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@ -236,40 +236,40 @@ normalize(const Vector<T, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
|
||||
template<class E, int Sz>
|
||||
Extremum<typename E::value_type, int, vector_tag>
|
||||
maximum(const XprVector<E, Sz>& e); // NOT TVMET_CXX_ALWAYS_INLINE;
|
||||
maximum(const XprVector<E, Sz>& e); // NOT _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
Extremum<T, int, vector_tag>
|
||||
maximum(const Vector<T, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
maximum(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Sz>
|
||||
Extremum<typename E::value_type, int, vector_tag>
|
||||
minimum(const XprVector<E, Sz>& e); // NOT TVMET_CXX_ALWAYS_INLINE;
|
||||
minimum(const XprVector<E, Sz>& e); // NOT _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
Extremum<T, int, vector_tag>
|
||||
minimum(const Vector<T, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
minimum(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Sz>
|
||||
typename E::value_type
|
||||
max(const XprVector<E, Sz>& e); // NOT TVMET_CXX_ALWAYS_INLINE;
|
||||
max(const XprVector<E, Sz>& e); // NOT _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
T max(const Vector<T, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
T max(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Sz>
|
||||
typename E::value_type
|
||||
min(const XprVector<E, Sz>& e); // NOT TVMET_CXX_ALWAYS_INLINE;
|
||||
min(const XprVector<E, Sz>& e); // NOT _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
T min(const Vector<T, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
T min(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
@ -277,7 +277,7 @@ XprVector<
|
||||
VectorConstReference<T, Sz>,
|
||||
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<std::complex<T>, Sz>, std::complex<T>)
|
||||
* function(std::complex<T>, Vector<std::complex<T>, Sz>)
|
||||
@ -485,7 +485,7 @@ TVMET_IMPLEMENT_MACRO(div)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
#endif // defined(TVMET_HAVE_COMPLEX)
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
@ -35,7 +35,7 @@ namespace tvmet {
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
std::ostream& operator<<(std::ostream& os,
|
||||
const Vector<T, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Vector<T, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@ -52,12 +52,12 @@ std::ostream& operator<<(std::ostream& os,
|
||||
template<class T1, class T2, int Sz> \
|
||||
Vector<T1, Sz>& \
|
||||
operator OP (Vector<T1, Sz>& lhs, \
|
||||
const Vector<T2, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const Vector<T2, Sz>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, class E, int Sz> \
|
||||
Vector<T, Sz>& \
|
||||
operator OP (Vector<T, Sz>& lhs, \
|
||||
const XprVector<E, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E, Sz>& 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<T1, Sz>& lhs, \
|
||||
const Vector<T2, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const Vector<T2, Sz>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
XprVector< \
|
||||
@ -103,7 +103,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const XprVector<E, Sz>& lhs, \
|
||||
const Vector<T, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const Vector<T, Sz>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
XprVector< \
|
||||
@ -115,7 +115,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const Vector<T, Sz>& lhs, \
|
||||
const XprVector<E, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E, Sz>& 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<T, Sz>& lhs, \
|
||||
POD rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
POD rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, int Sz> \
|
||||
XprVector< \
|
||||
@ -155,7 +155,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (POD lhs, \
|
||||
const Vector<T, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Vector<T, Sz>& 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<std::complex<T>, Sz>, std::complex<T>)
|
||||
* operator(std::complex<T>, Vector<std::complex<T>, Sz>)
|
||||
@ -193,7 +193,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const Vector<std::complex<T>, Sz>& lhs, \
|
||||
const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const std::complex<T>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, int Sz> \
|
||||
XprVector< \
|
||||
@ -205,7 +205,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const std::complex<T>& lhs, \
|
||||
const Vector< std::complex<T>, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Vector< std::complex<T>, 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<T, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
operator OP (const Vector<T, Sz>& 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<std::complex<T>, Sz>, std::complex<T>)
|
||||
* operator(std::complex<T>, Vector<std::complex<T>, 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)
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
@ -34,7 +34,7 @@ namespace tvmet {
|
||||
/*
|
||||
* unary_function(Vector<std::complex<T>, Sz>)
|
||||
*/
|
||||
#if defined(TVMET_HAVE_COMPLEX)
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
#define TVMET_DECLARE_MACRO(NAME) \
|
||||
template<class T, int Sz> \
|
||||
XprVector< \
|
||||
@ -44,7 +44,7 @@ XprVector< \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const Vector<std::complex<T>, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
NAME(const Vector<std::complex<T>, 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<std::complex<T>, Sz>)
|
||||
*/
|
||||
#if defined(TVMET_HAVE_COMPLEX)
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T, int Sz> \
|
||||
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
|
||||
|
@ -1,21 +1,6 @@
|
||||
#ifndef _INCLUDE_TVMET_CONFIG_H
|
||||
#define _INCLUDE_TVMET_CONFIG_H
|
||||
|
||||
/* define if the compiler has complex<T> */
|
||||
#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 <sys/time.h> header file. */
|
||||
#cmakedefine TVMET_HAVE_SYS_TIME_H 1
|
||||
|
||||
|
@ -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 <code>DEBUG</code> is defined. This enables runtime error
|
||||
* bounds checking. If you compile %tvmet from another source directory
|
||||
* which defines <code>DEBUG</code>, then <code>TVMET_DEBUG</code> will be
|
||||
* <b>not</b> 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
|
||||
* <tt>__attribute__((always_inline))</tt>. 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 T> class complex;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#if defined(TVMET_HAVE_COMPLEX)
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
/**
|
||||
* \class Incrementor< std::complex<T> > Incrementor.h "tvmet/util/Incrementor.h"
|
||||
* \brief Specialized Incrementor class.
|
||||
@ -76,7 +76,7 @@ struct Incrementor< std::complex<T> > {
|
||||
private:
|
||||
std::complex<T> m_inc;
|
||||
};
|
||||
#endif // defined(TVMET_HAVE_COMPLEX)
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
} // namespace util
|
||||
|
@ -65,7 +65,7 @@ template<class T, int MIN, int MAX>
|
||||
unsigned int Random<T, MIN, MAX>::s_seed;
|
||||
|
||||
|
||||
#if defined(TVMET_HAVE_COMPLEX)
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
/**
|
||||
* \class Random< std::complex<T> > Random.h "tvmet/util/Random.h"
|
||||
* \brief Specialized Random class.
|
||||
@ -86,7 +86,7 @@ public:
|
||||
// instance
|
||||
template<class T, int MIN, int MAX>
|
||||
unsigned int Random<std::complex<T>, MIN, MAX>::s_seed;
|
||||
#endif // defined(TVMET_HAVE_COMPLEX)
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
} // namespace util
|
||||
|
@ -154,7 +154,6 @@ private:
|
||||
#include <tvmet/xpr/MatrixTranspose.h>
|
||||
|
||||
#include <tvmet/xpr/MatrixFunctions.h>
|
||||
#include <tvmet/xpr/MatrixBinaryFunctions.h>
|
||||
#include <tvmet/xpr/MatrixOperators.h>
|
||||
#include <tvmet/xpr/Eval.h>
|
||||
|
||||
|
@ -1,277 +0,0 @@
|
||||
/*
|
||||
* Tiny Vector Matrix Library
|
||||
* Dense Vector Matrix Libary of Tiny size using Expression Templates
|
||||
*
|
||||
* Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net>
|
||||
*
|
||||
* 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<E1, Rows, Cols>, XprMatrix<E2, Rows, Cols>)
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME) \
|
||||
template<class E1, int Rows, int Cols, class E2> \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \
|
||||
XprMatrix<E1, Rows, Cols>, \
|
||||
XprMatrix<E2, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const XprMatrix<E1, Rows, Cols>& lhs, \
|
||||
const XprMatrix<E2, Rows, Cols>& 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<E, Rows, Cols>, POD)
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, TP) \
|
||||
template<class E, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, TP >, \
|
||||
XprMatrix<E, Rows, Cols>, \
|
||||
XprLiteral< TP > \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const XprMatrix<E, Rows, Cols>& 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<E, Rows, Cols>, std::complex<>)
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME) \
|
||||
template<class E, int Rows, int Cols, class T> \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, std::complex<T> >, \
|
||||
XprMatrix<E, Rows, Cols>, \
|
||||
XprLiteral< std::complex<T> > \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const XprMatrix<E, Rows, Cols>& lhs, \
|
||||
const std::complex<T>& 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<E1, Rows, Cols>, XprMatrix<E2, Rows, Cols>)
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class E1, int Rows, int Cols, class E2> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \
|
||||
XprMatrix<E1, Rows, Cols>, \
|
||||
XprMatrix<E2, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const XprMatrix<E1, Rows, Cols>& lhs, const XprMatrix<E2, Rows, Cols>& rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \
|
||||
XprMatrix<E1, Rows, Cols>, \
|
||||
XprMatrix<E2, Rows, Cols> \
|
||||
> expr_type; \
|
||||
return XprMatrix<expr_type, Rows, Cols>( \
|
||||
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<E, Rows, Cols>, POD)
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, TP) \
|
||||
template<class E, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, TP >, \
|
||||
XprMatrix<E, Rows, Cols>, \
|
||||
XprLiteral< TP > \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const XprMatrix<E, Rows, Cols>& lhs, TP rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, TP >, \
|
||||
XprMatrix<E, Rows, Cols>, \
|
||||
XprLiteral< TP > \
|
||||
> expr_type; \
|
||||
return XprMatrix<expr_type, Rows, Cols>( \
|
||||
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<E, Rows, Cols>, std::complex<>)
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class E, int Rows, int Cols, class T> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, std::complex<T> >, \
|
||||
XprMatrix<E, Rows, Cols>, \
|
||||
XprLiteral< std::complex<T> > \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const XprMatrix<E, Rows, Cols>& lhs, const std::complex<T>& rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, std::complex<T> >, \
|
||||
XprMatrix<E, Rows, Cols>, \
|
||||
XprLiteral< std::complex<T> > \
|
||||
> expr_type; \
|
||||
return XprMatrix<expr_type, Rows, Cols>( \
|
||||
expr_type(lhs, XprLiteral< std::complex<T> >(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:
|
@ -61,7 +61,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME (const XprMatrix<E1, Rows, Cols>& lhs, \
|
||||
const XprMatrix<E2, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E2, Rows, Cols>& 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<E, Rows, Cols>& lhs, \
|
||||
POD rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
POD rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
@ -101,7 +101,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME (POD lhs, \
|
||||
const XprMatrix<E, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E, Rows, Cols>& 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<E, Rows, Cols>, complex<T>)
|
||||
* function(complex<T>, XprMatrix<E, Rows, Cols>)
|
||||
@ -139,7 +139,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME (const XprMatrix<E, Rows, Cols>& lhs, \
|
||||
const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const std::complex<T>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, class E, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
@ -151,7 +151,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME (const std::complex<T>& lhs, \
|
||||
const XprMatrix<E, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E, Rows, Cols>& 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<E1, Rows1, Cols1>& lhs,
|
||||
const XprMatrix<E2, Cols1, Cols2>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E2, Cols1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E1, int Rows1, int Cols1,
|
||||
@ -191,7 +191,7 @@ XprMatrix<
|
||||
Cols2, Rows1 // return Dim
|
||||
>
|
||||
trans_prod(const XprMatrix<E1, Rows1, Cols1>& lhs,
|
||||
const XprMatrix<E2, Cols1, Cols2>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E2, Cols1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E1, int Rows1, int Cols1,
|
||||
@ -204,7 +204,7 @@ XprMatrix<
|
||||
Cols1, Cols2 // return Dim
|
||||
>
|
||||
MtM_prod(const XprMatrix<E1, Rows1, Cols1>& lhs,
|
||||
const XprMatrix<E2, Rows1, Cols2>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E2, Rows1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E1, int Rows1, int Cols1,
|
||||
@ -217,7 +217,7 @@ XprMatrix<
|
||||
Rows1, Rows2 // return Dim
|
||||
>
|
||||
MMt_prod(const XprMatrix<E1, Rows1, Cols1>& lhs,
|
||||
const XprMatrix<E2, Rows2, Cols1>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E2, Rows2, Cols1>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@ -235,7 +235,7 @@ XprVector<
|
||||
Rows
|
||||
>
|
||||
prod(const XprMatrix<E1, Rows, Cols>& lhs,
|
||||
const XprVector<E2, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E2, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@ -250,13 +250,13 @@ XprMatrix<
|
||||
>,
|
||||
Cols, Rows
|
||||
>
|
||||
trans(const XprMatrix<E, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
trans(const XprMatrix<E, Rows, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
#if 0 // XXX needs declaration of meta::Matrix<Sz, Sz, 0, 0>::trace
|
||||
template<class E, int Sz>
|
||||
typename NumericTraits<typename E::value_type>::sum_type
|
||||
trace(const XprMatrix<E, Sz, Sz>& m)TVMET_CXX_ALWAYS_INLINE;
|
||||
trace(const XprMatrix<E, Sz, Sz>& m)_tvmet_always_inline;
|
||||
#endif
|
||||
|
||||
|
||||
@ -269,7 +269,7 @@ XprVector<
|
||||
Cols
|
||||
>
|
||||
row(const XprMatrix<E, Rows, Cols>& m,
|
||||
int no) TVMET_CXX_ALWAYS_INLINE;
|
||||
int no) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Rows, int Cols>
|
||||
@ -280,7 +280,7 @@ XprVector<
|
||||
>,
|
||||
Rows
|
||||
>
|
||||
col(const XprMatrix<E, Rows, Cols>& m, int no) TVMET_CXX_ALWAYS_INLINE;
|
||||
col(const XprMatrix<E, Rows, Cols>& m, int no) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Sz>
|
||||
@ -291,7 +291,7 @@ XprVector<
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
diag(const XprMatrix<E, Sz, Sz>& m) TVMET_CXX_ALWAYS_INLINE;
|
||||
diag(const XprMatrix<E, Sz, Sz>& 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<E, Rows, Cols>, complex<T>)
|
||||
* function(complex<T>, XprMatrix<E, Rows, Cols>)
|
||||
@ -459,7 +459,7 @@ TVMET_IMPLEMENT_MACRO(div)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
#endif // defined(TVMET_HAVE_COMPLEX)
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
@ -57,7 +57,7 @@ XprMatrix< \
|
||||
Rows1, Cols1 \
|
||||
> \
|
||||
operator OP (const XprMatrix<E1, Rows1, Cols1>& lhs, \
|
||||
const XprMatrix<E2, Rows1, Cols1>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E2, Rows1, Cols1>& 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<E, Rows, Cols>& lhs, \
|
||||
POD rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
POD rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E,int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
@ -96,7 +96,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (POD lhs, \
|
||||
const XprMatrix<E, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E, Rows, Cols>& 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<E, Rows, Cols>, complex<>)
|
||||
* operator(complex<>, XprMatrix<E, Rows, Cols>)
|
||||
@ -134,7 +134,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const XprMatrix<E, Rows, Cols>& lhs, \
|
||||
const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const std::complex<T>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, int Rows, int Cols, class T> \
|
||||
XprMatrix< \
|
||||
@ -146,7 +146,7 @@ XprMatrix< \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const std::complex<T>& lhs, \
|
||||
const XprMatrix<E, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E, Rows, Cols>& 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<E1, Rows1, Cols1>& lhs,
|
||||
const XprMatrix<E2, Cols1, Cols2>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprMatrix<E2, Cols1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@ -203,7 +203,7 @@ XprVector<
|
||||
Rows
|
||||
>
|
||||
operator*(const XprMatrix<E1, Rows, Cols>& lhs,
|
||||
const XprVector<E2, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E2, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
|
||||
@ -225,7 +225,7 @@ XprMatrix< \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const XprMatrix<E, Rows, Cols>& m) TVMET_CXX_ALWAYS_INLINE;
|
||||
operator OP (const XprMatrix<E, Rows, Cols>& 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<E, Rows, Cols>, complex<>)
|
||||
* operator(complex<>, XprMatrix<E, Rows, Cols>)
|
||||
@ -374,7 +374,7 @@ TVMET_IMPLEMENT_MACRO(div, /)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
#endif // defined(TVMET_HAVE_COMPLEX)
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
@ -144,7 +144,6 @@ private:
|
||||
#include <tvmet/xpr/Literal.h>
|
||||
|
||||
#include <tvmet/xpr/VectorFunctions.h>
|
||||
#include <tvmet/xpr/VectorBinaryFunctions.h>
|
||||
#include <tvmet/xpr/VectorOperators.h>
|
||||
#include <tvmet/xpr/Eval.h>
|
||||
|
||||
|
@ -1,279 +0,0 @@
|
||||
/*
|
||||
* Tiny Vector Matrix Library
|
||||
* Dense Vector Matrix Libary of Tiny size using Expression Templates
|
||||
*
|
||||
* Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net>
|
||||
*
|
||||
* 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<E1, Sz>, XprVector<E2, Sz>)
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME) \
|
||||
template<class E1, class E2, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \
|
||||
XprVector<E1, Sz>, \
|
||||
XprVector<E2, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const XprVector<E1, Sz>& lhs, \
|
||||
const XprVector<E2, Sz>& 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<E, Sz>, POD)
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, TP) \
|
||||
template<class E, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, TP >, \
|
||||
XprVector<E, Sz>, \
|
||||
XprLiteral< TP > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const XprVector<E, Sz>& 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<E, Sz>, std::complex<>)
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME) \
|
||||
template<class E, int Sz, class T> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, std::complex<T> >, \
|
||||
XprVector<E, Sz>, \
|
||||
XprLiteral< std::complex<T> > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const XprVector<E, Sz>& lhs, \
|
||||
const std::complex<T>& 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<E1, Sz>, XprVector<E2, Sz>)
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class E1, class E2, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \
|
||||
XprVector<E1, Sz>, \
|
||||
XprVector<E2, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const XprVector<E1, Sz>& lhs, const XprVector<E2, Sz>& rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \
|
||||
XprVector<E1, Sz>, \
|
||||
XprVector<E2, Sz> \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
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<E, Sz>, POD)
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, TP) \
|
||||
template<class E, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, TP >, \
|
||||
XprVector<E, Sz>, \
|
||||
XprLiteral< TP > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const XprVector<E, Sz>& lhs, TP rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, TP >, \
|
||||
XprVector<E, Sz>, \
|
||||
XprLiteral< TP > \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
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<E, Sz>, std::complex<>)
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class E, int Sz, class T> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, std::complex<T> >, \
|
||||
XprVector<E, Sz>, \
|
||||
XprLiteral< std::complex<T> > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const XprVector<E, Sz>& lhs, const std::complex<T>& rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, std::complex<T> >, \
|
||||
XprVector<E, Sz>, \
|
||||
XprLiteral< std::complex<T> > \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
expr_type(lhs, XprLiteral< std::complex<T> >(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:
|
@ -55,7 +55,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const XprVector<E1, Sz>& lhs, \
|
||||
const XprVector<E2, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E2, Sz>& 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<E, Sz>& lhs, \
|
||||
POD rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
POD rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, int Sz> \
|
||||
XprVector< \
|
||||
@ -95,7 +95,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
NAME (POD lhs, \
|
||||
const XprVector<E, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E, Sz>& 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<E, Rows, Cols>, complex<T>)
|
||||
* function(complex<T>, XprMatrix<E, Rows, Cols>)
|
||||
@ -133,7 +133,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const XprVector<E, Sz>& lhs, \
|
||||
const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const std::complex<T>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, int Sz, class T> \
|
||||
XprVector< \
|
||||
@ -145,7 +145,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const std::complex<T>& lhs, \
|
||||
const XprVector<E, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E, Sz>& 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<class E, int Sz>
|
||||
typename NumericTraits<typename E::value_type>::sum_type
|
||||
sum(const XprVector<E, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
sum(const XprVector<E, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Sz>
|
||||
typename NumericTraits<typename E::value_type>::sum_type
|
||||
product(const XprVector<E, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
product(const XprVector<E, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E1, class E2, int Sz>
|
||||
@ -178,19 +178,19 @@ typename PromoteTraits<
|
||||
typename E2::value_type
|
||||
>::value_type
|
||||
dot(const XprVector<E1, Sz>& lhs,
|
||||
const XprVector<E2, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E2, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, class E, int Sz>
|
||||
typename PromoteTraits<T, typename E::value_type>::value_type
|
||||
dot(const Vector<T, Sz>& lhs,
|
||||
const XprVector<E, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, class T, int Sz>
|
||||
typename PromoteTraits<T, typename E::value_type>::value_type
|
||||
dot(const XprVector<E, Sz>& lhs,
|
||||
const Vector<T, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Vector<T, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E1, class E2>
|
||||
@ -202,31 +202,31 @@ Vector<
|
||||
3
|
||||
>
|
||||
cross(const XprVector<E1, 3>& lhs,
|
||||
const XprVector<E2, 3>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E2, 3>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, class E>
|
||||
Vector<
|
||||
typename PromoteTraits<T, typename E::value_type>::value_type, 3>
|
||||
cross(const Vector<T, 3>& lhs,
|
||||
const XprVector<E, 3>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E, 3>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, class T>
|
||||
Vector<
|
||||
typename PromoteTraits<T, typename E::value_type>::value_type, 3>
|
||||
cross(const XprVector<E, 3>& lhs,
|
||||
const Vector<T, 3>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const Vector<T, 3>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Sz>
|
||||
typename NumericTraits<typename E::value_type>::sum_type
|
||||
norm1(const XprVector<E, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
norm1(const XprVector<E, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Sz>
|
||||
typename NumericTraits<typename E::value_type>::sum_type
|
||||
norm2(const XprVector<E, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
norm2(const XprVector<E, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Sz>
|
||||
@ -238,7 +238,7 @@ XprVector<
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
normalize(const XprVector<E, Sz>& v) TVMET_CXX_ALWAYS_INLINE;
|
||||
normalize(const XprVector<E, Sz>& 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<E, Rows, Cols>, complex<T>)
|
||||
* function(complex<T>, XprMatrix<E, Rows, Cols>)
|
||||
@ -398,7 +398,7 @@ TVMET_IMPLEMENT_MACRO(div)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
#endif // defined(TVMET_HAVE_COMPLEX)
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
@ -53,7 +53,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const XprVector<E1, Sz>& lhs, \
|
||||
const XprVector<E2, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E2, Sz>& 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<E, Sz>& lhs, \
|
||||
POD rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
POD rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, int Sz> \
|
||||
inline \
|
||||
@ -95,7 +95,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (POD lhs, \
|
||||
const XprVector<E, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E, Sz>& 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<E, Sz>, complex<T>)
|
||||
* operator(complex<T>, XprVector<E, Sz>)
|
||||
@ -133,7 +133,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const XprVector<E, Sz>& lhs, \
|
||||
const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE; \
|
||||
const std::complex<T>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, int Sz, class T> \
|
||||
inline \
|
||||
@ -146,7 +146,7 @@ XprVector< \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const std::complex<T>& lhs, \
|
||||
const XprVector<E, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
const XprVector<E, Sz>& 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<E, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
|
||||
operator OP (const XprVector<E, Sz>& 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<E, Sz>, complex<T>)
|
||||
* operator(complex<T>, XprVector<E, Sz>)
|
||||
@ -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)
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
@ -35,6 +35,6 @@
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( TestConstruction<double> );
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( TestConstruction<int> );
|
||||
|
||||
#if defined(TVMET_HAVE_COMPLEX)
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( TestConstruction< std::complex<double> > );
|
||||
#endif
|
||||
|
@ -35,6 +35,6 @@
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( TestDimension<double> );
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( TestDimension<int> );
|
||||
|
||||
#if defined(TVMET_HAVE_COMPLEX)
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( TestDimension< std::complex<double> > );
|
||||
#endif
|
||||
|
@ -32,7 +32,7 @@
|
||||
* instance
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(TVMET_HAVE_COMPLEX)
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( TestNumericTraitsComplex< std::complex<int> > );
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( TestNumericTraitsComplex< std::complex<unsigned int> > );
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( TestNumericTraitsComplex< std::complex<long> > );
|
||||
|
@ -23,10 +23,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef TVMET_HAVE_COMPLEX
|
||||
#ifdef EIGEN_USE_COMPLEX
|
||||
#include <complex>
|
||||
#endif
|
||||
|
||||
#define EIGEN_USE_COMPLEX
|
||||
#include <tvmet/Vector.h>
|
||||
#include <tvmet/Matrix.h>
|
||||
|
||||
|
@ -69,7 +69,7 @@ void TvmetTestSuite::selfTest()
|
||||
basics2<int> ();
|
||||
basics2<double> ();
|
||||
|
||||
#ifdef TVMET_HAVE_COMPLEX
|
||||
#ifdef EIGEN_USE_COMPLEX
|
||||
basics1<complex<float>, 4> ();
|
||||
basics1<complex<double>, 4> ();
|
||||
basics2<complex<int> > ();
|
||||
|
Loading…
x
Reference in New Issue
Block a user