Feel++  0.91.4
Classes | Namespaces | Macros | Functions | Variables
typetraits.hpp File Reference
#include <boost/concept_check.hpp>
#include <boost/preprocessor/comparison/less.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/logical/and.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/list/at.hpp>
#include <boost/preprocessor/list/cat.hpp>
#include <boost/preprocessor/list/for_each_product.hpp>
#include <boost/preprocessor/logical/or.hpp>
#include <boost/preprocessor/tuple/to_list.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#include <boost/preprocessor/facilities/empty.hpp>
#include <boost/preprocessor/punctuation/comma.hpp>
#include <boost/preprocessor/facilities/identity.hpp>
#include <boost/preprocessor/arithmetic/add.hpp>
#include <boost/preprocessor/list/filter.hpp>

Classes

struct  Feel::type_traits< T >
 

Namespaces

namespace  Feel
 
namespace  Feel::math
 

Macros

#define FEELPP_FUNC_NAME(T)   BOOST_PP_TUPLE_ELEM(3, 0 , T)
 
#define FEELPP_FUNC_CALL(T)   BOOST_PP_TUPLE_ELEM(3, 1 , T)
 
#define FEELPP_FUNC_NONS(T)   BOOST_PP_TUPLE_ELEM(3, 2 , T)
 
#define FEELPP_STD_FUNCS
 
#define FEELPP_STDCOMPLEX_FUNCS
 
#define FEELPP_STD_BINARY_FUNCS
 
#define FEELPP_MP_FUNCS
 
#define FEELPP_MP_BINARY_FUNCS
 
#define FEELPP_GLOBAL_FUNCS
 
#define FEELPP_GLOBAL_BINARY_FUNCS
 
#define FEELPP_TRAITS_FUNC_REAL(T, t)
 
#define FEELPP_TRAITS_FUNC_IMAG(T, t)
 
#define FEELPP_TRAITS_FUNC_CONJ(T, t)
 
#define FEELPP_TRAITS_TYPE(T)   BOOST_PP_TUPLE_ELEM(7, 0 , T)
 
#define FEELPP_TRAITS_REAL_TYPE(T)   BOOST_PP_TUPLE_ELEM(7, 1 , T)
 
#define FEELPP_TRAITS_IS_FLOATING(T)   BOOST_PP_TUPLE_ELEM(7, 2 , T)
 
#define FEELPP_TRAITS_IS_COMPLEX(T)   BOOST_PP_TUPLE_ELEM(7, 3 , T)
 
#define FEELPP_TRAITS_RANK(T)   BOOST_PP_TUPLE_ELEM(7, 4 , T)
 
#define FEELPP_TRAITS_EPSILON(T)   BOOST_PP_TUPLE_ELEM(7, 5 , T)
 
#define FEELPP_TRAITS_FUNC_TYPE(T)   BOOST_PP_TUPLE_ELEM(7, 6 , T)
 
#define QD_NTYPES   0
 
#define QD_DD_TYPE
 
#define QD_QD_TYPE
 
#define MPFR_NTYPES   0
 
#define MPFR_MP_TYPE
 
#define FEELPP_NUMERICAL_NTYPES   BOOST_PP_ADD(4, BOOST_PP_ADD( QD_NTYPES, MPFR_NTYPES ) )
 
#define FEELPP_TRAITS_TYPES
 
#define FEELPP_TRAITS_OP(_, T)   FEELPP_TRAITS_OP_CODE T \
 
#define FEELPP_TRAITS_OP_CODE(T)
 
#define FEELPP_PRED_FUNC(d, data, elem)   BOOST_PP_EQUAL(FEELPP_TRAITS_FUNC_TYPE(elem), data)
 
#define FEELPP_UNARY_FUNCS_OP(_, TF)   FEELPP_UNARY_FUNCS_OP_CODE TF \
 
#define FEELPP_UNARY_FUNCS_OP_CODE(T, F)
 
#define FEELPP_BINARY_FUNCS_OP(_, TF)   FEELPP_BINARY_FUNCS_OP_CODE TF \
 
#define FEELPP_BINARY_FUNCS_OP_CODE(T, F)
 

