#include <cml/et/traits.h>
#include <cml/et/scalar_promotions.h>
Go to the source code of this file.
Namespaces | |
namespace | cml |
namespace | cml::et |
Defines | |
#define | CML_BINARY_SCALAR_OP(_op_, _op_name_) |
Declare a binary scalar operator, like addition, s1+s2. | |
#define | CML_BINARY_SCALAR_OP_ASSIGN(_op_, _op_name_) |
Declare an op-assignment operator. | |
#define | CML_BOOLEAN_SCALAR_OP(_op_, _op_name_) |
Declare a binary boolean operator, like less-than, s1 < s2. | |
#define | CML_UNARY_SCALAR_OP(_op_, _op_name_) |
Declare a unary scalar operator, like negation. |
Definition in file scalar_ops.h.
#define CML_BINARY_SCALAR_OP | ( | _op_, | |||
_op_name_ | ) |
Value:
template<typename LeftT, typename RightT> struct _op_name_ { \ typedef ExprTraits<LeftT> left_traits; \ typedef ExprTraits<RightT> right_traits; \ typedef typename left_traits::const_reference left_reference; \ typedef typename right_traits::const_reference right_reference; \ typedef typename left_traits::value_type left_value; \ typedef typename right_traits::value_type right_value; \ typedef typename ScalarPromote<left_value,right_value>::type value_type; \ typedef scalar_result_tag result_tag; \ value_type apply(left_reference left, right_reference right) const { \ return left _op_ right; } \ };
Definition at line 30 of file scalar_ops.h.
#define CML_BINARY_SCALAR_OP_ASSIGN | ( | _op_, | |||
_op_name_ | ) |
Value:
template<typename LeftT, typename RightT> struct _op_name_ { \ typedef ExprTraits<LeftT> left_traits; \ typedef ExprTraits<RightT> right_traits; \ typedef typename left_traits::reference left_reference; \ typedef typename right_traits::const_reference right_reference; \ typedef typename left_traits::value_type left_value; \ typedef typename right_traits::value_type right_value; \ typedef typename ScalarPromote<left_value,right_value>::type value_type; \ typedef scalar_result_tag result_tag; \ value_type apply(left_reference left, right_reference right) const { \ return left _op_ (LeftT) right; } \ };
Definition at line 50 of file scalar_ops.h.
#define CML_BOOLEAN_SCALAR_OP | ( | _op_, | |||
_op_name_ | ) |
Value:
template<typename LeftT, typename RightT> struct _op_name_ { \ typedef ExprTraits<LeftT> left_traits; \ typedef ExprTraits<RightT> right_traits; \ typedef typename left_traits::const_reference left_reference; \ typedef typename right_traits::const_reference right_reference; \ typedef scalar_result_tag result_tag; \ bool apply(left_reference left, right_reference right) const { \ return left _op_ right; } \ };
The operator should return the appropriate truth value for the operator.
Definition at line 70 of file scalar_ops.h.
#define CML_UNARY_SCALAR_OP | ( | _op_, | |||
_op_name_ | ) |
Value:
template<typename ArgT> struct _op_name_ { \ typedef ExprTraits<ArgT> arg_traits; \ typedef typename arg_traits::const_reference arg_reference; \ typedef typename arg_traits::value_type value_type; \ typedef scalar_result_tag result_tag; \ value_type apply(arg_reference arg) const { return _op_ arg; } \ };
Definition at line 20 of file scalar_ops.h.