cc.redberry.core.transformations
Class CollectScalarFactorsTransformation
- java.lang.Object
-
- cc.redberry.core.transformations.CollectScalarFactorsTransformation
-
- All Implemented Interfaces:
- Transformation
public class CollectScalarFactorsTransformation extends java.lang.Object implements Transformation
Puts together similar scalar subproducts in each product. For example, tensor A_m*A^m*A_n*A^n will be transformed to tensor (A_m*A^m)**2.- Since:
- 1.1
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface cc.redberry.core.transformations.Transformation
Transformation.Util
-
-
Field Summary
Fields Modifier and Type Field and Description static CollectScalarFactorsTransformationCOLLECT_SCALAR_FACTORSSingleton default instance.-
Fields inherited from interface cc.redberry.core.transformations.Transformation
INDENTITY
-
-
Constructor Summary
Constructors Constructor and Description CollectScalarFactorsTransformation(TraverseGuide traverseGuide)Creates transformation for particular parts of expressions, specified by traverse guide.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static TensorcollectScalarFactors(Tensor tensor)Puts together similar scalar subproducts in each product.static TensorcollectScalarFactors(Tensor tensor, TraverseGuide traverseGuide)Puts together similar scalar subproducts in each product of expression, which can be traversed with specified traverse guide.static TensorcollectScalarFactorsInProduct(Product product)Puts together similar scalar subproducts in a given product.Tensortransform(Tensor t)Transforms specified tensor and returns the result.
-
-
-
Field Detail
-
COLLECT_SCALAR_FACTORS
public static final CollectScalarFactorsTransformation COLLECT_SCALAR_FACTORS
Singleton default instance.
-
-
Constructor Detail
-
CollectScalarFactorsTransformation
public CollectScalarFactorsTransformation(TraverseGuide traverseGuide)
Creates transformation for particular parts of expressions, specified by traverse guide.- Parameters:
traverseGuide- specifies parts of expression to apply the transformation
-
-
Method Detail
-
transform
public Tensor transform(Tensor t)
Description copied from interface:TransformationTransforms specified tensor and returns the result.- Specified by:
transformin interfaceTransformation- Parameters:
t- tensor- Returns:
- transformed tensor
-
collectScalarFactors
public static Tensor collectScalarFactors(Tensor tensor)
Puts together similar scalar subproducts in each product. For example, tensor A_m*A^m*A_n*A^n will be transformed to tensor (A_m*A^m)**2.- Parameters:
tensor- tensor- Returns:
- the result
-
collectScalarFactors
public static Tensor collectScalarFactors(Tensor tensor, TraverseGuide traverseGuide)
Puts together similar scalar subproducts in each product of expression, which can be traversed with specified traverse guide.- Parameters:
tensor- tensortraverseGuide- specifies parts of expression to apply the transformation- Returns:
- the result
-
-
DataMelt 3.0 © DataMelt by jWork.ORG