Class MultiplyVectorMatrixRule
java.lang.Object
com.singularsys.extensions.rewrite.AbstractRewrite
com.singularsys.extensions.rewrite.matrix.AbstractVectorMatrixRule
com.singularsys.extensions.rewrite.matrix.MultiplyVectorMatrixRule
- All Implemented Interfaces:
RewriteRuleI,JepComponent,Serializable
A rule which expands multiplication of vectors and matrices.
[u,v] * [[a,b],[c,d]] -> [u*a+v*c,u*b+v*d]
[[a,b],[c,d]] * [u,v] -> [a*u+b*v,c*u+d*v]
[[a,b],[c,d]] * [[p,q],[r,s]] -> [[a*p+b*r,a*q+b*s],[c*p+d*r,c*q+d*s]] - Since:
- Jep 4.1 extensions 2.2
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.extensions.rewrite.matrix.AbstractVectorMatrixRule
dv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(ASTFunNode node, List<Node> children) Rewrites the nodebooleantest(ASTFunNode node, List<Node> children) Returns true if node needs to be rewritten, according to this rule.Methods inherited from class com.singularsys.extensions.rewrite.matrix.AbstractVectorMatrixRule
asList, asListOfLists, init, matrixToListOfLists, vectorToListMethods inherited from class com.singularsys.extensions.rewrite.AbstractRewrite
getLightWeightInstance, toString
-
Constructor Details
-
MultiplyVectorMatrixRule
public MultiplyVectorMatrixRule()
-
-
Method Details
-
test
Description copied from interface:RewriteRuleIReturns true if node needs to be rewritten, according to this rule.- Throws:
ParseException- if for some reason rewriting cannot be performed.
-
apply
Description copied from interface:RewriteRuleIRewrites the node- Throws:
ParseException
-