cc.redberry.core.parser.preprocessor
Class GeneralIndicesInsertion
- java.lang.Object
-
- cc.redberry.core.parser.preprocessor.GeneralIndicesInsertion
-
- All Implemented Interfaces:
- ParseTokenTransformer
public class GeneralIndicesInsertion extends java.lang.Object implements ParseTokenTransformer
AST transformer, which inserts additional indices to specified tensors according to the rules of matrix multiplication. It is useful in situations where one is faced with the need to input many huge matrix expressions, and manual indices insertion becomes a complex task.- Since:
- 1.1
-
-
Constructor Summary
Constructors Constructor and Description GeneralIndicesInsertion()Creates blank GeneralIndicesInsertion transformer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddInsertionRule(NameDescriptor nd, IndexType omittedIndexType)voidaddInsertionRule(SimpleTensor tensor, IndexType omittedIndexType)Adds new insertion rule to this transformer.ParseTokentransform(ParseToken node)Transforms specified AST node.
-
-
-
Constructor Detail
-
GeneralIndicesInsertion
public GeneralIndicesInsertion()
Creates blank GeneralIndicesInsertion transformer.
-
-
Method Detail
-
addInsertionRule
public void addInsertionRule(SimpleTensor tensor, IndexType omittedIndexType)
Adds new insertion rule to this transformer.After rule is added you can omit indices of specified type in specified simple tensors, when this transformer is passed to
Tensors.parse(String, cc.redberry.core.parser.ParseTokenTransformer...)method or somehow added to default parse nodes preprocessor.- Parameters:
tensor- simple tensoromittedIndexType- type of indices that may be omitted
-
addInsertionRule
public void addInsertionRule(NameDescriptor nd, IndexType omittedIndexType)
-
transform
public ParseToken transform(ParseToken node)
Description copied from interface:ParseTokenTransformerTransforms specified AST node.- Specified by:
transformin interfaceParseTokenTransformer- Parameters:
node- AST node.- Returns:
- transformed AST node
-
-
DataMelt 3.0 © DataMelt by jWork.ORG