I have had this problem way too often and still have not found a solution, yet. One acually used code is:`
VectorQuantity[perms_List, dim_Integer] :=
Module[
{elementList := Range[1, dim],
collectionList := {},
v = {}},
If[collectionList = Union[collectionList, v];
MemberQ[collectionList, #],
Unevaluated[Sequence[]],
v = PermutationReplace[#, perms]] & /@ elementList]
perms is a list of cycles. During the mapping over elementList
I find elements over which I do not want to map anymore. Right now, they are put into a list, and I use If
and MemberQ
. I know that there are more issues with the code like the ;
within the condition, but those do not matter to me, right now. What I am asking for is whether there is a good way to control the part behind the /@
I apologize for unclearness in the unedited question. I am rather new to Mathematica, and my English is terrible ;)
MemberQ
and then effectively dropping the element withUnevaluated[Sequence[]]
? (Which by the way you can replace with## &[]
.) Conceptually how else would you do this? $\endgroup$