====== 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: defineMatrices 'A', 'B', 'C', Matrix1.matrix def t = 'A*B*C'.t println t > A*B*C println Reverse[Matrix1] >> t > C*B*A ---- Reverse does not affect traces: defineMatrices 'A', 'B', 'C', Matrix1.matrix println Reverse[Matrix1] >> 'Tr[A*B*C]'.t > Tr[A*B*C] ---- Reverse with respect to several types of matrices: 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 > G_b*G_a*U_n*U_m ====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]]