On 06/17/2018 11:57 PM, Richard B. Kreckel wrote:
Two comments on your patch.
1) This line + for (auto && r : m) { looks unconventional due to it's using rvalue refs. Is this intentional? It doesn't make a difference in GCC (same asm code).
What I actually meant to write is "const auto &"; "auto &&" should be the same, but shorter. I think the "&&" form was introduced so that templates could seamlessly support both const and non- const usage, but I found it useful in normal code too. In any case, I'll make the "const" explicit (not that it matters in this particular example).
2) Be careful when computing the matrix' density by counting non-zero elements: That loop breaks out on the first non-numeric element. The later decision on what yo use with density might be wrong. Maybe you want to compute numeric_flag and density in two separate loops?
Dammit. My mistake, sorry. Here's the updated patch. I've additionally included a minor update to the comment near solve_algo::markowitz definition.