#include <type_traits>
#include "arrays.h"
#include "misc.h"
Go to the source code of this file.
#define declareDeepBinaryOperatorTemplates |
( |
|
OUT, |
|
|
|
OP, |
|
|
|
IN |
|
) |
| |
#define declareDeepReducedArithmeticTemplates |
( |
|
OUT, |
|
|
|
OP, |
|
|
|
IN |
|
) |
| |
Value:\
template < \
class T1, \
class T2, \
class = typename std::enable_if<is_scalar<T2>::value>::type \
> OUT<T1> operator OP##= (OUT<T1> & a, T2 const & b) \
{ \
\
size_t N = a.size(); \
for (size_t i = 0; i < N; i++) \
pa[i] OP##= b; \
\
return a; \
} \
\
template <class T1, class T2> \
OUT<T1> operator OP##= (OUT<T1> & a, IN<T2> const & b) \
{ \
assert(a.size() == b.size()); \
\
\
size_t N = a.size(); \
for (size_t i = 0; i < N; i++) \
pa[i] OP##= pb[i]; \
\
return a; \
}
#define restrict
Definition: misc.h:88
#define declareDeepUnaryOperatorTemplates |
( |
|
IN, |
|
|
|
OP |
|
) |
| |
Value:\
template <class T> \
IN<T> operator OP (IN<T> const & a) \
{ \
IN<T> b(a); \
return b; \
}
const double e
Definition: special.h:44
#define declareShallowReducedArithmeticTemplates |
( |
|
OUT, |
|
|
|
OP, |
|
|
|
IN |
|
) |
| |
Value:\
template < \
class T1, \
class T2, \
class = typename std::enable_if<is_scalar<T2>::value>::type \
> OUT<T1> operator OP##= (OUT<T1> a, T2 const & b) \
{ \
\
size_t N = a.size(); \
for (size_t i = 0; i < N; i++) \
pa[i] OP##= b; \
\
return a; \
} \
\
template <class T1, class T2> \
OUT<T1> operator OP##= (OUT<T1> a, IN<T2> b) \
{ \
assert(a.size() == b.size()); \
\
\
size_t N = a.size(); \
for (size_t i = 0; i < N; i++) \
pa[i] OP##= pb[i]; \
\
return a; \
}
#define restrict
Definition: misc.h:88