It's well known that in the process of developing a package or complex script writing and debugging, we need to have many custom variable names, such as the following code snippets:
In[1]:= "cGAP12 := [[-1, -1, 1, 3/4], [1, -1, -1, -5/4], [-1, 1, -1, \
-5/4], [0, 0, 0, 1]];" //
StringReplace[#, {"\n " -> "", "[" -> "{", "]" -> "}", ":=" -> "=",
";" -> ""}] & // ToExpression;
"lat12 := [[1, -1, -1], [1, 1, -1], [1, -1, 1]];" //
StringReplace[#, {"\n " -> "", "[" -> "{", "]" -> "}", ":=" -> "=",
";" -> ""}] & // ToExpression;
zeroTranLat12 =
AffineTransform[{lat12, {0, 0, 0}}] // TransformationMatrix
"cx := [ [ 0, 0, 1, 1/2 ], [ 0, 1, 0, 1/2 ], [ 1, -1, -1, -1/2 ], [ \
0, 0, 0, 1 ] ];" //
StringReplace[#, {"\n " -> "", "[" -> "{", "]" -> "}",
":=" -> "=",
";" -> ""}] & // ToExpression;
c2 = cx . zeroTranLat12
Out[3]= {{1, -1, -1, 0}, {1, 1, -1, 0}, {1, -1, 1, 0}, {0, 0, 0, 1}}
Out[5]= {{1, -1, 1, 1/2}, {1, 1, -1, 1/2}, {-1, -1, -1, -(1/2)}, {0,
0, 0, 1}}
I'm still very confused about this question. Is there a rule of thumb on how I should better name these variables so that I can use them better?
Regards, Zhao