Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Macros
OperatorGenerators.hpp File Reference
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/logical/and.hpp>
#include <boost/preprocessor/logical/or.hpp>
#include <boost/preprocessor/comparison/greater.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#include <ExpressionTemplates/Operators.hpp>
Include dependency graph for OperatorGenerators.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Nektar
 <

Macros

#define TEMPLATE()   template<
#define CLOSE_TEMPLATE()   >
#define NEKTAR_TYPENAME()   typename
#define SHOW_TYPENAME(LhsNumber, RhsNumber)   BOOST_PP_IF( BOOST_PP_OR(BOOST_PP_GREATER(LhsNumber,0), BOOST_PP_GREATER(RhsNumber,0)), NEKTAR_TYPENAME, BOOST_PP_EMPTY)()
#define PP_ENUM_TWO_SETS_OF_TYPES(LhsTypeName, LhsNumber, RhsTypeName, RhsNumber)
#define GET_TEMPLATED_TYPE(TypeName, TemplateTypeName, Number)   TypeName<BOOST_PP_ENUM_PARAMS(Number, TemplateTypeName)>
#define GET_TYPE(TypeName, TemplateTypeName, Number)   BOOST_PP_IF(BOOST_PP_GREATER(Number, 0), GET_TEMPLATED_TYPE, TypeName BOOST_PP_TUPLE_EAT(3))(TypeName, TemplateTypeName, Number)
#define DECLARE_MULTIPLICATION_OPERATOR(LeftType, NumLeftParams, RightType, NumRightParams)
#define DECLARE_DIVISION_OPERATOR(LeftType, NumLeftParams, RightType, NumRightParams)
#define DECLARE_ADDITION_OPERATOR(LeftType, NumLeftParams, RightType, NumRightParams)
#define DECLARE_SUBTRACTION_OPERATOR(LeftType, NumLeftParams, RightType, NumRightParams)
#define GENERATE_MULTIPLICATION_OPERATOR(LeftType, NumLeftParams, RightType, NumRightParams)
#define GENERATE_DIVISION_OPERATOR(LeftType, NumLeftParams, RightType, NumRightParams)
#define GENERATE_ADDITION_OPERATOR(LeftType, NumLeftParams, RightType, NumRightParams)
#define GENERATE_SUBTRACTION_OPERATOR(LeftType, NumLeftParams, RightType, NumRightParams)

Macro Definition Documentation

#define CLOSE_TEMPLATE ( )    >

Definition at line 62 of file OperatorGenerators.hpp.

#define DECLARE_ADDITION_OPERATOR (   LeftType,
  NumLeftParams,
  RightType,
  NumRightParams 
)
Value:
PP_ENUM_TWO_SETS_OF_TYPES(LhsType, NumLeftParams, RhsType, NumRightParams) \
expt::Node<expt::Node<GET_TYPE(LeftType, LhsType, NumLeftParams) >, expt::AddOp, expt::Node<GET_TYPE(RightType, RhsType, NumRightParams) > > \
operator+(const GET_TYPE(LeftType, LhsType, NumLeftParams)& lhs, \
const GET_TYPE(RightType, RhsType, NumRightParams)& rhs);

Definition at line 92 of file OperatorGenerators.hpp.

#define DECLARE_DIVISION_OPERATOR (   LeftType,
  NumLeftParams,
  RightType,
  NumRightParams 
)
Value:
PP_ENUM_TWO_SETS_OF_TYPES(LhsType, NumLeftParams, RhsType, NumRightParams) \
expt::Node<expt::Node<GET_TYPE(LeftType, LhsType, NumLeftParams) >, expt::DivideOp, expt::Node<GET_TYPE(RightType, RhsType, NumRightParams) > > \
operator/(const GET_TYPE(LeftType, LhsType, NumLeftParams)& lhs, \
const GET_TYPE(RightType, RhsType, NumRightParams)& rhs);

Definition at line 86 of file OperatorGenerators.hpp.

#define DECLARE_MULTIPLICATION_OPERATOR (   LeftType,
  NumLeftParams,
  RightType,
  NumRightParams 
)
Value:
PP_ENUM_TWO_SETS_OF_TYPES(LhsType, NumLeftParams, RhsType, NumRightParams) \
expt::Node<expt::Node<GET_TYPE(LeftType, LhsType, NumLeftParams) >, expt::MultiplyOp, expt::Node<GET_TYPE(RightType, RhsType, NumRightParams) > > \
operator*(const GET_TYPE(LeftType, LhsType, NumLeftParams)& lhs, \
const GET_TYPE(RightType, RhsType, NumRightParams)& rhs);

Definition at line 80 of file OperatorGenerators.hpp.

#define DECLARE_SUBTRACTION_OPERATOR (   LeftType,
  NumLeftParams,
  RightType,
  NumRightParams 
)
Value:
PP_ENUM_TWO_SETS_OF_TYPES(LhsType, NumLeftParams, RhsType, NumRightParams) \
expt::Node<expt::Node<GET_TYPE(LeftType, LhsType, NumLeftParams) >, expt::SubtractOp, expt::Node<GET_TYPE(RightType, RhsType, NumRightParams) > > \
operator-(const GET_TYPE(LeftType, LhsType, NumLeftParams)& lhs, \
const GET_TYPE(RightType, RhsType, NumRightParams)& rhs);

Definition at line 98 of file OperatorGenerators.hpp.

