Michael Wijaya
Reputation
1,422
Next privilege 2,000 Rep.
 Jul 3 comment Convert head Times to List When should we use Unevaluated as opposed to Hold? Jul 3 revised Convert head Times to List added 212 characters in body Jul 3 answered Convert head Times to List Jun 28 comment Mathematica for Computer Scientists Gray's "Mastering Mathematica" has a nice chapter on rule-based programming followed by a discussion of substitution and Lambda calculus, so you may want to check that out. Jun 18 accepted Implementing a function which generalizes the merging step in merge sort Jun 18 comment Implementing a function which generalizes the merging step in merge sort I am still developing my feel for efficient programs, so it helps to look at other implementations even if they are not the fastest possible. Leonid's commentary also adds value to your answer. +1 Jun 17 awarded Nice Question Jun 17 comment Implementing a function which generalizes the merging step in merge sort I think I know what is going on now. There is some caching going on in the previous section, thus the comment on clearMergeJITCache. Jun 17 comment Implementing a function which generalizes the merging step in merge sort You evaluated mergeList[huge1,huge2,Less,CompileToC -> True]//Short//AbsoluteTiming twice at the beginning of the Benchmarks section, but the timing results are significantly different. Am I missing something here? Jun 17 comment Implementing a function which generalizes the merging step in merge sort The difference in performance is astounding: 0.12s vs 1.23s for lists of lengths 10000 and 1.13s vs 146.60s for lists of length 100000. I find it reassuring that even without making significant changes to the straightforward recursion, I can get major performance boost by switching to linked lists. Perhaps reading The Little Schemer did not cause too much harm. Jun 17 revised Implementing a function which generalizes the merging step in merge sort Added sample output Jun 17 comment Implementing a function which generalizes the merging step in merge sort @Rojo Thanks for pointing out the ambiguity. I edited the question. Jun 17 revised Implementing a function which generalizes the merging step in merge sort Added clarification in response to question by Rojo Jun 17 comment Implementing a function which generalizes the merging step in merge sort @Rojo For MergeList, the two lists need not be sorted. For example, MergeList[{2, 5, 1}, {3, 4}, LessEqual] evaluates to {2, 3, 4, 5, 1}. Jun 17 asked Implementing a function which generalizes the merging step in merge sort Jun 16 awarded Autobiographer Jun 15 comment How to substitute numeric values in a symbolic Jacobian matrix? +1 for explaining what went wrong in M.J.'s code and the use of ArrayRules + ArrayPlot. Jun 15 revised How to substitute numeric values in a symbolic Jacobian matrix? deleted 395 characters in body Jun 15 revised How to substitute numeric values in a symbolic Jacobian matrix? Updated following M.J.'s comments Jun 14 comment How to substitute numeric values in a symbolic Jacobian matrix? @J.M. I did not know that variables for D need not be a symbol. This is good to know.