ES_optype.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
#ifndef __ESCRIPT_ESOPTYPE_H__
#define __ESCRIPT_ESOPTYPE_H__
#include "system_dep.h"
#include <string>
namespace escript
{
// For the purposes of unit testing and maintaining sanity, it is important that this enum be contiguous
enum ES_optype
{
UNKNOWNOP=0,
IDENTITY=1,
ADD=2,
SUB=3,
MUL=4,
DIV=5,
POW=6,
SIN=POW+1,
COS=SIN+1,
TAN=SIN+2,
ASIN=SIN+3,
ACOS=SIN+4,
ATAN=SIN+5,
SINH=SIN+6,
COSH=SIN+7,
TANH=SIN+8,
ERF=SIN+9,
ASINH=SIN+10,
ACOSH=SIN+11,
ATANH=SIN+12,
LOG10=ATANH+1,
LOG=LOG10+1,
SIGN=LOG10+2,
ABS=LOG10+3,
NEG=LOG10+4,
POS=LOG10+5,
EXP=LOG10+6,
SQRT=LOG10+7,
RECIP=LOG10+8,
GZ=RECIP+1,
LZ=GZ+1, // <0
GEZ=GZ+2, // >=0
LEZ=GZ+3, // <=0
NEZ=GZ+4, // >=0
EZ=GZ+5,
SYM=EZ+1,
NSYM=SYM+1,
PROD=NSYM+1,
TRANS=PROD+1,
TRACE=TRANS+1,
SWAP=TRACE+1,
MINVAL=SWAP+1,
MAXVAL=MINVAL+1,
CONDEVAL=MAXVAL+1,
HER=CONDEVAL+1, // hermitian
NHER=HER+1, // antihermitian
REAL=NHER+1,
IMAG=REAL+1,
CONJ=IMAG+1,
LESS=CONJ+1, // a<b
GREATER=LESS+1,
GREATER_EQUAL=GREATER+1,
LESS_EQUAL=GREATER_EQUAL+1,
PHS=LESS_EQUAL+1, // phase
PROM=PHS+1 // promote real to complex
};
ESCRIPT_DLL_API
const std::string&
opToString(ES_optype op);
enum ES_opgroup
{
G_UNKNOWN,
G_IDENTITY,
G_BINARY, // pointwise operations with two arguments
G_UNARY, // pointwise operations with one argument
G_UNARY_P, // pointwise operations with one argument, requiring a parameter
G_UNARY_R, // pointwise operations with one argument, always real output
G_NP1OUT, // non-pointwise op with one output
G_NP1OUT_P, // non-pointwise op with one output requiring a parameter
G_TENSORPROD, // general tensor product
G_NP1OUT_2P, // non-pointwise op with one output requiring two params
G_REDUCTION, // non-pointwise unary op with a scalar output
G_CONDEVAL,
G_UNARY_C, // pointwise operations with one argument, always cplx output
G_UNARY_PR // G_UNARY_P but always real output
};
ES_opgroup
getOpgroup(ES_optype op);
const std::string&
groupToString(ES_opgroup g);
}
#endif
ESCRIPT_DLL_API
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
escript
Definition: AbstractContinuousDomain.cpp:23
escript::groupToString
const std::string & groupToString(ES_opgroup g)
Definition: ES_optype.cpp:105
escript::opToString
const std::string & opToString(ES_optype op)
Definition: ES_optype.cpp:89
escript::ES_optype
ES_optype
Definition: ES_optype.h:30
escript::PROD
@ PROD
Definition: ES_optype.h:68
escript::GREATER
@ GREATER
Definition: ES_optype.h:81
escript::SYM
@ SYM
Definition: ES_optype.h:66
escript::ABS
@ ABS
Definition: ES_optype.h:54
escript::RECIP
@ RECIP
Definition: ES_optype.h:59
escript::POW
@ POW
Definition: ES_optype.h:37
escript::NEZ
@ NEZ
Definition: ES_optype.h:64
escript::LZ
@ LZ
Definition: ES_optype.h:61
escript::LESS
@ LESS
Definition: ES_optype.h:80
escript::LEZ
@ LEZ
Definition: ES_optype.h:63
escript::LOG10
@ LOG10
Definition: ES_optype.h:51
escript::SINH
@ SINH
Definition: ES_optype.h:44
escript::ATANH
@ ATANH
Definition: ES_optype.h:50
escript::NSYM
@ NSYM
Definition: ES_optype.h:67
escript::REAL
@ REAL
Definition: ES_optype.h:77
escript::PROM
@ PROM
Definition: ES_optype.h:85
escript::GZ
@ GZ
Definition: ES_optype.h:60
escript::EXP
@ EXP
Definition: ES_optype.h:57
escript::TANH
@ TANH
Definition: ES_optype.h:46
escript::MINVAL
@ MINVAL
Definition: ES_optype.h:72
escript::TRANS
@ TRANS
Definition: ES_optype.h:69
escript::COSH
@ COSH
Definition: ES_optype.h:45
escript::IMAG
@ IMAG
Definition: ES_optype.h:78
escript::ERF
@ ERF
Definition: ES_optype.h:47
escript::SIN
@ SIN
Definition: ES_optype.h:38
escript::MUL
@ MUL
Definition: ES_optype.h:35
escript::LESS_EQUAL
@ LESS_EQUAL
Definition: ES_optype.h:83
escript::SWAP
@ SWAP
Definition: ES_optype.h:71
escript::ASINH
@ ASINH
Definition: ES_optype.h:48
escript::POS
@ POS
Definition: ES_optype.h:56
escript::MAXVAL
@ MAXVAL
Definition: ES_optype.h:73
escript::ACOSH
@ ACOSH
Definition: ES_optype.h:49
escript::UNKNOWNOP
@ UNKNOWNOP
Definition: ES_optype.h:31
escript::LOG
@ LOG
Definition: ES_optype.h:52
escript::EZ
@ EZ
Definition: ES_optype.h:65
escript::SUB
@ SUB
Definition: ES_optype.h:34
escript::NHER
@ NHER
Definition: ES_optype.h:76
escript::DIV
@ DIV
Definition: ES_optype.h:36
escript::TRACE
@ TRACE
Definition: ES_optype.h:70
escript::SIGN
@ SIGN
Definition: ES_optype.h:53
escript::TAN
@ TAN
Definition: ES_optype.h:40
escript::PHS
@ PHS
Definition: ES_optype.h:84
escript::ASIN
@ ASIN
Definition: ES_optype.h:41
escript::GEZ
@ GEZ
Definition: ES_optype.h:62
escript::SQRT
@ SQRT
Definition: ES_optype.h:58
escript::ADD
@ ADD
Definition: ES_optype.h:33
escript::IDENTITY
@ IDENTITY
Definition: ES_optype.h:32
escript::CONJ
@ CONJ
Definition: ES_optype.h:79
escript::ACOS
@ ACOS
Definition: ES_optype.h:42
escript::ATAN
@ ATAN
Definition: ES_optype.h:43
escript::HER
@ HER
Definition: ES_optype.h:75
escript::COS
@ COS
Definition: ES_optype.h:39
escript::NEG
@ NEG
Definition: ES_optype.h:55
escript::GREATER_EQUAL
@ GREATER_EQUAL
Definition: ES_optype.h:82
escript::CONDEVAL
@ CONDEVAL
Definition: ES_optype.h:74
escript::ES_opgroup
ES_opgroup
Definition: ES_optype.h:93
escript::G_NP1OUT_P
@ G_NP1OUT_P
Definition: ES_optype.h:101
escript::G_NP1OUT_2P
@ G_NP1OUT_2P
Definition: ES_optype.h:103
escript::G_IDENTITY
@ G_IDENTITY
Definition: ES_optype.h:95
escript::G_UNARY_PR
@ G_UNARY_PR
Definition: ES_optype.h:107
escript::G_UNKNOWN
@ G_UNKNOWN
Definition: ES_optype.h:94
escript::G_NP1OUT
@ G_NP1OUT
Definition: ES_optype.h:100
escript::G_REDUCTION
@ G_REDUCTION
Definition: ES_optype.h:104
escript::G_UNARY
@ G_UNARY
Definition: ES_optype.h:97
escript::G_TENSORPROD
@ G_TENSORPROD
Definition: ES_optype.h:102
escript::G_CONDEVAL
@ G_CONDEVAL
Definition: ES_optype.h:105
escript::G_UNARY_C
@ G_UNARY_C
Definition: ES_optype.h:106
escript::G_UNARY_P
@ G_UNARY_P
Definition: ES_optype.h:98
escript::G_UNARY_R
@ G_UNARY_R
Definition: ES_optype.h:99
escript::G_BINARY
@ G_BINARY
Definition: ES_optype.h:96
escript::getOpgroup
ES_opgroup getOpgroup(ES_optype op)
Definition: ES_optype.cpp:99
system_dep.h