#define GENERATE_ADDITION_OPERATOR (   LeftType,
  NumLeftParams,
  RightType,
  NumRightParams 
)
Value:
PP_ENUM_TWO_SETS_OF_TYPES(LhsType, NumLeftParams, RhsType, NumRightParams) \
SHOW_TYPENAME(NumLeftParams, NumRightParams) expt::AddOp::ResultType<GET_TYPE(LeftType, LhsType, NumLeftParams), GET_TYPE(RightType, RhsType, NumRightParams)>::type \
operator+(const GET_TYPE(LeftType, LhsType, NumLeftParams)& lhs, \
const GET_TYPE(RightType, RhsType, NumRightParams)& rhs) \
{ \
return Add(lhs, rhs); \
}

Definition at line 162 of file OperatorGenerators.hpp.

#define GENERATE_DIVISION_OPERATOR (   LeftType,
  NumLeftParams,
  RightType,
  NumRightParams 
)
Value:
PP_ENUM_TWO_SETS_OF_TYPES(LhsType, NumLeftParams, RhsType, NumRightParams) \
SHOW_TYPENAME(NumLeftParams, NumRightParams) expt::DivideOp::ResultType<GET_TYPE(LeftType, LhsType, NumLeftParams), GET_TYPE(RightType, RhsType, NumRightParams)>::type \
operator/(const GET_TYPE(LeftType, LhsType, NumLeftParams)& lhs, \
const GET_TYPE(RightType, RhsType, NumRightParams)& rhs) \
{ \
return Divide(lhs, rhs); \
}

Definition at line 153 of file OperatorGenerators.hpp.

#define GENERATE_MULTIPLICATION_OPERATOR (   LeftType,
  NumLeftParams,
  RightType,
  NumRightParams 
)
Value:
PP_ENUM_TWO_SETS_OF_TYPES(LhsType, NumLeftParams, RhsType, NumRightParams) \
SHOW_TYPENAME(NumLeftParams, NumRightParams) expt::MultiplyOp::ResultType<GET_TYPE(LeftType, LhsType, NumLeftParams), GET_TYPE(RightType, RhsType, NumRightParams)>::type \
operator*(const GET_TYPE(LeftType, LhsType, NumLeftParams)& lhs, \
const GET_TYPE(RightType, RhsType, NumRightParams)& rhs) \
{ \
return Multiply(lhs, rhs); \
}

Definition at line 143 of file OperatorGenerators.hpp.

#define GENERATE_SUBTRACTION_OPERATOR (   LeftType,
  NumLeftParams,
  RightType,
  NumRightParams 
)
Value:
PP_ENUM_TWO_SETS_OF_TYPES(LhsType, NumLeftParams, RhsType, NumRightParams) \
SHOW_TYPENAME(NumLeftParams, NumRightParams) expt::SubtractOp::ResultType<GET_TYPE(LeftType, LhsType, NumLeftParams), GET_TYPE(RightType, RhsType, NumRightParams)>::type \
operator-(const GET_TYPE(LeftType, LhsType, NumLeftParams)& lhs, \
const GET_TYPE(RightType, RhsType, NumRightParams)& rhs) \
{ \
return Subtract(lhs, rhs); \
}

Definition at line 172 of file OperatorGenerators.hpp.

#define GET_TEMPLATED_TYPE (   TypeName,
  TemplateTypeName,
  Number 
)    TypeName<BOOST_PP_ENUM_PARAMS(Number, TemplateTypeName)>

Definition at line 75 of file OperatorGenerators.hpp.

#define GET_TYPE (   TypeName,
  TemplateTypeName,
  Number 
)    BOOST_PP_IF(BOOST_PP_GREATER(Number, 0), GET_TEMPLATED_TYPE, TypeName BOOST_PP_TUPLE_EAT(3))(TypeName, TemplateTypeName, Number)

Definition at line 77 of file OperatorGenerators.hpp.

#define NEKTAR_TYPENAME ( )    typename

Definition at line 64 of file OperatorGenerators.hpp.

#define PP_ENUM_TWO_SETS_OF_TYPES (   LhsTypeName,
  LhsNumber,
  RhsTypeName,
  RhsNumber 
)
Value:
BOOST_PP_IF( BOOST_PP_OR(BOOST_PP_GREATER(LhsNumber,0), BOOST_PP_GREATER(RhsNumber,0)), TEMPLATE, BOOST_PP_EMPTY)() \
BOOST_PP_ENUM_PARAMS(LhsNumber, typename LhsTypeName) \
BOOST_PP_COMMA_IF(BOOST_PP_AND(BOOST_PP_GREATER(LhsNumber,0), BOOST_PP_GREATER(RhsNumber,0))) \
BOOST_PP_ENUM_PARAMS(RhsNumber, typename RhsTypeName) \
BOOST_PP_IF( BOOST_PP_OR(BOOST_PP_GREATER(LhsNumber,0), BOOST_PP_GREATER(RhsNumber,0)), CLOSE_TEMPLATE, BOOST_PP_EMPTY)()

Definition at line 68 of file OperatorGenerators.hpp.

#define SHOW_TYPENAME (   LhsNumber,
  RhsNumber 
)    BOOST_PP_IF( BOOST_PP_OR(BOOST_PP_GREATER(LhsNumber,0), BOOST_PP_GREATER(RhsNumber,0)), NEKTAR_TYPENAME, BOOST_PP_EMPTY)()

Definition at line 65 of file OperatorGenerators.hpp.

#define TEMPLATE ( )    template<

Definition at line 61 of file OperatorGenerators.hpp.