38 template <
class T,
class U>
64 virtual void print(std::ostream &,
int precedence = 99)
const;
83 template <
class T,
class U>
inline
86 fun(rhs.fun), opr(rhs.opr->clone())
90 template <
class T,
class U>
inline
97 template <
class T,
class U>
inline
102 template <
class T,
class U>
inline
108 template <
class T,
class U>
inline
111 U
arg = opr->evaluate();
112 T result = (*fun.function)(
arg);
122 if(result ==
T(0))
return result;
133 template <
class T,
class U>
inline
138 bool isConst =
operand->isConstant();
144 double value = result->evaluate();
154 template <
class T,
class U>
inline
156 if(fun.precedence >= 0) {
157 if(fun.precedence <= precedence) os <<
"(";
159 opr->print(os, fun.precedence);
160 if(fun.precedence <= precedence) os <<
")";
162 os << fun.name <<
"(";
py::list function(PolynomialPatch *patch, py::list point)
Representation objects and parsers for attribute expressions.
boost::variant< nil, bool, unsigned int, double, identifier, boost::recursive_wrapper< unary >, boost::recursive_wrapper< function_call >, boost::recursive_wrapper< expression > > operand
Object * release()
Release ownership.
A scalar constant expression.
A scalar expression with one scalar operand.
virtual Scalar< T > * clone() const
Make clone.
virtual T evaluate() const
Evaluate.
void operator=(const SUnary &)
const TFunction1< T, U > & fun
virtual void print(std::ostream &, int precedence=99) const
Print expression.
static Scalar< T > * make(const TFunction1< T, U > &function, PtrToScalar< U > operand)
Make a new expression.
A function of one U, returning a T.