Differences

This shows you the differences between two versions of the page.

Link to this comparison view

documentation:ref:reverse [2015/11/21 12:33] (current)
Line 1: Line 1:
 +====== Reverse ======
 +
 +----
 +====Description====
 +  * ''​Reverse[type]''​ reverses the order of matrices of specified ''​type''​. ​
 +
 +  * ''​Reverse[type1,​ type2, ...]''​ reverses the order of matrices of types ''​type1'',​ ''​type2'',​ ... in expressions.
 + ​====Examples====
 +----
 +Reverse product of matrices:
 +<sxh groovy; gutter: true>
 +defineMatrices '​A',​ '​B',​ '​C',​ Matrix1.matrix
 +def t = '​A*B*C'​.t
 +println t
 +</​sxh>​
 +<sxh plain; gutter: false>
 +   > A*B*C
 +</​sxh>​
 +<sxh groovy; gutter: true; first-line: 4>
 +println Reverse[Matrix1] >> t
 +</​sxh>​
 +<sxh plain; gutter: false>
 +   > C*B*A
 +</​sxh>​
 +----
 +Reverse does not affect traces:
 +<sxh groovy>
 +defineMatrices '​A',​ '​B',​ '​C',​ Matrix1.matrix
 +println Reverse[Matrix1] ​ >> '​Tr[A*B*C]'​.t
 +</​sxh>​
 +<sxh plain; gutter: false>
 +   > Tr[A*B*C]
 +</​sxh>​
 +----
 +Reverse with respect to several types of matrices:
 +<sxh groovy; gutter: true>
 +defineMatrices '​G_a',​ Matrix1.matrix,​ '​U_a',​ Matrix2.matrix
 +def t = '​G_a*G_b*U_m*U_n'​.t
 +println Reverse[Matrix1,​ Matrix2] >> t
 +</​sxh>​
 +<sxh plain; gutter: false>
 +   > G_b*G_a*U_n*U_m
 +</​sxh>​
 +
 +====See also====
 +  * Related guides: [[documentation:​guide:​applying_and_manipulating_transformations]],​ [[documentation:​guide:​setting_up_matrix_objects]],​ [[documentation:​guide:​list_of_transformations]]
 +  * JavaDocs: [[http://​api.redberry.cc/​redberry/​1.1.9/​java-api/​cc/​redberry/​core/​transformations/​reverse/​ReverseTransformation.html| ReverseTransformation]]
 +  * Source code: [[https://​bitbucket.org/​redberry/​redberry/​src/​tip/​core/​src/​main/​java/​cc/​redberry/​core/​transformations/​reverse/​ReverseTransformation.java|ReverseTransformation.java]]