Public Member Functions
Sundance::RearrangeRightProductWithConstant Class Reference

Rearrange a product whose right operand is a product including a constant such that constants are grouped on the left:

\[ \alpha (\beta u) \rightarrow (\alpha\beta) u \]

\[ u (\alpha v) \rightarrow \alpha (u v) \]

. More...

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

List of all members.

Public Member Functions

 RearrangeRightProductWithConstant ()
virtual ~RearrangeRightProductWithConstant ()
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

Rearrange a product whose right operand is a product including a constant such that constants are grouped on the left:

\[ \alpha (\beta u) \rightarrow (\alpha\beta) u \]

\[ u (\alpha v) \rightarrow \alpha (u v) \]

.

Definition at line 314 of file SundanceStdProductTransformations.hpp.


Constructor & Destructor Documentation

Sundance::RearrangeRightProductWithConstant::RearrangeRightProductWithConstant ( ) [inline]

Definition at line 318 of file SundanceStdProductTransformations.hpp.

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

Definition at line 321 of file SundanceStdProductTransformations.hpp.


Member Function Documentation

bool RearrangeRightProductWithConstant::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 473 of file SundanceStdProductTransformations.cpp.

References Sundance::SymbolicTransformation::getScalar(), Sundance::Expr::handle(), Sundance::ExprWithChildren::isConstant(), Sundance::ScalarExpr::isConstant(), Sundance::BinaryExpr::left(), Sundance::BinaryExpr::leftScalar(), Sundance::Out::println(), Sundance::BinaryExpr::right(), Sundance::BinaryExpr::rightScalar(), Sundance::Expr::toString(), and Sundance::DefaultObjectWithVerbosity::verb().

Site Contact