Differences

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

Link to this comparison view

documentation:ref:collectnonscalars [2015/11/21 12:33]
documentation:ref:collectnonscalars [2015/11/21 12:33] (current)
Line 1: Line 1:
 +====== CollectNonScalars ======
 +----
 +====Description====
 +  * ''​CollectNonScalars''​ collects terms in sums with same tensorial parts. In contrast to standard Redberry behaviour when factored out tersorial parts with nonzero sized idices, ''​CollectNonScalars''​ tries to factor out parts with nonzero sized free indices.
 +====Examples====
 +----
 +Collect same tensorial parts:
 +<sxh groovy; gutter: true>
 +//by default, B_m will not be factored out
 +def t = '​A_i*A^i*B_m + B_m'.t
 +println t
 +</​sxh>​
 +<sxh plain; gutter:​false>​
 +   > A_i*A^i*B_m + B_m
 +</​sxh>​
 +<sxh groovy; gutter: true; first-line: 4>
 +//now will
 +println CollectNonScalars >> t
 +</​sxh>​
 +<sxh plain; gutter:​false>​
 +   > (A_i*A^i + 1)*B_m
 +</​sxh>​
 +
 +----
 +Another example:
 +<sxh groovy; gutter: false>
 +setSymmetric '​R_mn'​
 +println CollectNonScalars >> '​A_t*A^t*R_mn - B_t*B^t*R_nm'​.t
 +</​sxh>​
 +<sxh plain; gutter:​false>​
 +   > (A_{t}*A^{t}-B_{t}*B^{t})*R_{mn}
 +</​sxh>​
 +----
 +
 +====See also====
 +  * Related guides: [[documentation:​guide:​applying_and_manipulating_transformations]],​ [[documentation:​guide:​list_of_transformations]]
 +  * JavaDocs: [[http://​api.redberry.cc/​redberry/​1.1.9/​java-api/​cc/​redberry/​core/​transformations/​CollectNonScalarsTransformation.html| CollectNonScalarFactorsTransformation]]
 +  * Source code: [[https://​bitbucket.org/​redberry/​redberry/​src/​tip/​core/​src/​main/​java/​cc/​redberry/​core/​transformations/​CollectNonScalarsTransformation.java|CollectNonScalarsTransformation.java]]