Timeline for Problem with Custom Sort/Split/Gather
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Sep 23, 2016 at 20:50 | history | suggested | LCarvalho | CC BY-SA 3.0 |
Formatting for better presentation
|
Sep 23, 2016 at 20:35 | review | Suggested edits | |||
S Sep 23, 2016 at 20:50 | |||||
Feb 23, 2016 at 16:51 | comment | added | Steve | Similarly GatherBy[rings[3], Lmag@Coefficient[#1, {q1, q2, q3}] &] gives the output in reversed order? Obviously I could Reverse it, but I need to understand it much more generally for later cases with many more subsets. | |
Feb 23, 2016 at 16:50 | comment | added | Steve | Gather[rings[3], Lmag@Coefficient[#1, {q1, q2, q3}] <= Lmag@Coefficient[#2, {q1, q2, q3}] &] gives almost the correct result, except that the two sets are backwards in that case. You can check things like N@Lmag[{2, -1, 0}] and N@Lmag[{1, 1, -1}] to see that the Gather is collecting the larger "Sqrt[7]-magnitude" elements before the smaller "2-magnitude" elements | |
Feb 23, 2016 at 16:36 | comment | added | Steve | Thank you for the syntax error! Indeed, someone else just found that in the comments a moment ago. I understand that a reader here wouldn't know, but, unfortunately that output is not the desired. The desired output would be a list of two lists. The first list should contain 3 elements which are linear combinations including all 3 qs (like q1-q2+q3). The second list should contain 6 elements which are linear combinations including a prefactor 2 (like -q1+2 q2). | |
Feb 23, 2016 at 16:34 | history | answered | Jack LaVigne | CC BY-SA 3.0 |