def project_one(subexpr): from pymbolic.primitives import is_constant if self.dd_in == self.dd_out: # no-op projection, go away return subexpr elif is_constant(subexpr): return subexpr else: from grudge.symbolic.primitives import OperatorBinding return OperatorBinding(self, subexpr)
def bind_one(subexpr): if is_zero(subexpr): return subexpr else: from grudge.symbolic.primitives import OperatorBinding return OperatorBinding(self, subexpr)