Public Member Functions
Sundance::MoveConstantsToLeftOfSum Class Reference

Transform a sum by moving any constants to the left:

\[ x + a \rightarrow a + x \]

. More...

Inheritance diagram for Sundance::MoveConstantsToLeftOfSum:
Sundance::SumTransformation Sundance::SymbolicTransformation Sundance::ObjectWithClassVerbosity< SymbolicTransformation > Sundance::DefaultObjectWithVerbosity Sundance::ObjectWithVerbosityBase

List of all members.

Public Member Functions

 MoveConstantsToLeftOfSum ()
virtual ~MoveConstantsToLeftOfSum ()
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 moving any constants to the left:

\[ x + a \rightarrow a + x \]

.

Definition at line 166 of file SundanceStdSumTransformations.hpp.


Constructor & Destructor Documentation

Sundance::MoveConstantsToLeftOfSum::MoveConstantsToLeftOfSum ( ) [inline]

Definition at line 170 of file SundanceStdSumTransformations.hpp.

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

Definition at line 173 of file SundanceStdSumTransformations.hpp.


Member Function Documentation

bool MoveConstantsToLeftOfSum::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 412 of file SundanceStdSumTransformations.cpp.

References Sundance::SymbolicTransformation::chooseSign(), Sundance::SymbolicTransformation::getScalar(), Sundance::Expr::handle(), moveConstantsTimer(), Sundance::Out::println(), and Sundance::DefaultObjectWithVerbosity::verb().

Site Contact