Huge matrices crashes in MathematicaThat matrix would take up 78GB of RAM if it were a PackedArray. If it wasn't, it'd need hundreds of GB of RAM. 32GB RAM isn't enough. I think Leonid Shifrin had a big-array package, but I've never used it.

How to sort colors properly?Interesting. That reduces it to a traveling salesman problem, where the distance metric is CIELAB, rather than Euclidean. I'll see what I can do.

Jul5

comment

How to sort colors properly?Both your solutions are right. The dark and light bands are to be expected. The first sorts by hue, regardless of brightness, and it does exactly that; the brightness is not taken into account in the sort. The same happens for your a* sort.

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.