38 template <
class T,
class U>
65 virtual void print(std::ostream &str,
int precedence = 99)
const;
85 template <
class T,
class U>
inline
88 fun(rhs.fun), lft(rhs.lft->clone()), rgt(rhs.rgt->clone())
92 template <
class T,
class U>
inline
99 template <
class T,
class U>
inline
104 template <
class T,
class U>
inline
110 template <
class T,
class U>
inline
113 U op1 = lft->evaluate();
114 U op2 = rgt->evaluate();
115 T result = (*fun.function)(op1, op2);
125 if(result ==
T(0))
return result;
134 template <
class T,
class U>
inline
140 bool isConst = left->isConstant() && right->isConstant();
155 template <
class T,
class U>
inline
157 if(fun.precedence >= 0) {
159 if(fun.precedence <= precedence) os <<
"(";
160 lft->print(os, fun.precedence - 1);
162 rgt->print(os, fun.precedence);
163 if(fun.precedence <= precedence) os <<
")";
166 os << fun.name <<
'(';
py::list function(PolynomialPatch *patch, py::list point)
Representation objects and parsers for attribute expressions.
Object * release()
Release ownership.
A scalar expression with two scalar operands.
static Scalar< T > * make(const TFunction2< T, U > &, PtrToScalar< U > left, PtrToScalar< U > right)
Make a new expression.
virtual void print(std::ostream &str, int precedence=99) const
Print expression.
void operator=(const SBinary &)
virtual Scalar< T > * clone() const
Make clone.
virtual T evaluate() const
Evaluate.
const TFunction2< T, U > & fun
A scalar constant expression.
A function of two U's returning a T.