14#include "arcane/utils/ArcanePrecomp.h"
16#include "arcane/expr/UnaryExpressionImpl.h"
17#include "arcane/expr/OperatorMng.h"
18#include "arcane/expr/BadOperationException.h"
29UnaryExpressionImpl (IExpressionImpl* first,eOperationType operation)
32, m_operation(operation)
39String UnaryExpressionImpl::
40operationName(eOperationType type)
44 case UnarySubstract:
return "UnarySubstract";
45 case Inverse:
return "Inverse";
46 case Acos:
return "Acos";
47 case Asin:
return "Asin";
48 case Atan:
return "Atan";
49 case Ceil:
return "Ceil";
50 case Cos:
return "Cos";
51 case Cosh:
return "Cosh";
52 case Exp:
return "Exp";
53 case Fabs:
return "Fabs";
54 case Floor:
return "Floor";
55 case Log:
return "Log";
56 case Log10:
return "Log10";
57 case Sin:
return "Sin";
58 case Sinh:
return "Sinh";
59 case Sqrt:
return "Sqrt";
60 case Tan:
return "Tan";
61 case Tanh:
return "Tanh";
62 default:
return "Unknown";
69void UnaryExpressionImpl::
70apply(ExpressionResult* result)
78 ExpressionResult first_op(result->indices());
79 m_first->apply(&first_op);
82 VariantBase::eType type = first_op.data()->type();
83 UnaryOperator* op = m_op_mng->find(
this, type, m_operation);
85 throw BadOperationException(
"UnaryExpressionImpl::apply", operationName(), type);
87 op->evaluate(result, first_op.data());