Functions

 Feel::math::BOOST_PP_LIST_FOR_EACH_PRODUCT (FEELPP_UNARY_FUNCS_OP, 2,(BOOST_PP_LIST_FILTER(FEELPP_PRED_FUNC, 0, FEELPP_TRAITS_TYPES), FEELPP_STD_FUNCS)) BOOST_PP_LIST_FOR_EACH_PRODUCT(FEELPP_UNARY_FUNCS_OP
 
 Feel::math::BOOST_PP_LIST_FILTER (FEELPP_PRED_FUNC, 1, FEELPP_TRAITS_TYPES)
 
FEELPP_MP_FUNCS Feel::math::BOOST_PP_LIST_FOR_EACH_PRODUCT (FEELPP_UNARY_FUNCS_OP, 2,(BOOST_PP_LIST_FILTER(FEELPP_PRED_FUNC, 2, FEELPP_TRAITS_TYPES), FEELPP_GLOBAL_FUNCS)) BOOST_PP_LIST_FOR_EACH_PRODUCT(FEELPP_UNARY_FUNCS_OP
 
FEELPP_MP_FUNCS Feel::math::BOOST_PP_LIST_FILTER (FEELPP_PRED_FUNC, 3, FEELPP_TRAITS_TYPES)
 
 Feel::math::BOOST_PP_LIST_FOR_EACH_PRODUCT (FEELPP_BINARY_FUNCS_OP, 2,(BOOST_PP_LIST_FILTER(FEELPP_PRED_FUNC, 0, FEELPP_TRAITS_TYPES), FEELPP_STD_BINARY_FUNCS)) BOOST_PP_LIST_FOR_EACH_PRODUCT(FEELPP_BINARY_FUNCS_OP
 

Variables

const double Feel::factor_from_eps = 50
 
const float Feel::factor_from_eps_fl = 50
 

Detailed Description

Author
Christophe Prud'homme chris.nosp@m.toph.nosp@m.e.pru.nosp@m.dhom.nosp@m.me@uj.nosp@m.f-gr.nosp@m.enobl.nosp@m.e.fr
Date
2005-07-28

Macro Definition Documentation

#define FEELPP_BINARY_FUNCS_OP (   _,
  TF 
)    FEELPP_BINARY_FUNCS_OP_CODE TF \

Generate the binary functions for each type

#define FEELPP_BINARY_FUNCS_OP_CODE (   T,
 
)
Value:
template<typename Type2> \
inline \
FEELPP_TRAITS_TYPE( T ) FEELPP_FUNC_NAME( F )( FEELPP_TRAITS_TYPE( T ) const& x, Type2 const& y ) \
{ \
return FEELPP_FUNC_CALL( F )( x, y ); \
} \
#define FEELPP_GLOBAL_BINARY_FUNCS
Value:
BOOST_PP_TUPLE_TO_LIST( \
1, \
( \
(pow , ::npwr, npwr ) \
) \
) \
#define FEELPP_GLOBAL_FUNCS
Value:
BOOST_PP_TUPLE_TO_LIST( \
18, \
( \
(abs , ::abs , abs ), /* absolute value*/ \
(sqrt , ::sqrt , sqrt ), /* square root */ \
(norm1 , ::abs , abs ), /* norm1 */ \
(norm2 , ::abs , abs ), /* norm2 */ \
(norm_inf , ::abs , abs ), /* norm_inf */ \
(cos , ::cos , cos ), \
(sin , ::sin , sin ), \
(tan , ::tan , tan ), \
(acos , ::acos , acos ), \
(asin , ::asin , asin ), \
(atan , ::atan , atan ), \
(cosh , ::cosh , cosh ), \
(sinh , ::sinh , sinh ), \
(tanh , ::tanh , tanh ), \
(exp , ::exp , exp ), \
(log , ::log , log ), \
(ceil , ::ceil , ceil ), \
(floor , ::floor, floor) \
) \
) \
#define FEELPP_MP_BINARY_FUNCS
Value:
BOOST_PP_TUPLE_TO_LIST( \
1, \
( \
(pow , mpfr::pow, pow ) \
) \
) \
#define FEELPP_MP_FUNCS
Value:
BOOST_PP_TUPLE_TO_LIST( \
18, \
( \
(abs , mpfr::abs , abs ), /* absolute value*/ \
(sqrt , mpfr::sqrt , sqrt ), /* square root */ \
(norm1 , mpfr::abs , abs ), /* norm1 */ \
(norm2 , mpfr::abs , abs ), /* norm2 */ \
(norm_inf , mpfr::abs , abs ), /* norm_inf */ \
(cos , mpfr::cos , cos ), \
(sin , mpfr::sin , sin ), \
(tan , mpfr::tan , tan ), \
(acos , mpfr::acos , acos ), \
(asin , mpfr::asin , asin ), \
(atan , mpfr::atan , atan ), \
(cosh , mpfr::cosh , cosh ), \
(sinh , mpfr::sinh , sinh ), \
(tanh , mpfr::tanh , tanh ), \
(exp , mpfr::exp , exp ), \
(log , mpfr::log , log ), \
(ceil , mpfr::ceil , ceil ), \
(floor , mpfr::floor, floor) \
) \
) \
#define FEELPP_STD_BINARY_FUNCS
Value:
BOOST_PP_TUPLE_TO_LIST( \
1, \
( \
(pow , std::pow, pow ) \
) \
) \
#define FEELPP_STD_FUNCS
Value:
BOOST_PP_TUPLE_TO_LIST( \
19, \
( \
(abs , std::abs , abs ), /* absolute value*/ \
(sqrt , std::sqrt , sqrt ), /* square root */ \
(norm1 , std::abs , abs ), /* norm1 */ \
(norm2 , std::abs , abs ), /* norm2 */ \
(norm_inf , std::abs , abs ), /* norm_inf */ \
(cos , std::cos , cos ), \
(sin , std::sin , sin ), \
(tan , std::tan , tan ), \
(acos , std::acos , acos ), \
(asin , std::asin , asin ), \
(atan , std::atan , atan ), \
(cosh , std::cosh , cosh ), \
(sinh , std::sinh , sinh ), \
(tanh , std::tanh , tanh ), \
(exp , std::exp , exp ), \
(log , std::log , log ), \
(log10 , std::log10, log10), \
(ceil , std::ceil , ceil ), \
(floor , std::floor, floor) \
) \
) \
#define FEELPP_STDCOMPLEX_FUNCS
Value:
BOOST_PP_TUPLE_TO_LIST( \
11, \
( \
(abs , std::abs , abs ), /* absolute value*/ \
(sqrt , std::sqrt , sqrt ), /* square root */ \
(norm1 , std::abs , abs ), /* norm1 */ \
(norm2 , std::abs , abs ), /* norm2 */ \
(norm_inf , std::abs , abs ), /* norm_inf */ \
(cos , std::cos , cos ), \
(sin , std::sin , sin ), \
(tan , std::tan , tan ), \
(exp , std::exp , exp ), \
(log , std::log , log ), \
(log10 , std::log10, log10 ) \
) \
) \
#define FEELPP_TRAITS_FUNC_CONJ (   T,
 
)
Value:
BOOST_PP_IF( FEELPP_TRAITS_IS_COMPLEX(T), \
BOOST_PP_IDENTITY( std::conj( t ) ), \
BOOST_PP_IDENTITY( t ) )() \
#define FEELPP_TRAITS_FUNC_IMAG (   T,
 
)
Value:
BOOST_PP_IF( FEELPP_TRAITS_IS_COMPLEX(T), \
BOOST_PP_IDENTITY( t.imag() ), \
BOOST_PP_IDENTITY( FEELPP_TRAITS_REAL_TYPE(T)( 0.0 ) ) )() \
#define FEELPP_TRAITS_FUNC_REAL (   T,
 
)
Value:
BOOST_PP_IF( FEELPP_TRAITS_IS_COMPLEX(T), \
t.real(), \
t ) \
#define FEELPP_TRAITS_TYPES
Value:
BOOST_PP_TUPLE_TO_LIST( \
FEELPP_NUMERICAL_NTYPES, \
( \
QD_DD_TYPE \
QD_QD_TYPE \
MPFR_MP_TYPE \
( float , float , 1, 0, 7 , std::numeric_limits<float>::epsilon()*factor_from_eps_fl , 0 ), \
( double , double , 1, 0, 8 , std::numeric_limits<double>::epsilon()*factor_from_eps, 0 ), \
( std::complex<float>, float, 1, 1, 10, std::numeric_limits<float>::epsilon()*factor_from_eps_fl , 3 ), \
( std::complex<double>, double, 1, 1, 11, std::numeric_limits<double>::epsilon()*factor_from_eps , 3 ) \
) \
) \
#define FEELPP_UNARY_FUNCS_OP (   _,
  TF 
)    FEELPP_UNARY_FUNCS_OP_CODE TF \

Generate the unary functions for each type

#define FEELPP_UNARY_FUNCS_OP_CODE (   T,
 
)
Value:
inline \
FEELPP_TRAITS_TYPE( T ) FEELPP_FUNC_NAME( F )( FEELPP_TRAITS_TYPE( T ) const& t ) \
{ \
return FEELPP_FUNC_CALL( F )( t ); \
} \