/[escript]/branches/clazy/escriptcore/src/ES_optype.cpp
ViewVC logotype

Contents of /branches/clazy/escriptcore/src/ES_optype.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6513 - (show annotations)
Fri Mar 3 03:04:03 2017 UTC (9 months, 2 weeks ago) by jfenwick
File size: 2727 byte(s)
Add information for the promote operation
Operation not implemented yet


1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17
18 #include "ES_optype.h"
19 #include <string>
20
21 using namespace escript;
22
23 namespace
24 {
25
26 std::string ES_opstrings[]={"UNKNOWN","IDENTITY","+","-","*","/","^",
27 "sin","cos","tan",
28 "asin","acos","atan","sinh","cosh","tanh","erf",
29 "asinh","acosh","atanh",
30 "log10","log","sign","abs","neg","pos","exp","sqrt",
31 "1/","where>0","where<0","where>=0","where<=0", "where<>0","where=0",
32 "symmetric","antisymmetric",
33 "prod",
34 "transpose", "trace",
35 "swapaxes",
36 "minval", "maxval",
37 "condEval",
38 "hermitian","antihermitian",
39 "real","imaginary","conjugate",
40 "<", ">", ">=", "<=",
41 "phase",
42 "promote"
43 };
44
45
46 ES_opgroup opgroups[]={G_UNKNOWN,G_IDENTITY,G_BINARY,G_BINARY,G_BINARY,G_BINARY, G_BINARY,
47 G_UNARY,G_UNARY,G_UNARY, //10
48 G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY, // 17
49 G_UNARY,G_UNARY,G_UNARY, // 20
50 G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY, // 28
51 G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY, G_UNARY_P, G_UNARY_P, // 35
52 G_NP1OUT,G_NP1OUT,
53 G_TENSORPROD,
54 G_NP1OUT_P, G_NP1OUT_P,
55 G_NP1OUT_2P,
56 G_REDUCTION, G_REDUCTION,
57 G_CONDEVAL,
58 G_UNARY,G_UNARY,
59 G_UNARY_R, G_UNARY_R, G_UNARY,
60 G_UNARY_R, G_UNARY_R, G_UNARY_R, G_UNARY_R,
61 G_UNARY_R,
62 G_UNARY_C
63 };
64
65
66 int ES_opcount=55;
67 }
68
69 // Return a string representing the operation
70 const std::string&
71 escript::opToString(ES_optype op)
72 {
73 if (op<0 || op>=ES_opcount)
74 {
75 op=UNKNOWNOP;
76 }
77 return ES_opstrings[op];
78 }
79
80 ES_opgroup
81 escript::getOpgroup(ES_optype op)
82 {
83 return opgroups[op];
84 }

  ViewVC Help
Powered by ViewVC 1.1.26