Sundance::RemoveZeroFromSum Class Reference

Transform a sum by removing a zero term:

\[ x + 0 \rightarrow x. \]

. More...

Inheritance diagram for Sundance::RemoveZeroFromSum:

Sundance::SumTransformation Sundance::SymbolicTransformation Sundance::ObjectWithClassVerbosity< SymbolicTransformation > Playa::ObjectWithVerbosity

List of all members.

Public Member Functions

 RemoveZeroFromSum ()
virtual ~RemoveZeroFromSum ()
virtual bool doTransform (const RCP< ScalarExpr > &left, const RCP< ScalarExpr > &right, int sign, RCP< ScalarExpr > &rtn) const
 Test whether the transform is applicable in this case, and if it is, apply it.


Detailed Description

Transform a sum by removing a zero term:

\[ x + 0 \rightarrow x. \]

.

Definition at line 127 of file SundanceStdSumTransformations.hpp.


Constructor & Destructor Documentation

Sundance::RemoveZeroFromSum::RemoveZeroFromSum (  )  [inline]

Definition at line 131 of file SundanceStdSumTransformations.hpp.

virtual Sundance::RemoveZeroFromSum::~RemoveZeroFromSum (  )  [inline, virtual]

Definition at line 134 of file SundanceStdSumTransformations.hpp.


Member Function Documentation

bool RemoveZeroFromSum::doTransform ( const RCP< ScalarExpr > &  left,
const RCP< ScalarExpr > &  right,
int  sign,
RCP< ScalarExpr > &  rtn 
) const [virtual]

Test whether the transform is applicable in this case, and if it is, apply it.

The return value is true is the transformation was applied, otherwise false. Returns by non-const reference the transformed expression.

Implements Sundance::SumTransformation.

Definition at line 373 of file SundanceStdSumTransformations.cpp.

References Sundance::SymbolicTransformation::chooseSign(), Playa::Out::println(), removeZeroTimer(), SUNDANCE_OUT, Sundance::ConstantExpr::value(), and Playa::ObjectWithVerbosity::verb().

Site Contact