blitz Version 1.0.2
Loading...
Searching...
No Matches
ops.h File Reference
#include <blitz/blitz.h>
#include <blitz/promote.h>
#include <blitz/prettyprint.h>
Include dependency graph for ops.h:

Go to the source code of this file.

Classes

struct  blitz::BitwiseNot< T_numtype1 >
 
struct  blitz::UnaryPlus< T_numtype1 >
 
struct  blitz::UnaryMinus< T_numtype1 >
 
struct  blitz::LogicalNot< T_numtype1 >
 
struct  blitz::Add< T_numtype1, T_numtype2 >
 
struct  blitz::Subtract< T_numtype1, T_numtype2 >
 
struct  blitz::Multiply< T_numtype1, T_numtype2 >
 
struct  blitz::Divide< T_numtype1, T_numtype2 >
 
struct  blitz::Modulo< T_numtype1, T_numtype2 >
 
struct  blitz::BitwiseXor< T_numtype1, T_numtype2 >
 
struct  blitz::BitwiseAnd< T_numtype1, T_numtype2 >
 
struct  blitz::BitwiseOr< T_numtype1, T_numtype2 >
 
struct  blitz::ShiftRight< T_numtype1, T_numtype2 >
 
struct  blitz::ShiftLeft< T_numtype1, T_numtype2 >
 
struct  blitz::Greater< T_numtype1, T_numtype2 >
 
struct  blitz::Less< T_numtype1, T_numtype2 >
 
struct  blitz::GreaterOrEqual< T_numtype1, T_numtype2 >
 
struct  blitz::LessOrEqual< T_numtype1, T_numtype2 >
 
struct  blitz::Equal< T_numtype1, T_numtype2 >
 
struct  blitz::NotEqual< T_numtype1, T_numtype2 >
 
struct  blitz::LogicalAnd< T_numtype1, T_numtype2 >
 
struct  blitz::LogicalOr< T_numtype1, T_numtype2 >
 

Namespaces

namespace  blitz
 

Macros

#define BZ_DEFINE_UNARY_OP(name, op)
 
#define BZ_DEFINE_UNARY_OP_RET(name, op, ret)
 
#define BZ_DEFINE_BINARY_OP(name, op)
 
#define BZ_DEFINE_BINARY_OP_RET(name, op, ret)
 

Macro Definition Documentation

◆ BZ_DEFINE_BINARY_OP

#define BZ_DEFINE_BINARY_OP ( name,
op )
Value:
template<typename T_numtype1, typename T_numtype2> \
struct name { \
typedef BZ_PROMOTE(T_numtype1, T_numtype2) T_numtype; \
\
static inline T_numtype \
apply(T_numtype1 a, T_numtype2 b) \
{ return a op b; } \
\
template<typename T1, typename T2> \
static inline void prettyPrint(std::string &str, \
prettyPrintFormat& format, const T1& t1, \
const T2& t2) \
{ \
str += "("; \
t1.prettyPrint(str, format); \
str += #op; \
t2.prettyPrint(str, format); \
str += ")"; \
} \
};

◆ BZ_DEFINE_BINARY_OP_RET

#define BZ_DEFINE_BINARY_OP_RET ( name,
op,
ret )
Value:
template<typename T_numtype1, typename T_numtype2> \
struct name { \
typedef ret T_numtype; \
static inline T_numtype \
apply(T_numtype1 a, T_numtype2 b) \
{ return a op b; } \
\
template<typename T1, typename T2> \
static inline void prettyPrint(std::string &str, \
prettyPrintFormat& format, const T1& t1, \
const T2& t2) \
{ \
str += "("; \
t1.prettyPrint(str, format); \
str += #op; \
t2.prettyPrint(str, format); \
str += ")"; \
} \
};

◆ BZ_DEFINE_UNARY_OP

#define BZ_DEFINE_UNARY_OP ( name,
op )
Value:
template<typename T_numtype1> \
struct name { \
typedef T_numtype1 T_numtype; \
\
static inline T_numtype \
apply(T_numtype1 a) \
{ return op a; } \
\
template<typename T1> \
static inline void prettyPrint(std::string &str, \
prettyPrintFormat& format, const T1& t1) \
{ \
str += #op; \
t1.prettyPrint(str, format); \
} \
};

◆ BZ_DEFINE_UNARY_OP_RET

#define BZ_DEFINE_UNARY_OP_RET ( name,
op,
ret )
Value:
template<typename T_numtype1> \
struct name { \
typedef ret T_numtype; \
static inline T_numtype \
apply(T_numtype1 a) \
{ return op a; } \
\
template<typename T1> \
static inline void prettyPrint(std::string &str, \
prettyPrintFormat& format, const T1& t1) \
{ \
str += #op; \
t1.prettyPrint(str, format); \
} \
};