- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
// -------------------------------------------
// 2.2. binary calls
// -------------------------------------------
/*
combination table:
+- | c a n
---|-------
c | C A N
a | A A N
n | N N N
* | c a n
---|-------
c | C A N
a | A N N
n | N N N
/ | c a n
---|-------
c | C N N
a | A N N
n | N N N
argument:
c : constant, as scalar, point, tensor, ect
l : affine homogeneous expr argument: as field, field_indirect or field_expr_node::is_affine_homogeneous
n : function, functor or ! field_expr_node::is_affine_homogeneous
result:
C : constant : this combination is not implemented here
A,N : are implemented here
rules:
at least one of the two args is not of type "c"
when c: c value is embeded in bind_first or bind_second
and the operation reduces to an unary one
when a: if it is a field_convertible, it should be wrapped
in field_expr_v2_nonlinear_terminal_field
when c: no wrapper is need
implementation:
The a and n cases are grouped, thanks to the wrapper_traits
and it remains to cases :
1) both args are field_expr_v2_nonlinear or a function
2) one arg is a field_expr_v2_nonlinear or a function and the second argument is a constant
*/
#define _RHEOLEF_make_field_expr_v2_nonlinear_binary(FUNCTION,FUNCTOR) \
template<class Expr1, class Expr2> \
inline \
typename \
std::enable_if< \
details::is_field_expr_v2_nonlinear_arg<Expr1>::value \
&& details::is_field_expr_v2_nonlinear_arg<Expr2>::value \
&& ! details::is_field_expr_v2_constant <Expr1>::value \
&& ! details::is_field_expr_v2_constant <Expr2>::value \
,details::field_expr_v2_nonlinear_node_binary< \
FUNCTOR \
,typename details::field_expr_v2_nonlinear_terminal_wrapper_traits<Expr1>::type \
,typename details::field_expr_v2_nonlinear_terminal_wrapper_traits<Expr2>::type \
> \
>::type \
FUNCTION (const Expr1& expr1, const Expr2& expr2) \
{ \
typedef typename details::field_expr_v2_nonlinear_terminal_wrapper_traits<Expr1>::type wrap1_t; \
typedef typename details::field_expr_v2_nonlinear_terminal_wrapper_traits<Expr2>::type wrap2_t; \
return details::field_expr_v2_nonlinear_node_binary <FUNCTOR,wrap1_t,wrap2_t> \
(FUNCTOR(), wrap1_t(expr1), wrap2_t(expr2)); \
} \
template<class Expr1, class Expr2> \
inline \
typename \
std::enable_if< \
details::is_field_expr_v2_constant <Expr1>::value \
&& details::is_field_expr_v2_nonlinear_arg<Expr2>::value \
&& ! details::is_field_expr_v2_constant <Expr2>::value \
,details::field_expr_v2_nonlinear_node_unary< \
details::binder_first< \
FUNCTOR \
,typename details::field_promote_first_argument< \
Expr1