2#define OPAL_ASUnary_HH 1
67 virtual void print(std::ostream &,
int precedence = 99)
const;
86 template <
class T>
inline
89 fun(rhs.fun), opr(rhs.opr->clone())
93 template <
class T>
inline
100 template <
class T>
inline
105 template <
class T>
inline
111 template <
class T>
inline
114 const std::vector<T>
arg = opr->evaluate();
115 T result = (*fun.function)(
arg);
125 if(result ==
T(0))
return result;
136 template <
class T>
inline
141 bool isConst = oper->isConstant();
157 template <
class T>
inline
159 if(fun.precedence >= 0) {
160 if(fun.precedence <= precedence) os <<
"(";
162 opr->print(os, fun.precedence);
163 if(fun.precedence <= precedence) os <<
")";
165 os << fun.name <<
"(";
py::list function(PolynomialPatch *patch, py::list point)
Representation objects and parsers for attribute expressions.
A pointer to a scalar expression.
A pointer to an array expression.
Object * release()
Release ownership.
A scalar expression with one array operand.
virtual void print(std::ostream &, int precedence=99) const
Print expression.
static PtrToScalar< T > make(const TFunction1< T, const std::vector< T > & > &function, PtrToArray< T > &oper)
Make new expression.
virtual T evaluate() const
Evaluate expression.
void operator=(const ASUnary &)
virtual Scalar< T > * clone() const
Make clone.
const TFunction1< T, const std::vector< T > & > & fun
A scalar constant expression.
A function of one U, returning a T.