Timeline for Lazy form of Tuples/Outer to loop over list of lists
Current License: CC BY-SA 3.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 29, 2016 at 0:58 | comment | added | Leonid Shifrin | @matheorem Perhaps you are right. I will have to look into it myself to see. There may be faster methods than the one I suggested above. I will look into it when I get a moment, I just don't know when that would be. | |
| Aug 29, 2016 at 0:13 | comment | added | matheorem | I have tested it, I can see there is a limit of chunk size after which further increase chunk size will not reduce timing any more. Though lazy version is destined to be slower than built-in version, but more than hundreds times slower than Tuples make it not unpractical to be severed as a general approach to circumvent memory constraints if we have to traverse all the tuples. Specific method have to be used, for example, my post mathematica.stackexchange.com/q/124984/4742 wuyingddg provides a solution which is so hard to beat. But this kind of specific solution needs much more wit | |
| Aug 28, 2016 at 16:14 | comment | added | Leonid Shifrin | Hi @matheorem. Unfortunately I don't have the time to test right now, but the speed depends also on the chunk size. For a better speed, the chunk size should be large enough. Try chunk size of about 10000 or more, and see if that helps. That said, the built-in version will always be much faster. The point of lazy version is that it does not need to realize all tuples at once. | |
| Aug 28, 2016 at 15:10 | comment | added | matheorem | Hi, Leonid. Your lazy tuple is so useful. The only problem is the performace is somewhat too slow. for example, let list=Table[Range[100], 3], Tuples[list] only takes 0.03 sec. However, to generate full tuple using iter[] takes totally 3 sec | |
| Mar 10, 2016 at 0:48 | vote | accept | Manuel --Moe-- G | ||
| Mar 10, 2016 at 0:40 | history | edited | Leonid Shifrin | CC BY-SA 3.0 | Removed unused variable, improved formatting. |
| Mar 10, 2016 at 0:32 | history | answered | Leonid Shifrin | CC BY-SA 3.0 |