Public Member Functions
Sundance::MoveConstantsToLeftOfProduct Class Reference

Transform a product by moving any constants to the left:

\[ x \times a \rightarrow a \times x \]

. More...

Inheritance diagram for Sundance::MoveConstantsToLeftOfProduct:
Sundance::ProductTransformation Sundance::SymbolicTransformation Sundance::ObjectWithClassVerbosity< SymbolicTransformation > Sundance::DefaultObjectWithVerbosity Sundance::ObjectWithVerbosityBase

List of all members.

Public Member Functions

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

Detailed Description

Transform a product by moving any constants to the left:

\[ x \times a \rightarrow a \times x \]

.

Definition at line 154 of file SundanceStdProductTransformations.hpp.


Constructor & Destructor Documentation

Sundance::MoveConstantsToLeftOfProduct::MoveConstantsToLeftOfProduct ( ) [inline]

Definition at line 158 of file SundanceStdProductTransformations.hpp.

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

Definition at line 161 of file SundanceStdProductTransformations.hpp.


Member Function Documentation

bool MoveConstantsToLeftOfProduct::doTransform ( const RCP< ScalarExpr > &  left,
const RCP< ScalarExpr > &  right,
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::ProductTransformation.

Definition at line 203 of file SundanceStdProductTransformations.cpp.

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

Site Contact