aimstil  5.0.5
numeric_array_operators.h File Reference
#include "til/functors.h"
#include "til/sandbox.h"
Include dependency graph for numeric_array_operators.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  til::functor::CastTo< numeric_array< T1, D >, numeric_array< T2, D > >
 

Namespaces

 til
 Belongs to package Box Do not include directly, include til/Box.h instead.
 
 til::functor
 

Macros

#define TIL_DEFINE_TEMPLATE_OP(name, op)
 
#define TIL_OPERATOR(op, func)
 
#define TIL_OPERATOR(op, func)
 
#define TIL_BOOL_VALUE_OPERATOR(opname, op)
 
#define BAD(op)
 

Functions

 til::TIL_OPERATOR (+, functor::Add)
 
 til::TIL_OPERATOR (-, functor::Sub)
 
 til::TIL_OPERATOR (/, functor::Div)
 
 til::TIL_BOOL_VALUE_OPERATOR (operator==,==)
 
 til::TIL_BOOL_VALUE_OPERATOR (operator!=, !=)
 
 til::TIL_BOOL_VALUE_OPERATOR (all_less,<)
 
 til::TIL_BOOL_VALUE_OPERATOR (all_less_equal,<=)
 
 til::TIL_BOOL_VALUE_OPERATOR (all_greater, >)
 
 til::TIL_BOOL_VALUE_OPERATOR (all_greater_equal, >=)
 

Macro Definition Documentation

◆ BAD

#define BAD (   op)
Value:
template < typename T, std::size_t D > \
bool operator op (const numeric_array<T,D> & x, const numeric_array<T,D> & y) \
{ \
return x.do_not_use_these_operators(); \
} \

Definition at line 232 of file numeric_array_operators.h.

◆ TIL_BOOL_VALUE_OPERATOR

#define TIL_BOOL_VALUE_OPERATOR (   opname,
  op 
)
Value:
template < typename T1, typename T2, std::size_t D > \
inline bool opname (const numeric_array<T1,D> & x, \
const numeric_array<T2,D> & y) \
{ \
for (std::size_t i = 0; i < D; ++i) \
{ \
if (!(x[i] op y[i])) return false; \
} \
return true; \
} \
template < typename T, std::size_t D > \
inline bool opname (const numeric_array<T,D> & x, \
typename boost::call_traits<T>::param_type y) \
{ \
for (std::size_t i = 0; i < D; ++i) \
{ \
if (!(x[i] op y)) return false; \
} \
return true; \
} \

Definition at line 187 of file numeric_array_operators.h.

◆ TIL_DEFINE_TEMPLATE_OP

#define TIL_DEFINE_TEMPLATE_OP (   name,
  op 
)

Definition at line 24 of file numeric_array_operators.h.

◆ TIL_OPERATOR [1/2]

#define TIL_OPERATOR (   op,
  func 
)
Value:
template < typename T, std::size_t D > \
inline \
numeric_array<T,D> \
operator op (const numeric_array<T,D> & x, const numeric_array<T,D> & y) \
{ \
return func <numeric_array<T,D>,numeric_array<T,D>,numeric_array<T,D> >() (x,y); \
} \

Definition at line 154 of file numeric_array_operators.h.

◆ TIL_OPERATOR [2/2]

#define TIL_OPERATOR (   op,
  func 
)
Value:
template < typename T , std::size_t D > \
inline \
numeric_array<T,D> \
operator op (const numeric_array<T,D> & x, T y) \
{ \
return func <numeric_array<T,D>,T,numeric_array<T,D> >()(x,y); \
} \
template < typename T, std::size_t D > \
inline \
numeric_array<T,D> \
operator op (T y, const numeric_array<T,D> & x) \
{ \
return func <T,numeric_array<T,D>,numeric_array<T,D> >()(y,x); \
} \

Definition at line 154 of file numeric_array_operators.h.